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 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Peter Anvin:
"A collection of small fixes:

- There still seem to be problems with asm goto which requires the
empty asm hack.
- If SMAP is disabled at compile time, don't enable it nor try to
interpret a page fault as an SMAP violation.
- Fix a case of unbounded recursion while tracing"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86, smap: smap_violation() is bogus if CONFIG_X86_SMAP is off
x86, smap: Don't enable SMAP if CONFIG_X86_SMAP is disabled
compiler/gcc4: Make quirk for asm_volatile_goto() unconditional
x86: Use preempt_disable_notrace() in cycles_2_ns()

+18 -13
+6 -1
arch/x86/kernel/cpu/common.c
··· 284 284 raw_local_save_flags(eflags); 285 285 BUG_ON(eflags & X86_EFLAGS_AC); 286 286 287 - if (cpu_has(c, X86_FEATURE_SMAP)) 287 + if (cpu_has(c, X86_FEATURE_SMAP)) { 288 + #ifdef CONFIG_X86_SMAP 288 289 set_in_cr4(X86_CR4_SMAP); 290 + #else 291 + clear_in_cr4(X86_CR4_SMAP); 292 + #endif 293 + } 289 294 } 290 295 291 296 /*
+2 -2
arch/x86/kernel/tsc.c
··· 209 209 * dance when its actually needed. 210 210 */ 211 211 212 - preempt_disable(); 212 + preempt_disable_notrace(); 213 213 data = this_cpu_read(cyc2ns.head); 214 214 tail = this_cpu_read(cyc2ns.tail); 215 215 ··· 229 229 if (!--data->__count) 230 230 this_cpu_write(cyc2ns.tail, data); 231 231 } 232 - preempt_enable(); 232 + preempt_enable_notrace(); 233 233 234 234 return ns; 235 235 }
+9 -5
arch/x86/mm/fault.c
··· 1001 1001 1002 1002 static inline bool smap_violation(int error_code, struct pt_regs *regs) 1003 1003 { 1004 + if (!IS_ENABLED(CONFIG_X86_SMAP)) 1005 + return false; 1006 + 1007 + if (!static_cpu_has(X86_FEATURE_SMAP)) 1008 + return false; 1009 + 1004 1010 if (error_code & PF_USER) 1005 1011 return false; 1006 1012 ··· 1093 1087 if (unlikely(error_code & PF_RSVD)) 1094 1088 pgtable_bad(regs, error_code, address); 1095 1089 1096 - if (static_cpu_has(X86_FEATURE_SMAP)) { 1097 - if (unlikely(smap_violation(error_code, regs))) { 1098 - bad_area_nosemaphore(regs, error_code, address); 1099 - return; 1100 - } 1090 + if (unlikely(smap_violation(error_code, regs))) { 1091 + bad_area_nosemaphore(regs, error_code, address); 1092 + return; 1101 1093 } 1102 1094 1103 1095 /*
+1 -5
include/linux/compiler-gcc4.h
··· 75 75 * 76 76 * (asm goto is automatically volatile - the naming reflects this.) 77 77 */ 78 - #if GCC_VERSION <= 40801 79 - # define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) 80 - #else 81 - # define asm_volatile_goto(x...) do { asm goto(x); } while (0) 82 - #endif 78 + #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) 83 79 84 80 #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP 85 81 #if GCC_VERSION >= 40400