Skip to content

Commit

Permalink
Merge tag 'v5.15.175' into 5.15-main
Browse files Browse the repository at this point in the history
This is the 5.15.175 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmdkUtcACgkQONu9yGCS
# aT4Y9xAAlzaAgwXdnBxk5qpFo/UfgAJZ6tpiIZMJyznyvXEqa7saBGvMMI6GDKjh
# HKm0mgQm1ci1kbKh/wJWNbrhmOiwP3N0W+bBkBzQppPoKFFDjXMLHpWIFYZuBKOp
# W8X5UKkSxr+OQjAMn//CBDl8u7BtCPFGQm57ysDoPNMgT6Nshi/F5GGMaed8WC0L
# 1wjoOexnkJJgDD+5bCvXt/dY7ObiH+Giw54GMYfCzlg95dueLVLiqVVwfbCxTRo4
# uSfc9URrNR8SNMETOvCy6xSqGoGt9HkoI+v3emMNCLXy026d49+wAtwJA6JdIPdF
# 85gZcvKkjsEMOk8QBYgZGEl0ZrO/Y2W/+yYYAxww0YHc4i+4+7QxMD2WBBcd8rgn
# OOZZRjfDHOG/1ASHVS3cIwFq1VfljyrGk9Cz47FMuv9xRqq7j3rSDLRECasDpAgU
# J/G4ck6zaTw+0ZqLLmIs6nmyMoIPK6CZE39MxDMbpVuqHlDN8ipETFPZ9BL79xJd
# vM41rCjUwHMh7kLUDfFIPiYhVe0A/gt6OsPrGY/Xs5bUkIchsTV5NvQmZR4hI590
# dj51twpMeLLi4Rn0CwDaQNdEi7mS6793nfWGdTPfCRNt1uyiRz9IzNBoFut5xWOr
# gn4itkNFAS6BYrnl000FglMRZ+ZpIP/7GLTtnXyk+Gxe7Atnc1w=
# =QEWS
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu Dec 19 18:07:35 2024 CET
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Can't check signature: No public key
  • Loading branch information
frank-w committed Dec 29, 2024
2 parents 83d9d94 + 91786f1 commit 5783276
Show file tree
Hide file tree
Showing 61 changed files with 593 additions and 238 deletions.
4 changes: 3 additions & 1 deletion Documentation/power/runtime_pm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:

`int pm_runtime_resume_and_get(struct device *dev);`
- run pm_runtime_resume(dev) and if successful, increment the device's
usage counter; return the result of pm_runtime_resume
usage counter; returns 0 on success (whether or not the device's
runtime PM status was already 'active') or the error code from
pm_runtime_resume() on failure.

`int pm_request_idle(struct device *dev);`
- submit a request to execute the subsystem-level idle callback for the
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 15
SUBLEVEL = 174
SUBLEVEL = 175
EXTRAVERSION =
NAME = Trick or Treat

Expand Down
1 change: 0 additions & 1 deletion arch/parisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ config PARISC
select ARCH_SPLIT_ARG64 if !64BIT
select ARCH_SUPPORTS_HUGETLBFS if PA20
select ARCH_SUPPORTS_MEMORY_FAILURE
select ARCH_HAS_CACHE_LINE_SIZE
select DMA_OPS
select RTC_CLASS
select RTC_DRV_GENERIC
Expand Down
11 changes: 1 addition & 10 deletions arch/parisc/include/asm/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@

#define SMP_CACHE_BYTES L1_CACHE_BYTES

#ifdef CONFIG_PA20
#define ARCH_DMA_MINALIGN 128
#else
#define ARCH_DMA_MINALIGN 32
#endif
#define ARCH_KMALLOC_MINALIGN 16 /* ldcw requires 16-byte alignment */

#define arch_slab_minalign() ((unsigned)dcache_stride)
#define cache_line_size() dcache_stride
#define dma_get_cache_alignment cache_line_size
#define ARCH_DMA_MINALIGN L1_CACHE_BYTES

#define __read_mostly __section(".data..read_mostly")

Expand Down
2 changes: 2 additions & 0 deletions arch/x86/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ static inline unsigned long long l1tf_pfn_limit(void)
return BIT_ULL(boot_cpu_data.x86_cache_bits - 1 - PAGE_SHIFT);
}

void init_cpu_devs(void);
void get_cpu_vendor(struct cpuinfo_x86 *c);
extern void early_cpu_init(void);
extern void identify_boot_cpu(void);
extern void identify_secondary_cpu(struct cpuinfo_x86 *);
Expand Down
15 changes: 15 additions & 0 deletions arch/x86/include/asm/static_call.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,19 @@

extern bool __static_call_fixup(void *tramp, u8 op, void *dest);

extern void __static_call_update_early(void *tramp, void *func);

#define static_call_update_early(name, _func) \
({ \
typeof(&STATIC_CALL_TRAMP(name)) __F = (_func); \
if (static_call_initialized) { \
__static_call_update(&STATIC_CALL_KEY(name), \
STATIC_CALL_TRAMP_ADDR(name), __F);\
} else { \
WRITE_ONCE(STATIC_CALL_KEY(name).func, _func); \
__static_call_update_early(STATIC_CALL_TRAMP_ADDR(name),\
__F); \
} \
})

#endif /* _ASM_STATIC_CALL_H */
6 changes: 3 additions & 3 deletions arch/x86/include/asm/sync_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <asm/special_insns.h>

#ifdef CONFIG_X86_32
static inline void iret_to_self(void)
static __always_inline void iret_to_self(void)
{
asm volatile (
"pushfl\n\t"
Expand All @@ -19,7 +19,7 @@ static inline void iret_to_self(void)
: ASM_CALL_CONSTRAINT : : "memory");
}
#else
static inline void iret_to_self(void)
static __always_inline void iret_to_self(void)
{
unsigned int tmp;

Expand Down Expand Up @@ -55,7 +55,7 @@ static inline void iret_to_self(void)
* Like all of Linux's memory ordering operations, this is a
* compiler barrier as well.
*/
static inline void sync_core(void)
static __always_inline void sync_core(void)
{
/*
* The SERIALIZE instruction is the most straightforward way to
Expand Down
36 changes: 22 additions & 14 deletions arch/x86/include/asm/xen/hypercall.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
#include <linux/string.h>
#include <linux/types.h>
#include <linux/pgtable.h>
#include <linux/instrumentation.h>

#include <trace/events/xen.h>

#include <asm/alternative.h>
#include <asm/page.h>
#include <asm/smap.h>
#include <asm/nospec-branch.h>
Expand Down Expand Up @@ -86,11 +88,20 @@ struct xen_dm_op_buf;
* there aren't more than 5 arguments...)
*/

extern struct { char _entry[32]; } hypercall_page[];
void xen_hypercall_func(void);
DECLARE_STATIC_CALL(xen_hypercall, xen_hypercall_func);

#define __HYPERCALL "call hypercall_page+%c[offset]"
#define __HYPERCALL_ENTRY(x) \
[offset] "i" (__HYPERVISOR_##x * sizeof(hypercall_page[0]))
#ifdef MODULE
#define __ADDRESSABLE_xen_hypercall
#else
#define __ADDRESSABLE_xen_hypercall __ADDRESSABLE_ASM_STR(__SCK__xen_hypercall)
#endif

#define __HYPERCALL \
__ADDRESSABLE_xen_hypercall \
"call __SCT__xen_hypercall"

#define __HYPERCALL_ENTRY(x) "a" (x)

#ifdef CONFIG_X86_32
#define __HYPERCALL_RETREG "eax"
Expand Down Expand Up @@ -148,7 +159,7 @@ extern struct { char _entry[32]; } hypercall_page[];
__HYPERCALL_0ARG(); \
asm volatile (__HYPERCALL \
: __HYPERCALL_0PARAM \
: __HYPERCALL_ENTRY(name) \
: __HYPERCALL_ENTRY(__HYPERVISOR_ ## name) \
: __HYPERCALL_CLOBBER0); \
(type)__res; \
})
Expand All @@ -159,7 +170,7 @@ extern struct { char _entry[32]; } hypercall_page[];
__HYPERCALL_1ARG(a1); \
asm volatile (__HYPERCALL \
: __HYPERCALL_1PARAM \
: __HYPERCALL_ENTRY(name) \
: __HYPERCALL_ENTRY(__HYPERVISOR_ ## name) \
: __HYPERCALL_CLOBBER1); \
(type)__res; \
})
Expand All @@ -170,7 +181,7 @@ extern struct { char _entry[32]; } hypercall_page[];
__HYPERCALL_2ARG(a1, a2); \
asm volatile (__HYPERCALL \
: __HYPERCALL_2PARAM \
: __HYPERCALL_ENTRY(name) \
: __HYPERCALL_ENTRY(__HYPERVISOR_ ## name) \
: __HYPERCALL_CLOBBER2); \
(type)__res; \
})
Expand All @@ -181,7 +192,7 @@ extern struct { char _entry[32]; } hypercall_page[];
__HYPERCALL_3ARG(a1, a2, a3); \
asm volatile (__HYPERCALL \
: __HYPERCALL_3PARAM \
: __HYPERCALL_ENTRY(name) \
: __HYPERCALL_ENTRY(__HYPERVISOR_ ## name) \
: __HYPERCALL_CLOBBER3); \
(type)__res; \
})
Expand All @@ -192,7 +203,7 @@ extern struct { char _entry[32]; } hypercall_page[];
__HYPERCALL_4ARG(a1, a2, a3, a4); \
asm volatile (__HYPERCALL \
: __HYPERCALL_4PARAM \
: __HYPERCALL_ENTRY(name) \
: __HYPERCALL_ENTRY(__HYPERVISOR_ ## name) \
: __HYPERCALL_CLOBBER4); \
(type)__res; \
})
Expand All @@ -206,12 +217,9 @@ xen_single_call(unsigned int call,
__HYPERCALL_DECLS;
__HYPERCALL_5ARG(a1, a2, a3, a4, a5);

if (call >= PAGE_SIZE / sizeof(hypercall_page[0]))
return -EINVAL;

asm volatile(CALL_NOSPEC
asm volatile(__HYPERCALL
: __HYPERCALL_5PARAM
: [thunk_target] "a" (&hypercall_page[call])
: __HYPERCALL_ENTRY(call)
: __HYPERCALL_CLOBBER5);

return (long)__res;
Expand Down
38 changes: 22 additions & 16 deletions arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ void detect_ht(struct cpuinfo_x86 *c)
#endif
}

static void get_cpu_vendor(struct cpuinfo_x86 *c)
void get_cpu_vendor(struct cpuinfo_x86 *c)
{
char *v = c->x86_vendor_id;
int i;
Expand Down Expand Up @@ -1522,36 +1522,42 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
detect_nopl();
}

void __init early_cpu_init(void)
void __init init_cpu_devs(void)
{
const struct cpu_dev *const *cdev;
int count = 0;

#ifdef CONFIG_PROCESSOR_SELECT
pr_info("KERNEL supported cpus:\n");
#endif

for (cdev = __x86_cpu_dev_start; cdev < __x86_cpu_dev_end; cdev++) {
const struct cpu_dev *cpudev = *cdev;

if (count >= X86_VENDOR_NUM)
break;
cpu_devs[count] = cpudev;
count++;
}
}

void __init early_cpu_init(void)
{
#ifdef CONFIG_PROCESSOR_SELECT
{
unsigned int j;

for (j = 0; j < 2; j++) {
if (!cpudev->c_ident[j])
continue;
pr_info(" %s %s\n", cpudev->c_vendor,
cpudev->c_ident[j]);
}
}
unsigned int i, j;

pr_info("KERNEL supported cpus:\n");
#endif

init_cpu_devs();

#ifdef CONFIG_PROCESSOR_SELECT
for (i = 0; i < X86_VENDOR_NUM && cpu_devs[i]; i++) {
for (j = 0; j < 2; j++) {
if (!cpu_devs[i]->c_ident[j])
continue;
pr_info(" %s %s\n", cpu_devs[i]->c_vendor,
cpu_devs[i]->c_ident[j]);
}
}
#endif

early_identify_cpu(&boot_cpu_data);
}

Expand Down
10 changes: 10 additions & 0 deletions arch/x86/kernel/static_call.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <linux/static_call.h>
#include <linux/memory.h>
#include <linux/bug.h>
#include <asm/sync_core.h>
#include <asm/text-patching.h>

enum insn_type {
Expand Down Expand Up @@ -165,6 +166,15 @@ void arch_static_call_transform(void *site, void *tramp, void *func, bool tail)
}
EXPORT_SYMBOL_GPL(arch_static_call_transform);

noinstr void __static_call_update_early(void *tramp, void *func)
{
BUG_ON(system_state != SYSTEM_BOOTING);
BUG_ON(!early_boot_irqs_disabled);
BUG_ON(static_call_initialized);
__text_gen_insn(tramp, JMP32_INSN_OPCODE, tramp, func, JMP32_INSN_SIZE);
sync_core();
}

#ifdef CONFIG_RETHUNK
/*
* This is called by apply_returns() to fix up static call trampolines,
Expand Down
65 changes: 64 additions & 1 deletion arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#endif
#include <linux/console.h>
#include <linux/cpu.h>
#include <linux/instrumentation.h>
#include <linux/kexec.h>
#include <linux/slab.h>
#include <linux/panic_notifier.h>
Expand All @@ -25,7 +26,8 @@
#include "smp.h"
#include "pmu.h"

EXPORT_SYMBOL_GPL(hypercall_page);
DEFINE_STATIC_CALL(xen_hypercall, xen_hypercall_hvm);
EXPORT_STATIC_CALL_TRAMP(xen_hypercall);

/*
* Pointer to the xen_vcpu_info structure or
Expand Down Expand Up @@ -99,6 +101,67 @@ struct shared_info *HYPERVISOR_shared_info = &xen_dummy_shared_info;
*/
int xen_have_vcpu_info_placement = 1;

static __ref void xen_get_vendor(void)
{
init_cpu_devs();
cpu_detect(&boot_cpu_data);
get_cpu_vendor(&boot_cpu_data);
}

void xen_hypercall_setfunc(void)
{
if (static_call_query(xen_hypercall) != xen_hypercall_hvm)
return;

if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||
boot_cpu_data.x86_vendor == X86_VENDOR_HYGON))
static_call_update(xen_hypercall, xen_hypercall_amd);
else
static_call_update(xen_hypercall, xen_hypercall_intel);
}

/*
* Evaluate processor vendor in order to select the correct hypercall
* function for HVM/PVH guests.
* Might be called very early in boot before vendor has been set by
* early_cpu_init().
*/
noinstr void *__xen_hypercall_setfunc(void)
{
void (*func)(void);

/*
* Xen is supported only on CPUs with CPUID, so testing for
* X86_FEATURE_CPUID is a test for early_cpu_init() having been
* run.
*
* Note that __xen_hypercall_setfunc() is noinstr only due to a nasty
* dependency chain: it is being called via the xen_hypercall static
* call when running as a PVH or HVM guest. Hypercalls need to be
* noinstr due to PV guests using hypercalls in noinstr code. So we
* can safely tag the function body as "instrumentation ok", since
* the PV guest requirement is not of interest here (xen_get_vendor()
* calls noinstr functions, and static_call_update_early() might do
* so, too).
*/
instrumentation_begin();

if (!boot_cpu_has(X86_FEATURE_CPUID))
xen_get_vendor();

if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||
boot_cpu_data.x86_vendor == X86_VENDOR_HYGON))
func = xen_hypercall_amd;
else
func = xen_hypercall_intel;

static_call_update_early(xen_hypercall, func);

instrumentation_end();

return func;
}

static int xen_cpu_up_online(unsigned int cpu)
{
xen_init_lock_cpu(cpu);
Expand Down
Loading

0 comments on commit 5783276

Please sign in to comment.