Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2481267yba; Mon, 15 Apr 2019 12:33:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7Usgld22AyFlkFJaWama7XpU9qIkzA3AWh0FDtoMZxLT0LsRUHGeJjY1DSVaQeYTImVPt X-Received: by 2002:a63:2ace:: with SMTP id q197mr69029854pgq.371.1555356780761; Mon, 15 Apr 2019 12:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555356780; cv=none; d=google.com; s=arc-20160816; b=ie1pmdRm3S03kug7mAzD50fovL/X5Hffh4SDQfaouoibeCrvA6zGQwt7Pr+fSszqyT jGxxthQhSobbNDMNuZfYo9O+XyFtl7Ttu3VtEli11VcF78d8Q2PHwb9Hv0nnkGwsKi8B SPIawEfOewaYqnIaNSD4TVb58HpmF1WpdsYrudkIjQxuzQLjRFwQhgDVZyU4V6sNkY1N 8p4PDXks/lVeFwvE8K+yJfi/Pg+pV1utCttujr4nfOeLDEJ0nG97KVydfj6IvJsToUk2 uskQWGlkUOigf1yxRBNZhxzY+swfuhxbsun1QJDFJpIUOSqzQiiJ+4boNcBketBO53aQ +D0g== 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=MNNi2wthYGZeCj4ZiRJA1Qd7n5F+XDDJfP1v1cZOaCo=; b=LBrtviv2LfOpyBwiUGm1syMceL5FS81z9HDs8BtTfXy6Ca5oLeKEl7m8+NMl/V4fvs 4iVuM+gbOH/7ga+aLOgeeG4NW7Big432ALaN9f8H6LhgXJL2wV9iujwtV3ktXAFY8D37 etO1gjScJwD2Md+TBL36DgtvtkHYXAdAWFDuqVZh24yUbcKDBE0H5/WSE73bzoijBkZ4 hFrStPrjY4omNhIeMwNPPvpQd0mYECw6MaUMayQQjK8JR3aDo0xof85ArxoJoCbgU0nG w/z/qJvULZy0gBgnZ9TvJTbjRKyVLUtKVFNo/S2lxz67nsrnRRaGphgljMGtrJNEg8ma 5uFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ysMv+Qh7; 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 c2si45979577pls.226.2019.04.15.12.32.44; Mon, 15 Apr 2019 12:33:00 -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=ysMv+Qh7; 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 S1728363AbfDOTBz (ORCPT + 99 others); Mon, 15 Apr 2019 15:01:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:60586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728349AbfDOTBy (ORCPT ); Mon, 15 Apr 2019 15:01:54 -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 97317218EA; Mon, 15 Apr 2019 19:01:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555354914; bh=8NOR/pECFvGsYgDLApyRk/ZMCwtMEmTOeBLn1K05pEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ysMv+Qh7iWBqMC0hdvYUaP6L9bIbI1qFhz20ziEIIHZUar0NNhB9Q657HMJ1T2FYO VMQl0KKccxPNPYjOVdkK3aKhcZRQk7yt5A5F+Qz/j2qTu3ot8nD8XDLh/6XxB7g3VR C0TV7+70e6x4KvflUO3rqMdnGrMVUXOAyYlnyqtk= 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.14 04/69] x86/power/32: Move SYSENTER MSR restoration to fix_processor_context() Date: Mon, 15 Apr 2019 20:58:22 +0200 Message-Id: <20190415183727.431075450@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183726.036654568@linuxfoundation.org> References: <20190415183726.036654568@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 cba2e2c3f89e..8e1668470b23 100644 --- a/arch/x86/power/cpu.c +++ b/arch/x86/power/cpu.c @@ -176,6 +176,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 */ @@ -239,12 +242,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