Skip to content

Commit

Permalink
x86/entry/64: Use JMP instead of JMPQ
Browse files Browse the repository at this point in the history
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: 18ec54f ("x86/speculation: Prepare entry code for Spectre v1 swapgs mitigations")
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Josh Poimboeuf authored and Thomas Gleixner committed Jul 17, 2019
1 parent a205982 commit 64dbc12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/entry/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ ENTRY(interrupt_entry)
UNWIND_HINT_FUNC

movq (%rdi), %rdi
jmpq 2f
jmp 2f
1:
FENCE_SWAPGS_KERNEL_ENTRY
2:
Expand Down

0 comments on commit 64dbc12

Please sign in to comment.