Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756700AbdLOOmp (ORCPT ); Fri, 15 Dec 2017 09:42:45 -0500 Received: from terminus.zytor.com ([65.50.211.136]:59989 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756539AbdLOOmh (ORCPT ); Fri, 15 Dec 2017 09:42:37 -0500 Date: Fri, 15 Dec 2017 06:38:07 -0800 From: tip-bot for Andy Lutomirski Message-ID: 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 Reply-To: peterz@infradead.org, luto@kernel.org, jpoimboe@redhat.com, mingo@kernel.org, hpa@zytor.com, bpetkov@suse.de, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, tglx@linutronix.de, jarkko.nikula@linux.intel.com, pavel@ucw.cz, rui.zhang@intel.com, rafael.j.wysocki@intel.com, rjw@rjwysocki.net In-Reply-To: <65158f8d7ee64dd6bbc6c1c83b3b34aaa854e3ae.1513286253.git.luto@kernel.org> References: <65158f8d7ee64dd6bbc6c1c83b3b34aaa854e3ae.1513286253.git.luto@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/power/32: Move SYSENTER MSR restoration to fix_processor_context() Git-Commit-ID: 896c80bef4d3b357814a476663158aaf669d0fb3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2210 Lines: 60 Commit-ID: 896c80bef4d3b357814a476663158aaf669d0fb3 Gitweb: https://git.kernel.org/tip/896c80bef4d3b357814a476663158aaf669d0fb3 Author: Andy Lutomirski AuthorDate: Thu, 14 Dec 2017 13:19:06 -0800 Committer: Ingo Molnar 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 Signed-off-by: Andy Lutomirski Acked-by: Rafael J. Wysocki Acked-by: Thomas Gleixner Cc: Borislav Petkov Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Zhang Rui Link: http://lkml.kernel.org/r/65158f8d7ee64dd6bbc6c1c83b3b34aaa854e3ae.1513286253.git.luto@kernel.org Signed-off-by: Ingo Molnar --- 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));