linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jpoimboe@redhat.com, mingo@kernel.org, peterz@infradead.org,
	luto@kernel.org, pavel@ucw.cz, jarkko.nikula@linux.intel.com,
	torvalds@linux-foundation.org, tglx@linutronix.de,
	rui.zhang@intel.com, rjw@rjwysocki.net,
	rafael.j.wysocki@intel.com, linux-kernel@vger.kernel.org,
	bpetkov@suse.de, hpa@zytor.com
Subject: [tip:x86/urgent] x86/power/32: Move SYSENTER MSR restoration to fix_processor_context()
Date: Fri, 15 Dec 2017 06:38:07 -0800	[thread overview]
Message-ID: <tip-896c80bef4d3b357814a476663158aaf669d0fb3@git.kernel.org> (raw)
In-Reply-To: <65158f8d7ee64dd6bbc6c1c83b3b34aaa854e3ae.1513286253.git.luto@kernel.org>

Commit-ID:  896c80bef4d3b357814a476663158aaf669d0fb3
Gitweb:     https://git.kernel.org/tip/896c80bef4d3b357814a476663158aaf669d0fb3
Author:     Andy Lutomirski <luto@kernel.org>
AuthorDate: Thu, 14 Dec 2017 13:19:06 -0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 15 Dec 2017 12:18:29 +0100

x86/power/32: Move SYSENTER MSR restoration to fix_processor_context()

x86_64 restores system call MSRs in fix_processor_context(), and
x86_32 restored them along with segment registers.  The 64-bit
variant makes more sense, so move the 32-bit code to match the
64-bit code.

No side effects are expected to runtime behavior.

Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bpetkov@suse.de>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Zhang Rui <rui.zhang@intel.com>
Link: http://lkml.kernel.org/r/65158f8d7ee64dd6bbc6c1c83b3b34aaa854e3ae.1513286253.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/power/cpu.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
index 472bc8c..033c61e 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -174,6 +174,9 @@ static void fix_processor_context(void)
 	write_gdt_entry(desc, GDT_ENTRY_TSS, &tss, DESC_TSS);
 
 	syscall_init();				/* This sets MSR_*STAR and related */
+#else
+	if (boot_cpu_has(X86_FEATURE_SEP))
+		enable_sep_cpu();
 #endif
 	load_TR_desc();				/* This does ltr */
 	load_mm_ldt(current->active_mm);	/* This does lldt */
@@ -237,12 +240,6 @@ static void notrace __restore_processor_state(struct saved_context *ctxt)
 	loadsegment(fs, ctxt->fs);
 	loadsegment(gs, ctxt->gs);
 	loadsegment(ss, ctxt->ss);
-
-	/*
-	 * sysenter MSRs
-	 */
-	if (boot_cpu_has(X86_FEATURE_SEP))
-		enable_sep_cpu();
 #else
 /* CONFIG_X86_64 */
 	asm volatile ("movw %0, %%ds" :: "r" (ctxt->ds));

  reply	other threads:[~2017-12-15 14:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 21:19 [PATCH urgent 0/3] __restore_processor_state() fixes Andy Lutomirski
2017-12-14 21:19 ` [PATCH urgent 1/3] x86/power/64: Use struct desc_ptr for the IDT in struct saved_context Andy Lutomirski
2017-12-15 14:37   ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2017-12-14 21:19 ` [PATCH urgent 2/3] x86/power/32: Move SYSENTER MSR restoration to fix_processor_context() Andy Lutomirski
2017-12-15 14:38   ` tip-bot for Andy Lutomirski [this message]
2017-12-14 21:19 ` [PATCH urgent 3/3] x86/power: Make restore_processor_context() sane Andy Lutomirski
2017-12-14 22:32   ` Pavel Machek
2017-12-15 14:38   ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2017-12-15  1:28 ` [PATCH urgent 0/3] __restore_processor_state() fixes Rafael J. Wysocki
2017-12-15  1:35   ` Linus Torvalds
2017-12-15 11:21     ` Ingo Molnar
2017-12-15  9:18   ` Jarkko Nikula
2017-12-15 11:31     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-896c80bef4d3b357814a476663158aaf669d0fb3@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bpetkov@suse.de \
    --cc=hpa@zytor.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).