Skip to content

Commit 9528d41

Browse files
committed
Merge tag 'x86_urgent_for_v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Borislav Petkov: - Mark serialize() noinstr so that it can be used from instrumentation- free code - Make sure FRED's RSP0 MSR is synchronized with its corresponding per-CPU value in order to avoid double faults in hotplug scenarios - Disable EXECMEM_ROX on x86 for now because it didn't receive proper x86 maintainers review, went in and broke a bunch of things * tag 'x86_urgent_for_v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/asm: Make serialize() always_inline x86/fred: Fix the FRED RSP0 MSR out of sync with its per-CPU cache x86: Disable EXECMEM_ROX support
2 parents 25144ea + ae02ae1 commit 9528d41

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

arch/x86/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ config X86
8383
select ARCH_HAS_DMA_OPS if GART_IOMMU || XEN
8484
select ARCH_HAS_EARLY_DEBUG if KGDB
8585
select ARCH_HAS_ELF_RANDOMIZE
86-
select ARCH_HAS_EXECMEM_ROX if X86_64
8786
select ARCH_HAS_FAST_MULTIPLIER
8887
select ARCH_HAS_FORTIFY_SOURCE
8988
select ARCH_HAS_GCOV_PROFILE_ALL

arch/x86/include/asm/special_insns.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static inline int write_user_shstk_64(u64 __user *addr, u64 val)
217217

218218
#define nop() asm volatile ("nop")
219219

220-
static inline void serialize(void)
220+
static __always_inline void serialize(void)
221221
{
222222
/* Instruction opcode for SERIALIZE; supported in binutils >= 2.35. */
223223
asm volatile(".byte 0xf, 0x1, 0xe8" ::: "memory");

arch/x86/kernel/fred.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ void cpu_init_fred_exceptions(void)
5050
FRED_CONFIG_ENTRYPOINT(asm_fred_entrypoint_user));
5151

5252
wrmsrl(MSR_IA32_FRED_STKLVLS, 0);
53-
wrmsrl(MSR_IA32_FRED_RSP0, 0);
53+
54+
/*
55+
* Ater a CPU offline/online cycle, the FRED RSP0 MSR should be
56+
* resynchronized with its per-CPU cache.
57+
*/
58+
wrmsrl(MSR_IA32_FRED_RSP0, __this_cpu_read(fred_rsp0));
59+
5460
wrmsrl(MSR_IA32_FRED_RSP1, 0);
5561
wrmsrl(MSR_IA32_FRED_RSP2, 0);
5662
wrmsrl(MSR_IA32_FRED_RSP3, 0);

0 commit comments

Comments
 (0)