aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-07-30 15:16:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-07-30 15:16:03 -0400
commit527838d470e3a6e79e8ee9d5ddf28920df2a196e (patch)
treec771684749876b128d1d1168841f4213cae3bc8a
parentae3e10aba57c284818fd493b18732ce8a4632e1e (diff)
parent92a4728608a8fd228c572bc8ff50dd98aa0ddf2a (diff)
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: "Misc fixes: - a build race fix - a Xen entry fix - a TSC_DEADLINE quirk future-proofing fix" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot: Fix if_changed build flip/flop bug x86/entry/64: Remove %ebx handling from error_entry/exit x86/apic: Future-proof the TSC_DEADLINE quirk for SKX
-rw-r--r--arch/x86/boot/compressed/Makefile8
-rw-r--r--arch/x86/entry/entry_64.S18
-rw-r--r--arch/x86/kernel/apic/apic.c3
3 files changed, 13 insertions, 16 deletions
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index fa42f895fdde..169c2feda14a 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -106,9 +106,13 @@ define cmd_check_data_rel
106 done 106 done
107endef 107endef
108 108
109# We need to run two commands under "if_changed", so merge them into a
110# single invocation.
111quiet_cmd_check-and-link-vmlinux = LD $@
112 cmd_check-and-link-vmlinux = $(cmd_check_data_rel); $(cmd_ld)
113
109$(obj)/vmlinux: $(vmlinux-objs-y) FORCE 114$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
110 $(call if_changed,check_data_rel) 115 $(call if_changed,check-and-link-vmlinux)
111 $(call if_changed,ld)
112 116
113OBJCOPYFLAGS_vmlinux.bin := -R .comment -S 117OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
114$(obj)/vmlinux.bin: vmlinux FORCE 118$(obj)/vmlinux.bin: vmlinux FORCE
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 73a522d53b53..8ae7ffda8f98 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -981,7 +981,7 @@ ENTRY(\sym)
981 981
982 call \do_sym 982 call \do_sym
983 983
984 jmp error_exit /* %ebx: no swapgs flag */ 984 jmp error_exit
985 .endif 985 .endif
986END(\sym) 986END(\sym)
987.endm 987.endm
@@ -1222,7 +1222,6 @@ END(paranoid_exit)
1222 1222
1223/* 1223/*
1224 * Save all registers in pt_regs, and switch GS if needed. 1224 * Save all registers in pt_regs, and switch GS if needed.
1225 * Return: EBX=0: came from user mode; EBX=1: otherwise
1226 */ 1225 */
1227ENTRY(error_entry) 1226ENTRY(error_entry)
1228 UNWIND_HINT_FUNC 1227 UNWIND_HINT_FUNC
@@ -1269,7 +1268,6 @@ ENTRY(error_entry)
1269 * for these here too. 1268 * for these here too.
1270 */ 1269 */
1271.Lerror_kernelspace: 1270.Lerror_kernelspace:
1272 incl %ebx
1273 leaq native_irq_return_iret(%rip), %rcx 1271 leaq native_irq_return_iret(%rip), %rcx
1274 cmpq %rcx, RIP+8(%rsp) 1272 cmpq %rcx, RIP+8(%rsp)
1275 je .Lerror_bad_iret 1273 je .Lerror_bad_iret
@@ -1303,28 +1301,20 @@ ENTRY(error_entry)
1303 1301
1304 /* 1302 /*
1305 * Pretend that the exception came from user mode: set up pt_regs 1303 * Pretend that the exception came from user mode: set up pt_regs
1306 * as if we faulted immediately after IRET and clear EBX so that 1304 * as if we faulted immediately after IRET.
1307 * error_exit knows that we will be returning to user mode.
1308 */ 1305 */
1309 mov %rsp, %rdi 1306 mov %rsp, %rdi
1310 call fixup_bad_iret 1307 call fixup_bad_iret
1311 mov %rax, %rsp 1308 mov %rax, %rsp
1312 decl %ebx
1313 jmp .Lerror_entry_from_usermode_after_swapgs 1309 jmp .Lerror_entry_from_usermode_after_swapgs
1314END(error_entry) 1310END(error_entry)
1315 1311
1316
1317/*
1318 * On entry, EBX is a "return to kernel mode" flag:
1319 * 1: already in kernel mode, don't need SWAPGS
1320 * 0: user gsbase is loaded, we need SWAPGS and standard preparation for return to usermode
1321 */
1322ENTRY(error_exit) 1312ENTRY(error_exit)
1323 UNWIND_HINT_REGS 1313 UNWIND_HINT_REGS
1324 DISABLE_INTERRUPTS(CLBR_ANY) 1314 DISABLE_INTERRUPTS(CLBR_ANY)
1325 TRACE_IRQS_OFF 1315 TRACE_IRQS_OFF
1326 testl %ebx, %ebx 1316 testb $3, CS(%rsp)
1327 jnz retint_kernel 1317 jz retint_kernel
1328 jmp retint_user 1318 jmp retint_user
1329END(error_exit) 1319END(error_exit)
1330 1320
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 2aabd4cb0e3f..adbda5847b14 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -573,6 +573,9 @@ static u32 skx_deadline_rev(void)
573 case 0x04: return 0x02000014; 573 case 0x04: return 0x02000014;
574 } 574 }
575 575
576 if (boot_cpu_data.x86_stepping > 4)
577 return 0;
578
576 return ~0U; 579 return ~0U;
577} 580}
578 581