Commit 1612c382 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'x86-urgent-2022-08-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:

 - build fix for old(er) binutils

 - build fix for new GCC

 - kexec boot environment fix

* tag 'x86-urgent-2022-08-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/entry: Build thunk_$(BITS) only if CONFIG_PREEMPTION=y
  x86/numa: Use cpumask_available instead of hardcoded NULL check
  x86/bus_lock: Don't assume the init value of DEBUGCTLMSR.BUS_LOCK_DETECT to be zero
parents cac03ac3 de979c83
...@@ -11,12 +11,13 @@ CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE) ...@@ -11,12 +11,13 @@ CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE)
CFLAGS_common.o += -fno-stack-protector CFLAGS_common.o += -fno-stack-protector
obj-y := entry.o entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o obj-y := entry.o entry_$(BITS).o syscall_$(BITS).o
obj-y += common.o obj-y += common.o
obj-y += vdso/ obj-y += vdso/
obj-y += vsyscall/ obj-y += vsyscall/
obj-$(CONFIG_PREEMPTION) += thunk_$(BITS).o
obj-$(CONFIG_IA32_EMULATION) += entry_64_compat.o syscall_32.o obj-$(CONFIG_IA32_EMULATION) += entry_64_compat.o syscall_32.o
obj-$(CONFIG_X86_X32_ABI) += syscall_x32.o obj-$(CONFIG_X86_X32_ABI) += syscall_x32.o
...@@ -29,10 +29,8 @@ SYM_CODE_START_NOALIGN(\name) ...@@ -29,10 +29,8 @@ SYM_CODE_START_NOALIGN(\name)
SYM_CODE_END(\name) SYM_CODE_END(\name)
.endm .endm
#ifdef CONFIG_PREEMPTION
THUNK preempt_schedule_thunk, preempt_schedule THUNK preempt_schedule_thunk, preempt_schedule
THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace
EXPORT_SYMBOL(preempt_schedule_thunk) EXPORT_SYMBOL(preempt_schedule_thunk)
EXPORT_SYMBOL(preempt_schedule_notrace_thunk) EXPORT_SYMBOL(preempt_schedule_notrace_thunk)
#endif
...@@ -31,14 +31,11 @@ SYM_FUNC_END(\name) ...@@ -31,14 +31,11 @@ SYM_FUNC_END(\name)
_ASM_NOKPROBE(\name) _ASM_NOKPROBE(\name)
.endm .endm
#ifdef CONFIG_PREEMPTION
THUNK preempt_schedule_thunk, preempt_schedule THUNK preempt_schedule_thunk, preempt_schedule
THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace
EXPORT_SYMBOL(preempt_schedule_thunk) EXPORT_SYMBOL(preempt_schedule_thunk)
EXPORT_SYMBOL(preempt_schedule_notrace_thunk) EXPORT_SYMBOL(preempt_schedule_notrace_thunk)
#endif
#ifdef CONFIG_PREEMPTION
SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore) SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore)
popq %r11 popq %r11
popq %r10 popq %r10
...@@ -53,4 +50,3 @@ SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore) ...@@ -53,4 +50,3 @@ SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore)
RET RET
_ASM_NOKPROBE(__thunk_restore) _ASM_NOKPROBE(__thunk_restore)
SYM_CODE_END(__thunk_restore) SYM_CODE_END(__thunk_restore)
#endif
...@@ -1216,22 +1216,23 @@ static void bus_lock_init(void) ...@@ -1216,22 +1216,23 @@ static void bus_lock_init(void)
{ {
u64 val; u64 val;
/* if (!boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT))
* Warn and fatal are handled by #AC for split lock if #AC for
* split lock is supported.
*/
if (!boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT) ||
(boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT) &&
(sld_state == sld_warn || sld_state == sld_fatal)) ||
sld_state == sld_off)
return; return;
/*
* Enable #DB for bus lock. All bus locks are handled in #DB except
* split locks are handled in #AC in the fatal case.
*/
rdmsrl(MSR_IA32_DEBUGCTLMSR, val); rdmsrl(MSR_IA32_DEBUGCTLMSR, val);
val |= DEBUGCTLMSR_BUS_LOCK_DETECT;
if ((boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT) &&
(sld_state == sld_warn || sld_state == sld_fatal)) ||
sld_state == sld_off) {
/*
* Warn and fatal are handled by #AC for split lock if #AC for
* split lock is supported.
*/
val &= ~DEBUGCTLMSR_BUS_LOCK_DETECT;
} else {
val |= DEBUGCTLMSR_BUS_LOCK_DETECT;
}
wrmsrl(MSR_IA32_DEBUGCTLMSR, val); wrmsrl(MSR_IA32_DEBUGCTLMSR, val);
} }
......
...@@ -867,7 +867,7 @@ void debug_cpumask_set_cpu(int cpu, int node, bool enable) ...@@ -867,7 +867,7 @@ void debug_cpumask_set_cpu(int cpu, int node, bool enable)
return; return;
} }
mask = node_to_cpumask_map[node]; mask = node_to_cpumask_map[node];
if (!mask) { if (!cpumask_available(mask)) {
pr_err("node_to_cpumask_map[%i] NULL\n", node); pr_err("node_to_cpumask_map[%i] NULL\n", node);
dump_stack(); dump_stack();
return; return;
...@@ -913,7 +913,7 @@ const struct cpumask *cpumask_of_node(int node) ...@@ -913,7 +913,7 @@ const struct cpumask *cpumask_of_node(int node)
dump_stack(); dump_stack();
return cpu_none_mask; return cpu_none_mask;
} }
if (node_to_cpumask_map[node] == NULL) { if (!cpumask_available(node_to_cpumask_map[node])) {
printk(KERN_WARNING printk(KERN_WARNING
"cpumask_of_node(%d): no node_to_cpumask_map!\n", "cpumask_of_node(%d): no node_to_cpumask_map!\n",
node); node);
......
...@@ -28,8 +28,9 @@ else ...@@ -28,8 +28,9 @@ else
obj-y += syscalls_64.o vdso/ obj-y += syscalls_64.o vdso/
subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o ../entry/thunk_64.o \ subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o \
../lib/memmove_64.o ../lib/memset_64.o ../lib/memmove_64.o ../lib/memset_64.o
subarch-$(CONFIG_PREEMPTION) += ../entry/thunk_64.o
endif endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment