linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/entry64: move comment about informing of context tracking in right place
@ 2016-10-24 11:22 Alexander Kuleshov
  2016-11-03 11:24 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kuleshov @ 2016-10-24 11:22 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Ingo Molnar, H . Peter Anvin, Andy Lutomirski, Borislav Petkov,
	Paolo Bonzini, linux-kernel, Alexander Kuleshov

We are switching to kernel gsbase if an IRQ come from usermode with swpags.
Now there is comment which describes this:

  IRQ from user mode. Switch to kernel gsbase and inform context tracking that
  we're in kernel mode.

But now we execute swapgs, next TRACE_IRQS_OFF and only then the
CALL_enter_from_user_mode macro expands to the informing of
context tracking about this event. Let's move part of comment to
the right place where actual call to context tracing occured.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 arch/x86/entry/entry_64.S | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index ef766a3..5e97642 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -474,8 +474,7 @@ END(irq_entries_start)
 	jz	1f
 
 	/*
-	 * IRQ from user mode.  Switch to kernel gsbase and inform context
-	 * tracking that we're in kernel mode.
+	 * IRQ from user mode.  Switch to kernel gsbase.
 	 */
 	SWAPGS
 
@@ -489,6 +488,9 @@ END(irq_entries_start)
 	 */
 	TRACE_IRQS_OFF
 
+	/*
+	 * Inform context tracking that we're in kernel mode.
+	 */
 	CALL_enter_from_user_mode
 
 1:
-- 
2.8.0.rc3.1353.gea9bdc0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/entry64: move comment about informing of context tracking in right place
  2016-10-24 11:22 [PATCH] x86/entry64: move comment about informing of context tracking in right place Alexander Kuleshov
@ 2016-11-03 11:24 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2016-11-03 11:24 UTC (permalink / raw)
  To: Alexander Kuleshov
  Cc: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, Andy Lutomirski,
	Paolo Bonzini, linux-kernel

On Mon, Oct 24, 2016 at 05:22:34PM +0600, Alexander Kuleshov wrote:
> We are switching to kernel gsbase if an IRQ come from usermode with swpags.

"... if an IRQ comes from ..."

Also, you mean SWAPGS. Instruction names in allcaps please and spelled
correctly please.

> Now there is comment which describes this:
> 
>   IRQ from user mode. Switch to kernel gsbase and inform context tracking that
>   we're in kernel mode.
> 
> But now we execute swapgs, next TRACE_IRQS_OFF and only then the
> CALL_enter_from_user_mode macro expands to the informing of
> context tracking about this event. Let's move part of comment to
> the right place where actual call to context tracing occured.

I don't agree with that change - SWAPGS is part of what the comment
explains so it looks just fine where it is.

For future patches:

Please integrate scripts/checkpatch.pl in your patch creation workflow:

WARNING: 'occured' may be misspelled - perhaps 'occurred'?
#27: 
the right place where actual call to context tracing occured.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-03 11:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-24 11:22 [PATCH] x86/entry64: move comment about informing of context tracking in right place Alexander Kuleshov
2016-11-03 11:24 ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).