Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Thomas Gleixner:
"A set of small fixes:

- make KGDB work again which got broken by the conversion of WARN()
to #UD. The WARN fixup needs to run before the notifier callchain,
otherwise KGDB tries to handle it and crashes.

- disable KASAN in the ORC unwinder to prevent false positive KASAN
warnings

- prevent default mapping above 47bit when 5 level page tables are
enabled

- make the delay calibration optimization work correctly, which had
the conditionals the wrong way around and was operating on data
which was not yet updated.

- remove the bogus X86_TRAP_BP trap init from the default IDT init
table, which broke 32bit int3 handling by overwriting the correct
int3 setup.

- replace this_cpu* with boot_cpu_data access in the preemptible
oprofile init code"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/debug: Handle warnings before the notifier chain, to fix KGDB crash
x86/mm: Fix ELF_ET_DYN_BASE for 5-level paging
x86/idt: Remove X86_TRAP_BP initialization in idt_setup_traps()
x86/oprofile/ppro: Do not use __this_cpu*() in preemptible context
x86/unwind: Disable KASAN checking in the ORC unwinder
x86/smpboot: Make optimization of delay calibration work correctly

Changed files
+20 -19
arch
x86
+1 -1
arch/x86/include/asm/elf.h
··· 253 253 * space open for things that want to use the area for 32-bit pointers. 254 254 */ 255 255 #define ELF_ET_DYN_BASE (mmap_is_ia32() ? 0x000400000UL : \ 256 - (TASK_SIZE / 3 * 2)) 256 + (DEFAULT_MAP_WINDOW / 3 * 2)) 257 257 258 258 /* This yields a mask that user programs can use to figure out what 259 259 instruction set this CPU supports. This could be done in user space,
-2
arch/x86/kernel/idt.c
··· 92 92 INTG(X86_TRAP_DF, double_fault), 93 93 #endif 94 94 INTG(X86_TRAP_DB, debug), 95 - INTG(X86_TRAP_NMI, nmi), 96 - INTG(X86_TRAP_BP, int3), 97 95 98 96 #ifdef CONFIG_X86_MCE 99 97 INTG(X86_TRAP_MC, &machine_check),
+6 -5
arch/x86/kernel/smpboot.c
··· 194 194 smp_store_cpu_info(cpuid); 195 195 196 196 /* 197 + * The topology information must be up to date before 198 + * calibrate_delay() and notify_cpu_starting(). 199 + */ 200 + set_cpu_sibling_map(raw_smp_processor_id()); 201 + 202 + /* 197 203 * Get our bogomips. 198 204 * Update loops_per_jiffy in cpu_data. Previous call to 199 205 * smp_store_cpu_info() stored a value that is close but not as ··· 209 203 cpu_data(cpuid).loops_per_jiffy = loops_per_jiffy; 210 204 pr_debug("Stack at about %p\n", &cpuid); 211 205 212 - /* 213 - * This must be done before setting cpu_online_mask 214 - * or calling notify_cpu_starting. 215 - */ 216 - set_cpu_sibling_map(raw_smp_processor_id()); 217 206 wmb(); 218 207 219 208 notify_cpu_starting(cpuid);
+7 -3
arch/x86/kernel/traps.c
··· 209 209 if (fixup_exception(regs, trapnr)) 210 210 return 0; 211 211 212 - if (fixup_bug(regs, trapnr)) 213 - return 0; 214 - 215 212 tsk->thread.error_code = error_code; 216 213 tsk->thread.trap_nr = trapnr; 217 214 die(str, regs, error_code); ··· 288 291 siginfo_t info; 289 292 290 293 RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU"); 294 + 295 + /* 296 + * WARN*()s end up here; fix them up before we call the 297 + * notifier chain. 298 + */ 299 + if (!user_mode(regs) && fixup_bug(regs, trapnr)) 300 + return; 291 301 292 302 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) != 293 303 NOTIFY_STOP) {
+3 -5
arch/x86/kernel/tsc.c
··· 1346 1346 unsigned long calibrate_delay_is_known(void) 1347 1347 { 1348 1348 int sibling, cpu = smp_processor_id(); 1349 - struct cpumask *mask = topology_core_cpumask(cpu); 1349 + int constant_tsc = cpu_has(&cpu_data(cpu), X86_FEATURE_CONSTANT_TSC); 1350 + const struct cpumask *mask = topology_core_cpumask(cpu); 1350 1351 1351 - if (!tsc_disabled && !cpu_has(&cpu_data(cpu), X86_FEATURE_CONSTANT_TSC)) 1352 - return 0; 1353 - 1354 - if (!mask) 1352 + if (tsc_disabled || !constant_tsc || !mask) 1355 1353 return 0; 1356 1354 1357 1355 sibling = cpumask_any_but(mask, cpu);
+1 -1
arch/x86/kernel/unwind_orc.c
··· 279 279 if (!stack_access_ok(state, addr, sizeof(long))) 280 280 return false; 281 281 282 - *val = READ_ONCE_TASK_STACK(state->task, *(unsigned long *)addr); 282 + *val = READ_ONCE_NOCHECK(*(unsigned long *)addr); 283 283 return true; 284 284 } 285 285
+2 -2
arch/x86/oprofile/op_model_ppro.c
··· 212 212 eax.full = cpuid_eax(0xa); 213 213 214 214 /* Workaround for BIOS bugs in 6/15. Taken from perfmon2 */ 215 - if (eax.split.version_id == 0 && __this_cpu_read(cpu_info.x86) == 6 && 216 - __this_cpu_read(cpu_info.x86_model) == 15) { 215 + if (eax.split.version_id == 0 && boot_cpu_data.x86 == 6 && 216 + boot_cpu_data.x86_model == 15) { 217 217 eax.split.version_id = 2; 218 218 eax.split.num_counters = 2; 219 219 eax.split.bit_width = 40;