Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2520847yba; Mon, 15 Apr 2019 13:28:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNJ9CtLstc53Z5NHF0sPmbliXen2wQshKBK/3r1IEtNeNV/zQBVtsUVOcY1AKEygbVvFpN X-Received: by 2002:a17:902:2862:: with SMTP id e89mr58875116plb.203.1555360104605; Mon, 15 Apr 2019 13:28:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555360104; cv=none; d=google.com; s=arc-20160816; b=f5CrSX6FnqFcAsOMVTEvCEzchlsN/80vee5vnajqgAf8vA0a2Jzz52LuSPt77sCrDx okYPjAa8ebrPupDB0YRVN/mSGJj+JmaQ4qckthRVvHi6MwQYl40g3fOxKyHCcwfMRmCI UNE9RiLmOMvRtLJE+r03OQKuTxV2B77hLTeEev+XXtSFpEZlPFPNUNCH/pykF6z3HnYV vpTcGIROHIfUKYVwCx/YQ4tYpg9p6lMFPdhUADRcMB9cpqwg/XsUksG0H5TL8cYqP6Kv 0ggkgBKgfUTilDLhoTzd0vfw31D/f+qTea+gNJC7MKNZg+7cUPnunDIOpP/7VASNeH8c YLzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=meEPiA8wSsUaMyA2kUaKx8aWFF+Thi89jNfsY0PwAPM=; b=DjzmSKki+A/U5IBGFbvag9ZLwS0fGVZLzvGcNfsXHehiqGlfkugjAdhgmeBbTSIex/ LnT9KZ/YngMC8ZBtIJBVASqVKu7lMA7bb7XHAhJpBcuVohE79SqBeU6Pth6VmavCN0qq 4T3c+GngpnreNaR692RlpzyG/k2xzv9vNyMkbUW5J1RzhVElVXnv3akB4OT7yKNG3aZr An/gpIoA83MbNtErqyhHID+IZun+gerDnZoHTf9qdqx1RVPeiW1ZSJiArikzwRLRHMkA ZQ0FDq+le2cecI9LQlTGcmXT0GM3mVPVVCN97q0Lw/3478P2jV2vc2QgYDXFLsizh1kG ZqKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PWUZEoT2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2si44429085pgp.463.2019.04.15.13.28.08; Mon, 15 Apr 2019 13:28:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PWUZEoT2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728281AbfDOSpD (ORCPT + 99 others); Mon, 15 Apr 2019 14:45:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:47102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbfDOSpA (ORCPT ); Mon, 15 Apr 2019 14:45:00 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 226262087C; Mon, 15 Apr 2019 18:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555353899; bh=gPOzjF3Ah0fHfYf3kjNVVRihwvNCGPi5bn1dV1i4ZR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PWUZEoT2xq/U2ZUF6zB82f7wyMs6Ize+yVaQDG8F/T+ZYxHkSIiika9LIo6IqSltB s4lYaMdcf33S8iJ8uKhqiQi0uRqZ9NUNf7JBTzKMd/CRLa97RhQHNjY1NXuhJKVY3w S8bu9mFZCjhOHJ1xYxhNPyX3bCXUZQN0OUoSVpwY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jarkko Nikula , Andy Lutomirski , "Rafael J. Wysocki" , Thomas Gleixner , Borislav Petkov , Josh Poimboeuf , Linus Torvalds , Pavel Machek , Peter Zijlstra , "Rafael J. Wysocki" , Zhang Rui , Ingo Molnar , Sasha Levin Subject: [PATCH 4.9 03/76] x86/power/32: Move SYSENTER MSR restoration to fix_processor_context() Date: Mon, 15 Apr 2019 20:43:27 +0200 Message-Id: <20190415183708.371743815@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183707.712011689@linuxfoundation.org> References: <20190415183707.712011689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 896c80bef4d3b357814a476663158aaf669d0fb3 ] 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 Signed-off-by: Sasha Levin --- 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 ec923a1cdaf0..2335e8beb0cf 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 */ @@ -233,12 +236,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)); -- 2.19.1