From: Josh Poimboeuf Date: Mon, 15 Jul 2019 16:51:39 +0000 (-0500) Subject: x86/entry/64: Use JMP instead of JMPQ X-Git-Tag: v4.4.189~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=967858f2f222dd140429c70d855e85dafcc89c29;p=thirdparty%2Fkernel%2Fstable.git x86/entry/64: Use JMP instead of JMPQ commit 64dbc122b20f75183d8822618c24f85144a5a94d upstream. Somehow the swapgs mitigation entry code patch ended up with a JMPQ instruction instead of JMP, where only the short jump is needed. Some assembler versions apparently fail to optimize JMPQ into a two-byte JMP when possible, instead always using a 7-byte JMP with relocation. For some reason that makes the entry code explode with a #GP during boot. Change it back to "JMP" as originally intended. Fixes: 18ec54fdd6d1 ("x86/speculation: Prepare entry code for Spectre v1 swapgs mitigations") Signed-off-by: Josh Poimboeuf Signed-off-by: Thomas Gleixner [bwh: Backported to 4.4: adjust context] Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 0baac4a1dc11c..afb805b0148b1 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -567,7 +567,7 @@ END(irq_entries_start) #ifdef CONFIG_CONTEXT_TRACKING call enter_from_user_mode #endif - jmpq 2f + jmp 2f 1: FENCE_SWAPGS_KERNEL_ENTRY 2: