From patchwork Sun Aug 14 20:23:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 9279919 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 57FD060839 for ; Sun, 14 Aug 2016 20:28:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49266289F3 for ; Sun, 14 Aug 2016 20:28:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D03828A1A; Sun, 14 Aug 2016 20:28:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BA30E289F3 for ; Sun, 14 Aug 2016 20:28:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZ1z8-0006KF-Mm; Sun, 14 Aug 2016 20:26:18 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZ1z7-0006Jm-Vs for xen-devel@lists.xenproject.org; Sun, 14 Aug 2016 20:26:18 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id 60/D2-05661-9E3D0B75; Sun, 14 Aug 2016 20:26:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmkeJIrShJLcpLzFFi42LpubySR/fF5Q3 hBu8vKlt83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBmLz85kLOiTrJi8aylzA+Nh0S5GLg4hgW2M ElP2X2DtYuTgYBMwlZjxX6WLkZNDREBBYnPvM1aQGmaBv6wSz5c1sYEkhAV8JK6+nssEUs8io Crx+XIASJhXwEpicUM7E4gtISAncWnbF2YQm1PAWqLz1xqwuBBQzenpLawgtqiAmMTmtl2sEL 2CEidnPmEBGcksoC6xfp7QBEbeWUgysxAyCxiZVjFqFKcWlaUW6Rqa6CUVZaZnlOQmZuboGhq Y6eWmFhcnpqfmJCYV6yXn525iBAYOAxDsYLy+MeAQoyQHk5Ior475unAhvqT8lMqMxOKM+KLS nNTiQ4wyHBxKErw/L20IFxIsSk1PrUjLzAGGMExagoNHSYRXFRjGQrzFBYm5xZnpEKlTjIpS4 rxSIAkBkERGaR5cGyxuLjHKSgnzMgIdIsRTkFqUm1mCKv+KUZyDUUmY1wZkCk9mXgnc9FdAi5 mAFutLgy0uSURISTUwcn2r/fhbXy9MbYrMz+rfb92TXrx5e5uBad3FGxXTJzzf/W9L3IGsVUe WO+a/j/xkWVhV84rH4tcCubL9v3Y7qEy78CzmRaCeql3FS43Vq1Z7uqlri25efDPlSnPAmrd7 c0u8q6Vfndxl035eTW3LJrWteyau8vzyxzDeMkmry3mT/IyNB7Z71CmxFGckGmoxFxUnAgAwM cPElgIAAA== X-Env-Sender: gregkh@linuxfoundation.org X-Msg-Ref: server-15.tower-27.messagelabs.com!1471206375!968828!1 X-Originating-IP: [140.211.169.12] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 42506 invoked from network); 14 Aug 2016 20:26:16 -0000 Received: from mail.linuxfoundation.org (HELO mail.linuxfoundation.org) (140.211.169.12) by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 14 Aug 2016 20:26:16 -0000 Received: from localhost (pes75-3-78-192-101-3.fbxo.proxad.net [78.192.101.3]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F33718B1; Sun, 14 Aug 2016 20:26:13 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Date: Sun, 14 Aug 2016 22:23:28 +0200 Message-Id: <20160814202304.054608434@linuxfoundation.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160814202302.493206349@linuxfoundation.org> References: <20160814202302.493206349@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Cc: Juergen Gross , Denys Vlasenko , xen-devel@lists.xenproject.org, Toshi Kani , Peter Zijlstra , Greg Kroah-Hartman , "Luis R. Rodriguez" , "H. Peter Anvin" , stable@vger.kernel.org, Andy Lutomirski , paul.gortmaker@windriver.com, Ingo Molnar , Borislav Petkov , Brian Gerst , Toshi Kani , Thomas Gleixner , Borislav Petkov , Linus Torvalds , Andrew Morton , elliott@hpe.com Subject: [Xen-devel] [PATCH 4.4 28/49] x86/xen, pat: Remove PAT table init code from Xen X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Toshi Kani commit 88ba281108ed0c25c9d292b48bd3f272fcb90dd0 upstream. Xen supports PAT without MTRRs for its guests. In order to enable WC attribute, it was necessary for xen_start_kernel() to call pat_init_cache_modes() to update PAT table before starting guest kernel. Now that the kernel initializes PAT table to the BIOS handoff state when MTRR is disabled, this Xen-specific PAT init code is no longer necessary. Delete it from xen_start_kernel(). Also change __init_cache_modes() to a static function since PAT table should not be tweaked by other modules. Signed-off-by: Toshi Kani Reviewed-by: Thomas Gleixner Acked-by: Juergen Gross Cc: Andrew Morton Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Konrad Rzeszutek Wilk Cc: Linus Torvalds Cc: Luis R. Rodriguez Cc: Peter Zijlstra Cc: Toshi Kani Cc: elliott@hpe.com Cc: paul.gortmaker@windriver.com Cc: xen-devel@lists.xenproject.org Link: http://lkml.kernel.org/r/1458769323-24491-7-git-send-email-toshi.kani@hpe.com Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/pat.h | 1 - arch/x86/mm/pat.c | 2 +- arch/x86/xen/enlighten.c | 9 --------- 3 files changed, 1 insertion(+), 11 deletions(-) --- a/arch/x86/include/asm/pat.h +++ b/arch/x86/include/asm/pat.h @@ -7,7 +7,6 @@ bool pat_enabled(void); void pat_disable(const char *reason); extern void pat_init(void); -void __init_cache_modes(u64); extern int reserve_memtype(u64 start, u64 end, enum page_cache_mode req_pcm, enum page_cache_mode *ret_pcm); --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c @@ -191,7 +191,7 @@ static enum page_cache_mode pat_get_cach * configuration. * Using lower indices is preferred, so we start with highest index. */ -void __init_cache_modes(u64 pat) +static void __init_cache_modes(u64 pat) { enum page_cache_mode cache; char pat_msg[33]; --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -74,7 +74,6 @@ #include #include #include -#include #include #ifdef CONFIG_ACPI @@ -1519,7 +1518,6 @@ asmlinkage __visible void __init xen_sta { struct physdev_set_iopl set_iopl; unsigned long initrd_start = 0; - u64 pat; int rc; if (!xen_start_info) @@ -1627,13 +1625,6 @@ asmlinkage __visible void __init xen_sta xen_start_info->nr_pages); xen_reserve_special_pages(); - /* - * Modify the cache mode translation tables to match Xen's PAT - * configuration. - */ - rdmsrl(MSR_IA32_CR_PAT, pat); - __init_cache_modes(pat); - /* keep using Xen gdt for now; no urgent need to change it */ #ifdef CONFIG_X86_32