Skip to content

Commit 527838d

Browse files
committed
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
2 parents ae3e10a + 92a4728 commit 527838d

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

arch/x86/boot/compressed/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,13 @@ define cmd_check_data_rel
106106
done
107107
endef
108108

109+
# We need to run two commands under "if_changed", so merge them into a
110+
# single invocation.
111+
quiet_cmd_check-and-link-vmlinux = LD $@
112+
cmd_check-and-link-vmlinux = $(cmd_check_data_rel); $(cmd_ld)
113+
109114
$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
110-
$(call if_changed,check_data_rel)
111-
$(call if_changed,ld)
115+
$(call if_changed,check-and-link-vmlinux)
112116

113117
OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
114118
$(obj)/vmlinux.bin: vmlinux FORCE

arch/x86/entry/entry_64.S

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ ENTRY(\sym)
981981

982982
call \do_sym
983983

984-
jmp error_exit /* %ebx: no swapgs flag */
984+
jmp error_exit
985985
.endif
986986
END(\sym)
987987
.endm
@@ -1222,7 +1222,6 @@ END(paranoid_exit)
12221222

12231223
/*
12241224
* Save all registers in pt_regs, and switch GS if needed.
1225-
* Return: EBX=0: came from user mode; EBX=1: otherwise
12261225
*/
12271226
ENTRY(error_entry)
12281227
UNWIND_HINT_FUNC
@@ -1269,7 +1268,6 @@ ENTRY(error_entry)
12691268
* for these here too.
12701269
*/
12711270
.Lerror_kernelspace:
1272-
incl %ebx
12731271
leaq native_irq_return_iret(%rip), %rcx
12741272
cmpq %rcx, RIP+8(%rsp)
12751273
je .Lerror_bad_iret
@@ -1303,28 +1301,20 @@ ENTRY(error_entry)
13031301

13041302
/*
13051303
* 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
1307-
* error_exit knows that we will be returning to user mode.
1304+
* as if we faulted immediately after IRET.
13081305
*/
13091306
mov %rsp, %rdi
13101307
call fixup_bad_iret
13111308
mov %rax, %rsp
1312-
decl %ebx
13131309
jmp .Lerror_entry_from_usermode_after_swapgs
13141310
END(error_entry)
13151311

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-
*/
13221312
ENTRY(error_exit)
13231313
UNWIND_HINT_REGS
13241314
DISABLE_INTERRUPTS(CLBR_ANY)
13251315
TRACE_IRQS_OFF
1326-
testl %ebx, %ebx
1327-
jnz retint_kernel
1316+
testb $3, CS(%rsp)
1317+
jz retint_kernel
13281318
jmp retint_user
13291319
END(error_exit)
13301320

arch/x86/kernel/apic/apic.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,9 @@ static u32 skx_deadline_rev(void)
573573
case 0x04: return 0x02000014;
574574
}
575575

576+
if (boot_cpu_data.x86_stepping > 4)
577+
return 0;
578+
576579
return ~0U;
577580
}
578581

0 commit comments

Comments
 (0)