Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'tip/x86/urgent'

Merge the x86/urgent objtool/IBT changes as a base

Signed-off-by: Peter Zijlstra <peterz@infradead.org>

+52 -23
+9
MAINTAINERS
··· 21434 21434 F: arch/x86/kernel/apic/x2apic_uv_x.c 21435 21435 F: arch/x86/platform/uv/ 21436 21436 21437 + X86 STACK UNWINDING 21438 + M: Josh Poimboeuf <jpoimboe@redhat.com> 21439 + M: Peter Zijlstra <peterz@infradead.org> 21440 + S: Supported 21441 + F: arch/x86/include/asm/unwind*.h 21442 + F: arch/x86/kernel/dumpstack.c 21443 + F: arch/x86/kernel/stacktrace.c 21444 + F: arch/x86/kernel/unwind_*.c 21445 + 21437 21446 X86 VDSO 21438 21447 M: Andy Lutomirski <luto@kernel.org> 21439 21448 L: linux-kernel@vger.kernel.org
+1 -1
arch/x86/Kconfig
··· 1866 1866 code with them to make this happen. 1867 1867 1868 1868 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. 1870 1870 1871 1871 This requires LTO like objtool runs and will slow down the build. It 1872 1872 does significantly reduce the number of ENDBR instructions in the
+3
arch/x86/entry/entry_64.S
··· 337 337 338 338 call \cfunc 339 339 340 + /* For some configurations \cfunc ends up being a noreturn. */ 341 + REACHABLE 342 + 340 343 jmp error_return 341 344 .endm 342 345
+3
arch/x86/include/asm/intel-family.h
··· 26 26 * _G - parts with extra graphics on 27 27 * _X - regular server parts 28 28 * _D - micro server parts 29 + * _N,_P - other mobile parts 29 30 * 30 31 * Historical OPTDIFFs: 31 32 * ··· 108 107 109 108 #define INTEL_FAM6_ALDERLAKE 0x97 /* Golden Cove / Gracemont */ 110 109 #define INTEL_FAM6_ALDERLAKE_L 0x9A /* Golden Cove / Gracemont */ 110 + #define INTEL_FAM6_ALDERLAKE_N 0xBE 111 111 112 112 #define INTEL_FAM6_RAPTORLAKE 0xB7 113 + #define INTEL_FAM6_RAPTORLAKE_P 0xBA 113 114 114 115 /* "Small Core" Processors (Atom) */ 115 116
+2
arch/x86/include/asm/microcode.h
··· 131 131 extern void load_ucode_ap(void); 132 132 void reload_early_microcode(void); 133 133 extern bool initrd_gone; 134 + void microcode_bsp_resume(void); 134 135 #else 135 136 static inline void __init load_ucode_bsp(void) { } 136 137 static inline void load_ucode_ap(void) { } 137 138 static inline void reload_early_microcode(void) { } 139 + static inline void microcode_bsp_resume(void) { } 138 140 #endif 139 141 140 142 #endif /* _ASM_X86_MICROCODE_H */
+1
arch/x86/include/asm/static_call.h
··· 26 26 ".align 4 \n" \ 27 27 ".globl " STATIC_CALL_TRAMP_STR(name) " \n" \ 28 28 STATIC_CALL_TRAMP_STR(name) ": \n" \ 29 + ANNOTATE_NOENDBR \ 29 30 insns " \n" \ 30 31 ".byte 0x53, 0x43, 0x54 \n" \ 31 32 ".type " STATIC_CALL_TRAMP_STR(name) ", @function \n" \
+3 -3
arch/x86/kernel/cpu/microcode/core.c
··· 758 758 }; 759 759 760 760 /** 761 - * mc_bp_resume - Update boot CPU microcode during resume. 761 + * microcode_bsp_resume - Update boot CPU microcode during resume. 762 762 */ 763 - static void mc_bp_resume(void) 763 + void microcode_bsp_resume(void) 764 764 { 765 765 int cpu = smp_processor_id(); 766 766 struct ucode_cpu_info *uci = ucode_cpu_info + cpu; ··· 772 772 } 773 773 774 774 static struct syscore_ops mc_syscore_ops = { 775 - .resume = mc_bp_resume, 775 + .resume = microcode_bsp_resume, 776 776 }; 777 777 778 778 static int mc_cpu_starting(unsigned int cpu)
+4 -4
arch/x86/kernel/unwind_orc.c
··· 339 339 struct stack_info *info = &state->stack_info; 340 340 void *addr = (void *)_addr; 341 341 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; 345 344 346 - return true; 345 + return !get_stack_info(addr, state->task, info, &state->stack_mask) && 346 + on_stack(info, addr, len); 347 347 } 348 348 349 349 static bool deref_stack_reg(struct unwind_state *state, unsigned long addr,
+4
arch/x86/lib/putuser.S
··· 48 48 cmp %_ASM_BX,%_ASM_CX 49 49 jae .Lbad_put_user 50 50 SYM_INNER_LABEL(__put_user_nocheck_1, SYM_L_GLOBAL) 51 + ENDBR 51 52 ASM_STAC 52 53 1: movb %al,(%_ASM_CX) 53 54 xor %ecx,%ecx ··· 63 62 cmp %_ASM_BX,%_ASM_CX 64 63 jae .Lbad_put_user 65 64 SYM_INNER_LABEL(__put_user_nocheck_2, SYM_L_GLOBAL) 65 + ENDBR 66 66 ASM_STAC 67 67 2: movw %ax,(%_ASM_CX) 68 68 xor %ecx,%ecx ··· 78 76 cmp %_ASM_BX,%_ASM_CX 79 77 jae .Lbad_put_user 80 78 SYM_INNER_LABEL(__put_user_nocheck_4, SYM_L_GLOBAL) 79 + ENDBR 81 80 ASM_STAC 82 81 3: movl %eax,(%_ASM_CX) 83 82 xor %ecx,%ecx ··· 93 90 cmp %_ASM_BX,%_ASM_CX 94 91 jae .Lbad_put_user 95 92 SYM_INNER_LABEL(__put_user_nocheck_8, SYM_L_GLOBAL) 93 + ENDBR 96 94 ASM_STAC 97 95 4: mov %_ASM_AX,(%_ASM_CX) 98 96 #ifdef CONFIG_X86_32
+1 -1
arch/x86/lib/retpoline.S
··· 31 31 .align RETPOLINE_THUNK_SIZE 32 32 SYM_INNER_LABEL(__x86_indirect_thunk_\reg, SYM_L_GLOBAL) 33 33 UNWIND_HINT_EMPTY 34 + ANNOTATE_NOENDBR 34 35 35 36 ALTERNATIVE_2 __stringify(ANNOTATE_RETPOLINE_SAFE; jmp *%\reg), \ 36 37 __stringify(RETPOLINE \reg), X86_FEATURE_RETPOLINE, \ ··· 56 55 57 56 .align RETPOLINE_THUNK_SIZE 58 57 SYM_CODE_START(__x86_indirect_thunk_array) 59 - ANNOTATE_NOENDBR // apply_retpolines 60 58 61 59 #define GEN(reg) THUNK reg 62 60 #include <asm/GEN-for-each-reg.h>
+1
arch/x86/platform/pvh/head.S
··· 50 50 #define PVH_DS_SEL (PVH_GDT_ENTRY_DS * 8) 51 51 52 52 SYM_CODE_START_LOCAL(pvh_start_xen) 53 + UNWIND_HINT_EMPTY 53 54 cld 54 55 55 56 lgdt (_pa(gdt))
+9 -1
arch/x86/power/cpu.c
··· 25 25 #include <asm/cpu.h> 26 26 #include <asm/mmu_context.h> 27 27 #include <asm/cpu_device_id.h> 28 + #include <asm/microcode.h> 28 29 29 30 #ifdef CONFIG_X86_32 30 31 __visible unsigned long saved_context_ebx; ··· 263 262 x86_platform.restore_sched_clock_state(); 264 263 mtrr_bp_restore(); 265 264 perf_restore_debug_store(); 266 - msr_restore_context(ctxt); 267 265 268 266 c = &cpu_data(smp_processor_id()); 269 267 if (cpu_has(c, X86_FEATURE_MSR_IA32_FEAT_CTL)) 270 268 init_ia32_feat_ctl(c); 269 + 270 + microcode_bsp_resume(); 271 + 272 + /* 273 + * This needs to happen after the microcode has been updated upon resume 274 + * because some of the MSRs are "emulated" in microcode. 275 + */ 276 + msr_restore_context(ctxt); 271 277 } 272 278 273 279 /* Needed by apm.c */
+1
arch/x86/xen/xen-head.S
··· 45 45 __INIT 46 46 SYM_CODE_START(startup_xen) 47 47 UNWIND_HINT_EMPTY 48 + ANNOTATE_NOENDBR 48 49 cld 49 50 50 51 /* Clear .bss */
+1 -1
include/linux/cpu.h
··· 167 167 static inline void suspend_enable_secondary_cpus(void) { } 168 168 #endif /* !CONFIG_PM_SLEEP_SMP */ 169 169 170 - void cpu_startup_entry(enum cpuhp_state state); 170 + void __noreturn cpu_startup_entry(enum cpuhp_state state); 171 171 172 172 void cpu_idle_poll_ctrl(bool enable); 173 173
+1 -1
lib/strncpy_from_user.c
··· 25 25 * hit it), 'max' is the address space maximum (and we return 26 26 * -EFAULT if we hit it). 27 27 */ 28 - static inline long do_strncpy_from_user(char *dst, const char __user *src, 28 + static __always_inline long do_strncpy_from_user(char *dst, const char __user *src, 29 29 unsigned long count, unsigned long max) 30 30 { 31 31 const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
+1 -1
lib/strnlen_user.c
··· 20 20 * if it fits in a aligned 'long'. The caller needs to check 21 21 * the return value against "> max". 22 22 */ 23 - static inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max) 23 + static __always_inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max) 24 24 { 25 25 const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; 26 26 unsigned long align, res = 0;
+1 -1
scripts/Makefile.build
··· 231 231 $(if $(part-of-module), --module) \ 232 232 $(if $(CONFIG_X86_KERNEL_IBT), --lto --ibt) \ 233 233 $(if $(CONFIG_FRAME_POINTER),, --no-fp) \ 234 - $(if $(CONFIG_GCOV_KERNEL)$(CONFIG_LTO_CLANG), --no-unreachable)\ 234 + $(if $(CONFIG_GCOV_KERNEL), --no-unreachable) \ 235 235 $(if $(CONFIG_RETPOLINE), --retpoline) \ 236 236 $(if $(CONFIG_X86_SMAP), --uaccess) \ 237 237 $(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL), --mcount) \
+5 -8
tools/objtool/check.c
··· 184 184 "do_group_exit", 185 185 "stop_this_cpu", 186 186 "__invalid_creds", 187 + "cpu_startup_entry", 187 188 }; 188 189 189 190 if (!func) ··· 3218 3217 static void warn_noendbr(const char *msg, struct section *sec, unsigned long offset, 3219 3218 struct instruction *dest) 3220 3219 { 3221 - WARN_FUNC("%srelocation to !ENDBR: %s+0x%lx", sec, offset, msg, 3222 - dest->func ? dest->func->name : dest->sec->name, 3223 - dest->func ? dest->offset - dest->func->offset : dest->offset); 3220 + WARN_FUNC("%srelocation to !ENDBR: %s", sec, offset, msg, 3221 + offstr(dest->sec, dest->offset)); 3224 3222 } 3225 3223 3226 3224 static void validate_ibt_dest(struct objtool_file *file, struct instruction *insn, ··· 3823 3823 struct instruction *dest; 3824 3824 3825 3825 dest = validate_ibt_reloc(file, reloc); 3826 - if (is_data && dest && !dest->noendbr) { 3827 - warn_noendbr("data ", reloc->sym->sec, 3828 - reloc->sym->offset + reloc->addend, 3829 - dest); 3830 - } 3826 + if (is_data && dest && !dest->noendbr) 3827 + warn_noendbr("data ", sec, reloc->offset, dest); 3831 3828 } 3832 3829 } 3833 3830