Skip to content

Commit 0b2c605

Browse files
committed
x86/entry/64: Correct the comment over SAVE_AND_SET_GSBASE
Add the proper explanation why an LFENCE is not needed in the FSGSBASE case. Fixes: c82965f ("x86/entry/64: Handle FSGSBASE enabled paranoid entry/exit") Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20200821090710.GE12181@zn.tnic
1 parent d012a71 commit 0b2c605

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

arch/x86/entry/entry_64.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,8 +840,9 @@ SYM_CODE_START_LOCAL(paranoid_entry)
840840
* retrieve and set the current CPUs kernel GSBASE. The stored value
841841
* has to be restored in paranoid_exit unconditionally.
842842
*
843-
* The MSR write ensures that no subsequent load is based on a
844-
* mispredicted GSBASE. No extra FENCE required.
843+
* The unconditional write to GS base below ensures that no subsequent
844+
* loads based on a mispredicted GS base can happen, therefore no LFENCE
845+
* is needed here.
845846
*/
846847
SAVE_AND_SET_GSBASE scratch_reg=%rax save_reg=%rbx
847848
ret

0 commit comments

Comments
 (0)