Skip to content

Commit ae85249

Browse files
amlutoIngo Molnar
authored andcommitted
x86/entry/64: Further improve paranoid_entry comments
Commit: 16561f2 ("x86/entry: Add some paranoid entry/exit CR3 handling comments") ... added some comments. This improves them a bit: - When I first read the new comments, it was unclear to me whether they were referring to the case where paranoid_entry interrupted other entry code or where paranoid_entry was itself interrupted. Clarify it. - Remove the EBX comment. We no longer use EBX as a SWAPGS indicator. Signed-off-by: Andy Lutomirski <luto@kernel.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Borislav Petkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/c47daa1888dc2298e7e1d3f82bd76b776ea33393.1539542111.git.luto@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 04f4f95 commit ae85249

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

arch/x86/entry/entry_64.S

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,15 +1189,13 @@ ENTRY(paranoid_entry)
11891189
1:
11901190
/*
11911191
* Always stash CR3 in %r14. This value will be restored,
1192-
* verbatim, at exit. Needed if kernel is interrupted
1193-
* after switching to the user CR3 value but before
1194-
* returning to userspace.
1192+
* verbatim, at exit. Needed if paranoid_entry interrupted
1193+
* another entry that already switched to the user CR3 value
1194+
* but has not yet returned to userspace.
11951195
*
11961196
* This is also why CS (stashed in the "iret frame" by the
11971197
* hardware at entry) can not be used: this may be a return
1198-
* to kernel code, but with a user CR3 value. The %ebx flag
1199-
* for SWAPGS is also unusable for CR3 because there is a
1200-
* window with a user GS and a kernel CR3.
1198+
* to kernel code, but with a user CR3 value.
12011199
*/
12021200
SAVE_AND_SWITCH_TO_KERNEL_CR3 scratch_reg=%rax save_reg=%r14
12031201

0 commit comments

Comments
 (0)