mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
Merge tag 'x86-urgent-2026-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: - Select the BHI mitigation based on the attack vector properly (Breno Leitao) - Fix i386-gcov build bug in csum_ipv6_magic() due to overly strict asm constraints that cannot be met in that build mode (Rosen Penev) - Fix Vmware-guest i386 high-bandwidth hypercall arguments under UNWINDER_GUESS & disabled frame-pointers (Zack Rusin) - Fix resctrl AMD ABMC counter ID field width (Babu Moger) - Fix restctrl pqos tool ABI breakage by reverting the mbm_assign_mode to default mode at boot (Babu Moger) - Initialize wall clock in get_rtc_noop() (Naman Jain) - Fix ptrace historic ABI quirk regression (Thomas Gleixner) - Add Drew Fustini as resctrl reviewer and Ben Horgan as fs/resctrl reviewer - Clear SEV RMPOPT when segmented RMP is disabled by firmware but is advertised as available (Ashish Kalra) - Set up SEV RMPOPT only on an active SNP host (Ashish Kalra) - Don't emit KCFI_REFERENCE() in modules (Ridge Lomont) - Ignore negative NMI handler durations (Breno Leitao) - Fix off-by-one error in boot-time sme_clear_pgd() (Thorsten Blum) - Fix ASID allocation bug (Chris Mason) * tag 'x86-urgent-2026-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Fix global ASID handed out to two processes x86/boot: Fix off-by-one error in sme_clear_pgd() MAINTAINERS: Add Ben Horgan as fs/resctrl reviewer x86/nmi: Ignore negative NMI handler durations x86/kcfi: Don't emit KCFI_REFERENCE() in modules x86/sev: Set up RMPOPT only on an active SNP host x86/sev: Clear RMPOPT when segmented RMP is disabled by firmware MAINTAINERS: resctrl: Add myself as reviewer x86/entry: Fix ptrace regression x86/init: Initialize wall clock in get_rtc_noop() x86,fs/resctrl: Keep mbm_assign_mode in default mode at boot x86/resctrl: Correct ABMC counter ID field width x86/vmware: Fix i386 high-bandwidth hypercall arguments x86/csum: Relax the len and proto constraints in 32-bit csum_ipv6_magic() x86/bugs: Select the BHI mitigation based on the attack vector properly
This commit is contained in:
@@ -350,12 +350,12 @@ with the following files:
|
||||
"mbm_assign_mode":
|
||||
The supported counter assignment modes. The enclosed brackets indicate which mode
|
||||
is enabled. The MBM events associated with counters may reset when "mbm_assign_mode"
|
||||
is changed.
|
||||
is changed. See architecture specific notes below.
|
||||
::
|
||||
|
||||
# cat /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
|
||||
[mbm_event]
|
||||
default
|
||||
[default]
|
||||
mbm_event
|
||||
|
||||
"mbm_event":
|
||||
|
||||
@@ -373,20 +373,17 @@ with the following files:
|
||||
Moving to mbm_event counter assignment mode requires users to assign the counters
|
||||
to the events. Otherwise, the MBM event counters will return 'Unassigned' when read.
|
||||
|
||||
The mode is beneficial for AMD platforms that support more CTRL_MON
|
||||
and MON groups than available hardware counters. By default, this
|
||||
feature is enabled on AMD platforms with the ABMC (Assignable Bandwidth
|
||||
Monitoring Counters) capability, ensuring counters remain assigned even
|
||||
when the corresponding RMID is not actively used by any processor.
|
||||
It is intended for deployments that need to manage counter assignment on
|
||||
platforms where the number of monitoring groups exceeds the available
|
||||
hardware counters. Hardware counters are scarce on these platforms, so
|
||||
mbm_event mode suits workflows that monitor a subset of groups at a time and
|
||||
rotate assignments as needed. The mbm_event mode ensures counters remain
|
||||
assigned even when the corresponding RMID is not actively used.
|
||||
|
||||
"default":
|
||||
|
||||
In default mode, resctrl assumes there is a hardware counter for each
|
||||
event within every CTRL_MON and MON group. On AMD platforms, it is
|
||||
recommended to use the mbm_event mode, if supported, to prevent reset of MBM
|
||||
events between reads resulting from hardware re-allocating counters. This can
|
||||
result in misleading values or display "Unavailable" if no counter is assigned
|
||||
to the event.
|
||||
event within every CTRL_MON and MON group.
|
||||
|
||||
* To enable "mbm_event" counter assignment mode:
|
||||
::
|
||||
@@ -398,6 +395,24 @@ with the following files:
|
||||
|
||||
# echo "default" > /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
|
||||
|
||||
In default mode on AMD platforms that support more CTRL_MON and MON groups
|
||||
than hardware counters, hardware dynamically shares a smaller pool of
|
||||
counters among RMIDs. One counter from this pool is used per monitoring
|
||||
group and counts every MBM event of that group's RMID. The size of the pool
|
||||
is not enumerated to software (unlike "num_mbm_cntrs"), and "num_rmids" may
|
||||
be much larger. For example, 64 counters in this pool monitor 64 groups.
|
||||
Newer hardware may provide a larger pool.
|
||||
|
||||
On such platforms, while the number of monitoring groups does not exceed
|
||||
that pool, a counter stays attached to each RMID and readings remain
|
||||
accurate. Creating more groups than the pool can cause hardware to
|
||||
re-allocate those counters between successive reads of an event. Bandwidth
|
||||
values may then be misleading, or a read may return "Unavailable" if no
|
||||
counter is allocated to the RMID. There is no user-visible indication when
|
||||
this begins. Users who need stable readings beyond that pool should switch
|
||||
to mbm_event mode, if supported, and assign counters to the groups of
|
||||
interest (rotating assignments as needed).
|
||||
|
||||
"num_mbm_cntrs":
|
||||
The maximum number of counters (total of available and assigned counters) in
|
||||
each domain when the system supports mbm_event mode.
|
||||
@@ -1784,17 +1799,19 @@ View the llc occupancy snapshot::
|
||||
Examples on working with mbm_assign_mode
|
||||
========================================
|
||||
|
||||
a. Check if MBM counter assignment mode is supported.
|
||||
a. Check if MBM counter assignment mode is supported. Enable "mbm_event"
|
||||
mode. Switching the mbm_assign_mode may reset all the MBM counters (and
|
||||
thus all MBM events) of all the resctrl groups.
|
||||
::
|
||||
|
||||
# mount -t resctrl resctrl /sys/fs/resctrl/
|
||||
|
||||
# cat /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
|
||||
[default]
|
||||
mbm_event
|
||||
# echo "mbm_event" > /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
|
||||
# cat /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
|
||||
[mbm_event]
|
||||
default
|
||||
|
||||
The "mbm_event" mode is detected and enabled.
|
||||
|
||||
b. Check how many assignable counters are supported.
|
||||
::
|
||||
|
||||
@@ -1805,36 +1822,39 @@ c. Check how many assignable counters are available for assignment in each domai
|
||||
::
|
||||
|
||||
# cat /sys/fs/resctrl/info/L3_MON/available_mbm_cntrs
|
||||
0=30;1=30
|
||||
0=32;1=32
|
||||
|
||||
d. To list the default group's assign states.
|
||||
d. To list the default group's assign states. Counters are unassigned when the mode
|
||||
is switched to "mbm_event".
|
||||
::
|
||||
|
||||
# cat /sys/fs/resctrl/mbm_L3_assignments
|
||||
mbm_total_bytes:0=e;1=e
|
||||
mbm_local_bytes:0=e;1=e
|
||||
mbm_total_bytes:0=_;1=_
|
||||
mbm_local_bytes:0=_;1=_
|
||||
|
||||
e. To unassign the counter associated with the mbm_total_bytes event on domain 0.
|
||||
e. To assign the counter associated with the mbm_total_bytes event on domain 0
|
||||
in exclusive mode.
|
||||
::
|
||||
|
||||
# echo "mbm_total_bytes:0=_" > /sys/fs/resctrl/mbm_L3_assignments
|
||||
# echo "mbm_total_bytes:0=e" > /sys/fs/resctrl/mbm_L3_assignments
|
||||
# cat /sys/fs/resctrl/mbm_L3_assignments
|
||||
mbm_total_bytes:0=_;1=e
|
||||
mbm_local_bytes:0=e;1=e
|
||||
mbm_total_bytes:0=e;1=_
|
||||
mbm_local_bytes:0=_;1=_
|
||||
|
||||
f. To unassign the counter associated with the mbm_total_bytes event on all domains.
|
||||
::
|
||||
|
||||
# echo "mbm_total_bytes:*=_" > /sys/fs/resctrl/mbm_L3_assignments
|
||||
# cat /sys/fs/resctrl/mbm_L3_assignment
|
||||
# cat /sys/fs/resctrl/mbm_L3_assignments
|
||||
mbm_total_bytes:0=_;1=_
|
||||
mbm_local_bytes:0=e;1=e
|
||||
mbm_local_bytes:0=_;1=_
|
||||
|
||||
g. To assign a counter associated with the mbm_total_bytes event on all domains in
|
||||
exclusive mode.
|
||||
g. To assign a counter associated with the mbm_total_bytes and mbm_local_bytes
|
||||
events on all domains in exclusive mode.
|
||||
::
|
||||
|
||||
# echo "mbm_total_bytes:*=e" > /sys/fs/resctrl/mbm_L3_assignments
|
||||
# echo "mbm_local_bytes:*=e" > /sys/fs/resctrl/mbm_L3_assignments
|
||||
# cat /sys/fs/resctrl/mbm_L3_assignments
|
||||
mbm_total_bytes:0=e;1=e
|
||||
mbm_local_bytes:0=e;1=e
|
||||
@@ -1891,13 +1911,8 @@ the MBM counters (and thus all MBM events) of all the resctrl groups.
|
||||
|
||||
# echo "default" > /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
|
||||
# cat /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
|
||||
mbm_event
|
||||
[default]
|
||||
|
||||
m. Unmount the resctrl filesystem.
|
||||
::
|
||||
|
||||
# umount /sys/fs/resctrl/
|
||||
mbm_event
|
||||
|
||||
Intel RDT Errata
|
||||
================
|
||||
|
||||
@@ -23552,9 +23552,11 @@ RDT - RESOURCE ALLOCATION
|
||||
M: Tony Luck <[email protected]>
|
||||
M: Reinette Chatre <[email protected]>
|
||||
M: [email protected]
|
||||
R: Ben Horgan <[email protected]>
|
||||
R: Dave Martin <[email protected]>
|
||||
R: James Morse <[email protected]>
|
||||
R: Babu Moger <[email protected]>
|
||||
R: Drew Fustini <[email protected]>
|
||||
L: [email protected]
|
||||
S: Supported
|
||||
P: Documentation/process/maintainer-tip.rst
|
||||
|
||||
@@ -99,7 +99,7 @@ static void __init sme_clear_pgd(struct sme_populate_pgd_data *ppd)
|
||||
pgd_t *pgd_p;
|
||||
|
||||
pgd_start = ppd->vaddr & PGDIR_MASK;
|
||||
pgd_end = ppd->vaddr_end & PGDIR_MASK;
|
||||
pgd_end = (ppd->vaddr_end - 1) & PGDIR_MASK;
|
||||
|
||||
pgd_size = (((pgd_end - pgd_start) / PGDIR_SIZE) + 1) * sizeof(pgd_t);
|
||||
|
||||
|
||||
@@ -77,6 +77,10 @@ static __always_inline void do_syscall_32_irqs_on(struct pt_regs *regs, unsigned
|
||||
if (likely(nr < IA32_NR_syscalls)) {
|
||||
nr = array_index_nospec(nr, IA32_NR_syscalls);
|
||||
regs->ax = ia32_sys_call(regs, (unsigned int)nr);
|
||||
} else {
|
||||
/* See comment in do_syscall_64() */
|
||||
if (nr != -1UL)
|
||||
regs->ax = -ENOSYS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,15 +64,20 @@ static __always_inline bool do_syscall_x64(struct pt_regs *regs, unsigned long n
|
||||
return false;
|
||||
}
|
||||
|
||||
static __always_inline void do_syscall_x32(struct pt_regs *regs, unsigned long nr)
|
||||
static __always_inline bool do_syscall_x32(struct pt_regs *regs, unsigned long nr)
|
||||
{
|
||||
if (!IS_ENABLED(CONFIG_X86_X32_ABI))
|
||||
return false;
|
||||
|
||||
/* Adjust the starting offset of the table */
|
||||
nr -= __X32_SYSCALL_BIT;
|
||||
|
||||
if (IS_ENABLED(CONFIG_X86_X32_ABI) && likely(nr < X32_NR_syscalls)) {
|
||||
if (likely(nr < X32_NR_syscalls)) {
|
||||
nr = array_index_nospec(nr, X32_NR_syscalls);
|
||||
regs->ax = x32_sys_call(regs, (unsigned int)nr);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Returns true to return using SYSRET, or false to use IRET */
|
||||
@@ -81,8 +86,21 @@ __visible noinstr bool do_syscall_64(struct pt_regs *regs, long nr)
|
||||
if (likely(syscall_enter_from_user_mode_randomize_stack(regs, &nr))) {
|
||||
instrumentation_begin();
|
||||
|
||||
if (!do_syscall_x64(regs, nr))
|
||||
do_syscall_x32(regs, nr);
|
||||
if (unlikely(!do_syscall_x64(regs, nr))) {
|
||||
/*
|
||||
* The special treatment of syscall number -1 is a
|
||||
* historical bogosity as the original code used -1 to
|
||||
* indicate syscall abort, which is not distinguishable
|
||||
* from a syscall which is invoked with syscall number
|
||||
* -1. The historic behavior is to keep the return value
|
||||
* in regs->ax unmodified in that case, which means it's
|
||||
* either the preset value -ENOSYS or a value which was
|
||||
* written by a tracer. If the syscall number is invalid
|
||||
* but not -1 then overwrite any tracer modification.
|
||||
*/
|
||||
if (!do_syscall_x32(regs, nr) && nr != -1L)
|
||||
regs->ax = -ENOSYS;
|
||||
}
|
||||
|
||||
instrumentation_end();
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
"adcl $0, %0 ;\n"
|
||||
: "=&r" (sum)
|
||||
: "r" (saddr), "r" (daddr),
|
||||
"r" (htonl(len)), "r" (htonl(proto)), "0" (sum)
|
||||
"g" (htonl(len)), "g" (htonl(proto)), "0" (sum)
|
||||
: "memory");
|
||||
|
||||
return csum_fold(sum);
|
||||
|
||||
@@ -276,20 +276,22 @@ unsigned long vmware_hypercall_hb_out(unsigned long cmd, unsigned long in2,
|
||||
|
||||
asm_inline volatile (
|
||||
UNWIND_HINT_SAVE
|
||||
"mov %[in6], %%" _ASM_AX "\n\t"
|
||||
"push %%" _ASM_BP "\n\t"
|
||||
UNWIND_HINT_UNDEFINED
|
||||
"mov %[in6], %%" _ASM_BP "\n\t"
|
||||
"mov %%" _ASM_AX ", %%" _ASM_BP "\n\t"
|
||||
"mov %[magic], %%eax\n\t"
|
||||
"rep outsb\n\t"
|
||||
"pop %%" _ASM_BP "\n\t"
|
||||
UNWIND_HINT_RESTORE
|
||||
: "=a" (out0), "=b" (*out1)
|
||||
: "a" (VMWARE_HYPERVISOR_MAGIC),
|
||||
"b" (cmd),
|
||||
: "=&a" (out0), "=b" (*out1)
|
||||
: "b" (cmd),
|
||||
"c" (in2),
|
||||
"d" (in3 | VMWARE_HYPERVISOR_PORT_HB),
|
||||
"S" (in4),
|
||||
"D" (in5),
|
||||
[in6] VMW_BP_CONSTRAINT (in6)
|
||||
[in6] VMW_BP_CONSTRAINT(in6),
|
||||
[magic] "i" (VMWARE_HYPERVISOR_MAGIC)
|
||||
: "cc", "memory");
|
||||
return out0;
|
||||
}
|
||||
@@ -304,20 +306,22 @@ unsigned long vmware_hypercall_hb_in(unsigned long cmd, unsigned long in2,
|
||||
|
||||
asm_inline volatile (
|
||||
UNWIND_HINT_SAVE
|
||||
"mov %[in6], %%" _ASM_AX "\n\t"
|
||||
"push %%" _ASM_BP "\n\t"
|
||||
UNWIND_HINT_UNDEFINED
|
||||
"mov %[in6], %%" _ASM_BP "\n\t"
|
||||
"mov %%" _ASM_AX ", %%" _ASM_BP "\n\t"
|
||||
"mov %[magic], %%eax\n\t"
|
||||
"rep insb\n\t"
|
||||
"pop %%" _ASM_BP "\n\t"
|
||||
UNWIND_HINT_RESTORE
|
||||
: "=a" (out0), "=b" (*out1)
|
||||
: "a" (VMWARE_HYPERVISOR_MAGIC),
|
||||
"b" (cmd),
|
||||
: "=&a" (out0), "=b" (*out1)
|
||||
: "b" (cmd),
|
||||
"c" (in2),
|
||||
"d" (in3 | VMWARE_HYPERVISOR_PORT_HB),
|
||||
"S" (in4),
|
||||
"D" (in5),
|
||||
[in6] VMW_BP_CONSTRAINT (in6)
|
||||
[in6] VMW_BP_CONSTRAINT(in6),
|
||||
[magic] "i" (VMWARE_HYPERVISOR_MAGIC)
|
||||
: "cc", "memory");
|
||||
return out0;
|
||||
}
|
||||
|
||||
@@ -2088,14 +2088,12 @@ static void __init bhi_select_mitigation(void)
|
||||
if (bhi_mitigation != BHI_MITIGATION_AUTO)
|
||||
return;
|
||||
|
||||
if (cpu_attack_vector_mitigated(CPU_MITIGATE_GUEST_HOST)) {
|
||||
if (cpu_attack_vector_mitigated(CPU_MITIGATE_USER_KERNEL))
|
||||
bhi_mitigation = BHI_MITIGATION_ON;
|
||||
else
|
||||
bhi_mitigation = BHI_MITIGATION_VMEXIT_ONLY;
|
||||
} else {
|
||||
if (cpu_attack_vector_mitigated(CPU_MITIGATE_USER_KERNEL))
|
||||
bhi_mitigation = BHI_MITIGATION_ON;
|
||||
else if (cpu_attack_vector_mitigated(CPU_MITIGATE_GUEST_HOST))
|
||||
bhi_mitigation = BHI_MITIGATION_VMEXIT_ONLY;
|
||||
else
|
||||
bhi_mitigation = BHI_MITIGATION_OFF;
|
||||
}
|
||||
}
|
||||
|
||||
static void __init bhi_update_mitigation(void)
|
||||
|
||||
@@ -93,6 +93,7 @@ static const struct cpuid_dep cpuid_deps[] = {
|
||||
{ X86_FEATURE_SPEC_CTRL_SSBD, X86_FEATURE_SPEC_CTRL },
|
||||
{ X86_FEATURE_LASS, X86_FEATURE_SMAP },
|
||||
{ X86_FEATURE_INVLPGB, X86_FEATURE_PCID },
|
||||
{ X86_FEATURE_RMPOPT, X86_FEATURE_SEV_SNP },
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -214,8 +214,8 @@ union l3_qos_abmc_cfg {
|
||||
bw_src :12,
|
||||
reserved1: 3,
|
||||
is_clos : 1,
|
||||
cntr_id : 5,
|
||||
reserved : 9,
|
||||
cntr_id :12,
|
||||
reserved : 2,
|
||||
cntr_en : 1,
|
||||
cfg_en : 1;
|
||||
} split;
|
||||
|
||||
@@ -470,8 +470,8 @@ int __init rdt_get_l3_mon_config(struct rdt_resource *r)
|
||||
r->mon.mbm_cntr_assignable = true;
|
||||
r->mon.mbm_cntr_configurable = true;
|
||||
cpuid_count(0x80000020, 5, &eax, &ebx, &ecx, &edx);
|
||||
r->mon.num_mbm_cntrs = (ebx & GENMASK(15, 0)) + 1;
|
||||
hw_res->mbm_cntr_assign_enabled = true;
|
||||
/* cntr_id is 12 bits and can only encode 4096 counters. */
|
||||
r->mon.num_mbm_cntrs = min((ebx & GENMASK(15, 0)) + 1, BIT(12));
|
||||
}
|
||||
|
||||
r->mon_capable = true;
|
||||
|
||||
@@ -115,6 +115,14 @@ static void nmi_check_duration(struct nmiaction *action, u64 duration)
|
||||
{
|
||||
int remainder_ns, decimal_msecs;
|
||||
|
||||
/* sched_clock() went backwards? */
|
||||
if ((s64)duration < 0) {
|
||||
pr_warn_once("NMI handler (%ps): sched_clock() went backwards by %lld ns on CPU%d\n",
|
||||
action->handler, -(s64)duration,
|
||||
smp_processor_id());
|
||||
return;
|
||||
}
|
||||
|
||||
if (duration < nmi_longest_ns || duration < action->max_duration)
|
||||
return;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ static void iommu_shutdown_noop(void) { }
|
||||
bool __init bool_x86_init_noop(void) { return false; }
|
||||
void x86_op_int_noop(int cpu) { }
|
||||
int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; }
|
||||
void get_rtc_noop(struct timespec64 *now) { }
|
||||
void get_rtc_noop(struct timespec64 *now) { *now = (struct timespec64){0}; }
|
||||
|
||||
static __initconst const struct of_device_id of_cmos_match[] = {
|
||||
{ .compatible = "motorola,mc146818" },
|
||||
|
||||
+11
-5
@@ -320,13 +320,19 @@ static u16 allocate_global_asid(void)
|
||||
|
||||
lockdep_assert_held(&global_asid_lock);
|
||||
|
||||
/* The previous allocation hit the edge of available address space */
|
||||
if (last_global_asid >= MAX_ASID_AVAILABLE - 1)
|
||||
reset_global_asid_space();
|
||||
|
||||
asid = find_next_zero_bit(global_asid_used, MAX_ASID_AVAILABLE, last_global_asid);
|
||||
|
||||
if (asid >= MAX_ASID_AVAILABLE && !global_asid_available) {
|
||||
/*
|
||||
* Nothing is free between last_global_asid and MAX_ASID_AVAILABLE.
|
||||
* Flush lazy-freed ASIDs and reset the search space.
|
||||
*/
|
||||
if (asid >= MAX_ASID_AVAILABLE) {
|
||||
reset_global_asid_space();
|
||||
asid = find_next_zero_bit(global_asid_used, MAX_ASID_AVAILABLE,
|
||||
last_global_asid);
|
||||
}
|
||||
|
||||
if (asid >= MAX_ASID_AVAILABLE) {
|
||||
/* This should never happen. */
|
||||
VM_WARN_ONCE(1, "Unable to allocate global ASID despite %d available\n",
|
||||
global_asid_available);
|
||||
|
||||
+7
-13
@@ -662,17 +662,16 @@ static int __init rmpopt_init(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
device_initcall(rmpopt_init);
|
||||
|
||||
void snp_enable_rmpopt(void)
|
||||
{
|
||||
u64 base;
|
||||
int cpu;
|
||||
|
||||
if (!cpu_feature_enabled(X86_FEATURE_RMPOPT))
|
||||
if (!cc_platform_has(CC_ATTR_HOST_SEV_SNP))
|
||||
return;
|
||||
|
||||
if (!cc_platform_has(CC_ATTR_HOST_SEV_SNP))
|
||||
if (!cpu_feature_enabled(X86_FEATURE_RMPOPT))
|
||||
return;
|
||||
|
||||
if (!rmpopt_soft_init)
|
||||
@@ -726,6 +725,8 @@ int __init snp_rmptable_init(void)
|
||||
*/
|
||||
crash_kexec_post_notifiers = true;
|
||||
|
||||
rmpopt_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -819,18 +820,11 @@ bool snp_probe_rmptable_info(void)
|
||||
{
|
||||
if (cpu_feature_enabled(X86_FEATURE_SEGMENTED_RMP)) {
|
||||
rdmsrq(MSR_AMD64_RMP_CFG, rmp_cfg);
|
||||
|
||||
if (rmp_cfg & MSR_AMD64_SEG_RMP_ENABLED) {
|
||||
if (probe_segmented_rmptable_info())
|
||||
return true;
|
||||
|
||||
setup_clear_cpu_cap(X86_FEATURE_RMPOPT);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
setup_clear_cpu_cap(X86_FEATURE_RMPOPT);
|
||||
if (rmp_cfg & MSR_AMD64_SEG_RMP_ENABLED)
|
||||
return probe_segmented_rmptable_info();
|
||||
}
|
||||
|
||||
setup_clear_cpu_cap(X86_FEATURE_RMPOPT);
|
||||
return probe_contiguous_rmptable_info();
|
||||
}
|
||||
|
||||
|
||||
@@ -258,10 +258,13 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#if defined(CONFIG_CFI) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
|
||||
#if defined(CONFIG_CFI) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO) && \
|
||||
!defined(MODULE)
|
||||
/*
|
||||
* Force a reference to the external symbol so the compiler generates
|
||||
* __kcfi_typid.
|
||||
* __kcfi_typid. Only vmlinux needs it, as that is where the assembly
|
||||
* using the typeid lives; in a module it would only add a reference to
|
||||
* the symbol, which fails modpost if the symbol is GPL-only.
|
||||
*/
|
||||
#define KCFI_REFERENCE(sym) __ADDRESSABLE(sym)
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user