Skip to content

Commit b2da7df

Browse files
committed
Merge tag 'x86_urgent_for_v5.18_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Borislav Petkov: - A fix to disable PCI/MSI[-X] masking for XEN_HVM guests as that is solely controlled by the hypervisor - A build fix to make the function prototype (__warn()) as visible as the definition itself - A bunch of objtool annotation fixes which have accumulated over time - An ORC unwinder fix to handle bad input gracefully - Well, we thought the microcode gets loaded in time in order to restore the microcode-emulated MSRs but we thought wrong. So there's a fix for that to have the ordering done properly - Add new Intel model numbers - A spelling fix * tag 'x86_urgent_for_v5.18_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests bug: Have __warn() prototype defined unconditionally x86/Kconfig: fix the spelling of 'becoming' in X86_KERNEL_IBT config objtool: Use offstr() to print address of missing ENDBR objtool: Print data address for "!ENDBR" data warnings x86/xen: Add ANNOTATE_NOENDBR to startup_xen() x86/uaccess: Add ENDBR to __put_user_nocheck*() x86/retpoline: Add ANNOTATE_NOENDBR for retpolines x86/static_call: Add ANNOTATE_NOENDBR to static call trampoline objtool: Enable unreachable warnings for CLANG LTO x86,objtool: Explicitly mark idtentry_body()s tail REACHABLE x86,objtool: Mark cpu_startup_entry() __noreturn x86,xen,objtool: Add UNWIND hint lib/strn*,objtool: Enforce user_access_begin() rules MAINTAINERS: Add x86 unwinding entry x86/unwind/orc: Recheck address range after stack info was updated x86/cpu: Load microcode during restore_processor_state() x86/cpu: Add new Alderlake and Raptorlake CPU model numbers
2 parents b70ed23 + 7e0815b commit b2da7df

File tree

21 files changed

+63
-29
lines changed

21 files changed

+63
-29
lines changed

MAINTAINERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21443,6 +21443,15 @@ F: arch/x86/include/asm/uv/
2144321443
F: arch/x86/kernel/apic/x2apic_uv_x.c
2144421444
F: arch/x86/platform/uv/
2144521445

21446+
X86 STACK UNWINDING
21447+
M: Josh Poimboeuf <jpoimboe@redhat.com>
21448+
M: Peter Zijlstra <peterz@infradead.org>
21449+
S: Supported
21450+
F: arch/x86/include/asm/unwind*.h
21451+
F: arch/x86/kernel/dumpstack.c
21452+
F: arch/x86/kernel/stacktrace.c
21453+
F: arch/x86/kernel/unwind_*.c
21454+
2144621455
X86 VDSO
2144721456
M: Andy Lutomirski <luto@kernel.org>
2144821457
L: linux-kernel@vger.kernel.org

arch/x86/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,7 @@ config X86_KERNEL_IBT
18661866
code with them to make this happen.
18671867

18681868
In addition to building the kernel with IBT, seal all functions that
1869-
are not indirect call targets, avoiding them ever becomming one.
1869+
are not indirect call targets, avoiding them ever becoming one.
18701870

18711871
This requires LTO like objtool runs and will slow down the build. It
18721872
does significantly reduce the number of ENDBR instructions in the

arch/x86/entry/entry_64.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@ SYM_CODE_END(ret_from_fork)
337337

338338
call \cfunc
339339

340+
/* For some configurations \cfunc ends up being a noreturn. */
341+
REACHABLE
342+
340343
jmp error_return
341344
.endm
342345

arch/x86/include/asm/intel-family.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* _G - parts with extra graphics on
2727
* _X - regular server parts
2828
* _D - micro server parts
29+
* _N,_P - other mobile parts
2930
*
3031
* Historical OPTDIFFs:
3132
*
@@ -107,8 +108,10 @@
107108

108109
#define INTEL_FAM6_ALDERLAKE 0x97 /* Golden Cove / Gracemont */
109110
#define INTEL_FAM6_ALDERLAKE_L 0x9A /* Golden Cove / Gracemont */
111+
#define INTEL_FAM6_ALDERLAKE_N 0xBE
110112

111113
#define INTEL_FAM6_RAPTORLAKE 0xB7
114+
#define INTEL_FAM6_RAPTORLAKE_P 0xBA
112115

113116
/* "Small Core" Processors (Atom) */
114117

arch/x86/include/asm/microcode.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,12 @@ extern void __init load_ucode_bsp(void);
131131
extern void load_ucode_ap(void);
132132
void reload_early_microcode(void);
133133
extern bool initrd_gone;
134+
void microcode_bsp_resume(void);
134135
#else
135136
static inline void __init load_ucode_bsp(void) { }
136137
static inline void load_ucode_ap(void) { }
137138
static inline void reload_early_microcode(void) { }
139+
static inline void microcode_bsp_resume(void) { }
138140
#endif
139141

140142
#endif /* _ASM_X86_MICROCODE_H */

arch/x86/include/asm/static_call.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
".align 4 \n" \
2727
".globl " STATIC_CALL_TRAMP_STR(name) " \n" \
2828
STATIC_CALL_TRAMP_STR(name) ": \n" \
29+
ANNOTATE_NOENDBR \
2930
insns " \n" \
3031
".byte 0x53, 0x43, 0x54 \n" \
3132
".type " STATIC_CALL_TRAMP_STR(name) ", @function \n" \

arch/x86/kernel/cpu/microcode/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -758,9 +758,9 @@ static struct subsys_interface mc_cpu_interface = {
758758
};
759759

760760
/**
761-
* mc_bp_resume - Update boot CPU microcode during resume.
761+
* microcode_bsp_resume - Update boot CPU microcode during resume.
762762
*/
763-
static void mc_bp_resume(void)
763+
void microcode_bsp_resume(void)
764764
{
765765
int cpu = smp_processor_id();
766766
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
@@ -772,7 +772,7 @@ static void mc_bp_resume(void)
772772
}
773773

774774
static struct syscore_ops mc_syscore_ops = {
775-
.resume = mc_bp_resume,
775+
.resume = microcode_bsp_resume,
776776
};
777777

778778
static int mc_cpu_starting(unsigned int cpu)

arch/x86/kernel/unwind_orc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,11 @@ static bool stack_access_ok(struct unwind_state *state, unsigned long _addr,
339339
struct stack_info *info = &state->stack_info;
340340
void *addr = (void *)_addr;
341341

342-
if (!on_stack(info, addr, len) &&
343-
(get_stack_info(addr, state->task, info, &state->stack_mask)))
344-
return false;
342+
if (on_stack(info, addr, len))
343+
return true;
345344

346-
return true;
345+
return !get_stack_info(addr, state->task, info, &state->stack_mask) &&
346+
on_stack(info, addr, len);
347347
}
348348

349349
static bool deref_stack_reg(struct unwind_state *state, unsigned long addr,

arch/x86/lib/putuser.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ SYM_FUNC_START(__put_user_1)
4848
cmp %_ASM_BX,%_ASM_CX
4949
jae .Lbad_put_user
5050
SYM_INNER_LABEL(__put_user_nocheck_1, SYM_L_GLOBAL)
51+
ENDBR
5152
ASM_STAC
5253
1: movb %al,(%_ASM_CX)
5354
xor %ecx,%ecx
@@ -62,6 +63,7 @@ SYM_FUNC_START(__put_user_2)
6263
cmp %_ASM_BX,%_ASM_CX
6364
jae .Lbad_put_user
6465
SYM_INNER_LABEL(__put_user_nocheck_2, SYM_L_GLOBAL)
66+
ENDBR
6567
ASM_STAC
6668
2: movw %ax,(%_ASM_CX)
6769
xor %ecx,%ecx
@@ -76,6 +78,7 @@ SYM_FUNC_START(__put_user_4)
7678
cmp %_ASM_BX,%_ASM_CX
7779
jae .Lbad_put_user
7880
SYM_INNER_LABEL(__put_user_nocheck_4, SYM_L_GLOBAL)
81+
ENDBR
7982
ASM_STAC
8083
3: movl %eax,(%_ASM_CX)
8184
xor %ecx,%ecx
@@ -90,6 +93,7 @@ SYM_FUNC_START(__put_user_8)
9093
cmp %_ASM_BX,%_ASM_CX
9194
jae .Lbad_put_user
9295
SYM_INNER_LABEL(__put_user_nocheck_8, SYM_L_GLOBAL)
96+
ENDBR
9397
ASM_STAC
9498
4: mov %_ASM_AX,(%_ASM_CX)
9599
#ifdef CONFIG_X86_32

arch/x86/lib/retpoline.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
.align RETPOLINE_THUNK_SIZE
3232
SYM_INNER_LABEL(__x86_indirect_thunk_\reg, SYM_L_GLOBAL)
3333
UNWIND_HINT_EMPTY
34+
ANNOTATE_NOENDBR
3435

3536
ALTERNATIVE_2 __stringify(ANNOTATE_RETPOLINE_SAFE; jmp *%\reg), \
3637
__stringify(RETPOLINE \reg), X86_FEATURE_RETPOLINE, \
@@ -55,7 +56,6 @@ SYM_INNER_LABEL(__x86_indirect_thunk_\reg, SYM_L_GLOBAL)
5556

5657
.align RETPOLINE_THUNK_SIZE
5758
SYM_CODE_START(__x86_indirect_thunk_array)
58-
ANNOTATE_NOENDBR // apply_retpolines
5959

6060
#define GEN(reg) THUNK reg
6161
#include <asm/GEN-for-each-reg.h>

0 commit comments

Comments
 (0)