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 tag 'x86_misc_for_6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull misc x86 updates from Dave Hansen:
"As usual for this branch, these are super random: a compile fix for
some newish LLVM checks and making sure a Kconfig text reference to
'RSB' matches the normal definition:

- Rework some CPU setup code to keep LLVM happy on 32-bit

- Correct RSB terminology in Kconfig text"

* tag 'x86_misc_for_6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/cpu: Make sure flag_is_changeable_p() is always being used
x86/bugs: Correct RSB terminology in Kconfig

+31 -33
+8 -9
arch/x86/Kconfig
··· 2564 2564 default y 2565 2565 help 2566 2566 Compile the kernel with call depth tracking to mitigate the Intel 2567 - SKL Return-Speculation-Buffer (RSB) underflow issue. The 2568 - mitigation is off by default and needs to be enabled on the 2569 - kernel command line via the retbleed=stuff option. For 2570 - non-affected systems the overhead of this option is marginal as 2571 - the call depth tracking is using run-time generated call thunks 2572 - in a compiler generated padding area and call patching. This 2573 - increases text size by ~5%. For non affected systems this space 2574 - is unused. On affected SKL systems this results in a significant 2575 - performance gain over the IBRS mitigation. 2567 + SKL Return-Stack-Buffer (RSB) underflow issue. The mitigation is off 2568 + by default and needs to be enabled on the kernel command line via the 2569 + retbleed=stuff option. For non-affected systems the overhead of this 2570 + option is marginal as the call depth tracking is using run-time 2571 + generated call thunks in a compiler generated padding area and call 2572 + patching. This increases text size by ~5%. For non affected systems 2573 + this space is unused. On affected SKL systems this results in a 2574 + significant performance gain over the IBRS mitigation. 2576 2575 2577 2576 config CALL_THUNKS_DEBUG 2578 2577 bool "Enable call thunks and call depth tracking debugging"
+5 -3
arch/x86/include/asm/cpuid.h
··· 6 6 #ifndef _ASM_X86_CPUID_H 7 7 #define _ASM_X86_CPUID_H 8 8 9 + #include <linux/types.h> 10 + 9 11 #include <asm/string.h> 10 12 11 13 struct cpuid_regs { ··· 22 20 }; 23 21 24 22 #ifdef CONFIG_X86_32 25 - extern int have_cpuid_p(void); 23 + bool have_cpuid_p(void); 26 24 #else 27 - static inline int have_cpuid_p(void) 25 + static inline bool have_cpuid_p(void) 28 26 { 29 - return 1; 27 + return true; 30 28 } 31 29 #endif 32 30 static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
+18 -21
arch/x86/kernel/cpu/common.c
··· 276 276 } 277 277 early_param("noinvpcid", x86_noinvpcid_setup); 278 278 279 - #ifdef CONFIG_X86_32 280 - static int cachesize_override = -1; 281 - static int disable_x86_serial_nr = 1; 282 - 283 - static int __init cachesize_setup(char *str) 284 - { 285 - get_option(&str, &cachesize_override); 286 - return 1; 287 - } 288 - __setup("cachesize=", cachesize_setup); 289 - 290 279 /* Standard macro to see if a specific flag is changeable */ 291 - static inline int flag_is_changeable_p(u32 flag) 280 + static inline bool flag_is_changeable_p(unsigned long flag) 292 281 { 293 - u32 f1, f2; 282 + unsigned long f1, f2; 283 + 284 + if (!IS_ENABLED(CONFIG_X86_32)) 285 + return true; 294 286 295 287 /* 296 288 * Cyrix and IDT cpus allow disabling of CPUID ··· 305 313 : "=&r" (f1), "=&r" (f2) 306 314 : "ir" (flag)); 307 315 308 - return ((f1^f2) & flag) != 0; 316 + return (f1 ^ f2) & flag; 309 317 } 310 318 319 + #ifdef CONFIG_X86_32 320 + static int cachesize_override = -1; 321 + static int disable_x86_serial_nr = 1; 322 + 323 + static int __init cachesize_setup(char *str) 324 + { 325 + get_option(&str, &cachesize_override); 326 + return 1; 327 + } 328 + __setup("cachesize=", cachesize_setup); 329 + 311 330 /* Probe for the CPUID instruction */ 312 - int have_cpuid_p(void) 331 + bool have_cpuid_p(void) 313 332 { 314 333 return flag_is_changeable_p(X86_EFLAGS_ID); 315 334 } ··· 352 349 } 353 350 __setup("serialnumber", x86_serial_nr_setup); 354 351 #else 355 - static inline int flag_is_changeable_p(u32 flag) 356 - { 357 - return 1; 358 - } 359 352 static inline void squash_the_stupid_serial_number(struct cpuinfo_x86 *c) 360 353 { 361 354 } ··· 1087 1088 1088 1089 static void identify_cpu_without_cpuid(struct cpuinfo_x86 *c) 1089 1090 { 1090 - #ifdef CONFIG_X86_32 1091 1091 int i; 1092 1092 1093 1093 /* ··· 1107 1109 break; 1108 1110 } 1109 1111 } 1110 - #endif 1111 1112 } 1112 1113 1113 1114 #define NO_SPECULATION BIT(0)