From patchwork Sun Aug 14 20:37:32 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: 9280071 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 9D66D60231 for ; Sun, 14 Aug 2016 20:46:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F3DF28A13 for ; Sun, 14 Aug 2016 20:46:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8386128A1A; Sun, 14 Aug 2016 20:46:37 +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 1112A289A7 for ; Sun, 14 Aug 2016 20:46:37 +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 1bZ2GU-0008MB-VD; Sun, 14 Aug 2016 20:44:14 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZ2GT-0008Lp-Hx for xen-devel@lists.xenproject.org; Sun, 14 Aug 2016 20:44:13 +0000 Received: from [193.109.254.147] by server-11.bemta-6.messagelabs.com id 01/44-08498-C18D0B75; Sun, 14 Aug 2016 20:44:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmkeJIrShJLcpLzFFi42LpubySR1fmxoZ wg+M7+Cy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozLB74xFfRJVmz7eoe1gfGwaBcjJ4eQwDZG iSn3uLsYOTjYBEwlZvxXAQmLCChIbO59xtrFyMXBLPCXVeL5siY2kISwgI9Ey7oWRhCbRUBV4 snS80wgNq+AlcTclY/BbAkBOYlL274wg9icAtYSM++1MkHsspK4ergPLC4qICaxuW0XK0SvoM TJmU9YQG5gFlCXWD9PaAIj7ywkmVkImQWMTKsYNYpTi8pSi3SNDfWSijLTM0pyEzNzdA0NzPR yU4uLE9NTcxKTivWS83M3MQIDhwEIdjA2LQo8xCjJwaQkyqtjvi5ciC8pP6UyI7E4I76oNCe1 +BCjDAeHkgTvqWsbwoUEi1LTUyvSMnOAIQyTluDgURLhfQ6S5i0uSMwtzkyHSJ1iVJQS530Ek hAASWSU5sG1weLmEqOslDAvI9AhQjwFqUW5mSWo8q8YxTkYlYR534FM4cnMK4Gb/gpoMRPQYn 1psMUliQgpqQZG37Cziu/Crobcq+/00lyg/K1Gv0u54kL0pGfaWxpllkYfmP4yUUj6kVdDR47 s0bQ8f81l/Iu+r5BZoBzc03/MRiOQdW3BE+v8ClX2Mxs++EUdmbhfUH6Je85Uy3dx3e01XQsV 5ynt8V17RFI0++DuPKuVq7yW/Ts9zY49VXLWLZ32kru+/e1KLMUZiYZazEXFiQAW96aClgIAA A== X-Env-Sender: gregkh@linuxfoundation.org X-Msg-Ref: server-10.tower-27.messagelabs.com!1471207450!53935104!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 53183 invoked from network); 14 Aug 2016 20:44:11 -0000 Received: from mail.linuxfoundation.org (HELO mail.linuxfoundation.org) (140.211.169.12) by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 14 Aug 2016 20:44:11 -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 0DB2D8A5; Sun, 14 Aug 2016 20:44:10 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Date: Sun, 14 Aug 2016 22:37:32 +0200 Message-Id: <20160814202506.087770821@linuxfoundation.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160814202504.908694181@linuxfoundation.org> References: <20160814202504.908694181@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.6 28/56] 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.6-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 @@ -192,7 +192,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 @@ -75,7 +75,6 @@ #include #include #include -#include #include #ifdef CONFIG_ACPI @@ -1511,7 +1510,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) @@ -1618,13 +1616,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