Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753968AbcKJAtV (ORCPT ); Wed, 9 Nov 2016 19:49:21 -0500 Received: from mail-bl2nam02on0060.outbound.protection.outlook.com ([104.47.38.60]:24064 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751934AbcKJAtQ (ORCPT ); Wed, 9 Nov 2016 19:49:16 -0500 X-Greylist: delayed 815 seconds by postgrey-1.27 at vger.kernel.org; Wed, 09 Nov 2016 19:49:15 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; From: Tom Lendacky Subject: [RFC PATCH v3 02/20] x86: Set the write-protect cache mode for full PAT support To: , , , , , , , , CC: Rik van Riel , Radim =?utf-8?b?S3LEjW3DocWZ?= , Arnd Bergmann , Jonathan Corbet , Matt Fleming , Joerg Roedel , Konrad Rzeszutek Wilk , "Paolo Bonzini" , Larry Woodman , "Ingo Molnar" , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , "Thomas Gleixner" , Dmitry Vyukov Date: Wed, 9 Nov 2016 18:34:48 -0600 Message-ID: <20161110003448.3280.27573.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20161110003426.3280.2999.stgit@tlendack-t1.amdoffice.net> References: <20161110003426.3280.2999.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY4PR21CA0009.namprd21.prod.outlook.com (10.172.122.147) To CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) X-MS-Office365-Filtering-Correlation-Id: b76dcb7c-811d-4f71-d10e-08d409016330 X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;2:JxB/tEv5JcOkyGqqJCp+AvD9ckjbhHogK0UbFLX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78GwNMndnCGnaLp+gHSU0zRHXQPtGWFuuA+JORS9MHs4f9Ehd571gvukFzlr13tZbVYPpQrtZL5Cw== X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;31:zFsu/OeIvIVAyMT4eiToUkCvsPQeKKYQSsGZy9d++5q4ZDWjZ356zlwA2TFioKGzH61C8Cj6NvhljaxnyNz9wOw1WQ5BvhTzLvlpT49GIeV4kxHWD2+fo3xicE1fJKYO39JJmsfYIFhG0/cHCrXx+DsNhUwbI4N+eYFqvASiA5Xoqi1IyAiBaEcpLztOdUCKVnV2N6NaMy92TWyL0xBif7a/7sX1Yb2bucxdUFWNcAAcs9YzqTyUDPopFLuLU9EE;20:wkhEGrJYPGnxqVp9oGY9Ll/6RBzccIyxZwpVKv9RGVt4RCb8VOm8cGHuECxaIrSuXgEvR47YH2qanAMZUh88iTkrH+WA/Y6CvrR5AN1An/YRNiALeUx3htlSwOVpysdOyZWU1ztD3umpDJYp484KmVoXdejueTeQhKtTT3C57yybHeTD5fU8KL3i2feAhp0i5n/RL2oNS9TSWilIj7Fv9pRQr7SgEPl6j9keknUDRWgY/iPcP3M3LvSQxPNnE5SP6aN2JbG1DRrYdyLm+hz9iK+inG/wlS0QVZV7L79k9ZlNCNPij/xwIn4C5HHELTeG1Vc+ociTq0EkMkMFXN+x1OiJC/qyH9pZN9tizWtOJcHqMaVNxUXAVDt9T191yIzlLeU1INbKsYFnQCCxGP3MgFO5K7IVPHRrRPyAUtWCxlEj5t7foCQj/NDPHAQd+Rm0hWiQS6PDynbAmlUBRKgR7V+iCXUg9Kpbrkq9IVaEz22kWNFNB37CSnbbO1AaMKWT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026);SRVR:CY4PR12MB1141;BCL:0;PCL:0;RULEID:;SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;4:pRxZS10qheQsRbNuyPRg2zYaPvATROrKJRoc6brYFr8Z3oCmaafxCqo7AUwn0W5FaHD5E/mhNnnml6IpCZRzP9+R2nHZ3c0WSA2gS5xILluxIltLoTXxm92ACFfQurRLp6oh1eHDbuYGEoSfNgw4QPbx+SyKMsDj288r75nuRGI2+kuuyNADehtUYCpP/9sFgJiY3oUPGBxfE1ak1QsZe0tG+9zvBU4wFigsgKRyo7WioF1tF2Ck/Tm7L6gVbdaTK4PbVpPYbtPOSHxCW9tV2pHerMHLq0M4BZlfjr8pYJyTUeriF9qdnjD29eTslCMAEEHQHLygip6OzDEAjhBWuPoKuwDZcR55/k8e+nth2sZ0tFvWA6Xu7kxnEJVkP3oWCGSi4lUNphTwFj+fZneYanKr1uS5VgIyt/nJ9aeY+//341sUVtSI35Y5MqSV6IANezf1/xsNoLGR9nb5Cih9ZQ== X-Forefront-PRVS: 01221E3973 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(189002)(103116003)(92566002)(47776003)(23676002)(8676002)(7736002)(69596002)(50466002)(189998001)(81166006)(66066001)(9686002)(305945005)(5660300001)(77096005)(7846002)(101416001)(86362001)(6666003)(2201001)(2950100002)(5001770100001)(50986999)(4001350100001)(76176999)(54356999)(97736004)(1076002)(81156014)(53416004)(105586002)(42186005)(4326007)(83506001)(7416002)(97746001)(6116002)(230700001)(3846002)(586003)(68736007)(106356001)(33646002)(2906002)(71626007)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1141;H:tlendack-t1.amdoffice.net;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzIzOlVzd1krSXNkSmhnTndaaXhTMGVnRHdXWUZu?= =?utf-8?B?ZDRRY25LdE1oT1JEajk2OXJWZmlUTEkrSzl5anNhM3JYV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NtFAPJV4QbitXiK2tvOhl6zTV+1+rH9Uy4yc8jhdVXp3Z/1XRRsZi+Bo0tfL8V2lOIIeXaZw1Vyn X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2016 00:34:52.0885 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1141 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1131 Lines: 31 For processors that support PAT, set the write-protect cache mode (_PAGE_CACHE_MODE_WP) entry to the actual write-protect value (x05). Acked-by: Borislav Petkov Signed-off-by: Tom Lendacky --- arch/x86/mm/pat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 170cc4f..87e8952 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c @@ -355,7 +355,7 @@ void pat_init(void) * 010 2 UC-: _PAGE_CACHE_MODE_UC_MINUS * 011 3 UC : _PAGE_CACHE_MODE_UC * 100 4 WB : Reserved - * 101 5 WC : Reserved + * 101 5 WP : _PAGE_CACHE_MODE_WP * 110 6 UC-: Reserved * 111 7 WT : _PAGE_CACHE_MODE_WT * @@ -363,7 +363,7 @@ void pat_init(void) * corresponding types in the presence of PAT errata. */ pat = PAT(0, WB) | PAT(1, WC) | PAT(2, UC_MINUS) | PAT(3, UC) | - PAT(4, WB) | PAT(5, WC) | PAT(6, UC_MINUS) | PAT(7, WT); + PAT(4, WB) | PAT(5, WP) | PAT(6, UC_MINUS) | PAT(7, WT); } if (!boot_cpu_done) {