From patchwork Mon Aug 22 22:35:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9294589 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 90904607FF for ; Mon, 22 Aug 2016 23:10:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FDED28AD7 for ; Mon, 22 Aug 2016 23:10:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73E7D28AE9; Mon, 22 Aug 2016 23:10:48 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D639528AD7 for ; Mon, 22 Aug 2016 23:10:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756624AbcHVXJi (ORCPT ); Mon, 22 Aug 2016 19:09:38 -0400 Received: from mail-cys01nam02on0082.outbound.protection.outlook.com ([104.47.37.82]:8981 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756313AbcHVXJc (ORCPT ); Mon, 22 Aug 2016 19:09:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4kYPng1ZuJ3u+34f4lvHtbPlm5YgqjjyjRw8V9jsemc=; b=krPbUb+ZhdO7sOYobN2k1dBUJbTRLXVYexgKduPHTPPr1Bl1aKOppCVX1vIO+UPkLQ/xoOLX2DS7YVMLcIlW8bQTYkBfbwHvBSnRdagPUqblH2pPi4KspcGUEdT49r2TyDsDOrl51V6qpNLYQK2f/UgbbB7+CzUKB0v3W3d0G9s= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from tlendack-t1.amdoffice.net (165.204.77.1) by CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Mon, 22 Aug 2016 22:35:52 +0000 From: Tom Lendacky Subject: [RFC PATCH v2 02/20] x86: Set the write-protect cache mode for full PAT support To: , , , , , , , , CC: Radim =?utf-8?b?S3LEjW3DocWZ?= , Arnd Bergmann , Jonathan Corbet , Matt Fleming , Joerg Roedel , "Konrad Rzeszutek Wilk" , Andrey Ryabinin , Ingo Molnar , Borislav Petkov , "Andy Lutomirski" , "H. Peter Anvin" , "Paolo Bonzini" , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov Date: Mon, 22 Aug 2016 17:35:50 -0500 Message-ID: <20160822223550.29880.39409.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20160822223529.29880.50884.stgit@tlendack-t1.amdoffice.net> References: <20160822223529.29880.50884.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY1PR20CA0049.namprd20.prod.outlook.com (10.163.250.17) To CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) X-MS-Office365-Filtering-Correlation-Id: 0d67dc2d-1c72-42f6-8d86-08d3cadcacde X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1141; 2:Ufv2CvvJ1xN0YXa7Xly/PNwRK2/YAOfdKDNrCEC+moK47Cc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OykxXwZjER5OiBKFdenPQyKnmRgLp84UUJQWfrkSCzVGgmGpAyexbUTFOd9CwRgprxy06/gUhEot9uZJkIuM+1WaReNuZFtxDrVCzSZe4wFs0f7/rVncbBcqPasRc3BU+kpdMJYhUJoFlxrF6CxoiO4qa+RFefyfsT+5IEilnb+nwCQs VoQk8yevdPygfFGiHnIbEQ2xXs 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)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:CY4PR12MB1141; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1141; X-Forefront-PRVS: 00429279BA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(189002)(23676002)(106356001)(229853001)(105586002)(50986999)(83506001)(33646002)(97746001)(76176999)(54356999)(42186005)(575784001)(101416001)(2201001)(86362001)(5660300001)(103116003)(66066001)(47776003)(50466002)(19580405001)(97736004)(19580395003)(5001770100001)(4001350100001)(7846002)(53416004)(189998001)(77096005)(305945005)(230700001)(81156014)(4326007)(7416002)(586003)(7736002)(3846002)(6116002)(8676002)(2906002)(81166006)(9686002)(92566002)(68736007)(2950100001)(1076002)(69596002)(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; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzIzOlBvU1BGQ0p2a2VSYnhWWnQzTm82clN0dXFz?= =?utf-8?B?NzNibkFzV3pVZVBrbzl1elR4ZUdLUkNGbE43dWRpclJaSWFJUGc0S1Y5TnZa?= =?utf-8?B?WjVIUUhqdnhFZDhhdnZ6OGM5ZjJwb1FBc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IAkt8BfwF0m2RJoiGqY9b/1iCNuv89EXgEdxZO0qmMXiGwLk X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2016 22:35:52.2887 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1141 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For processors that support PAT, set the write-protect cache mode (_PAGE_CACHE_MODE_WP) entry to the actual write-protect value (x05). Signed-off-by: Tom Lendacky Acked-by: Borislav Petkov --- arch/x86/mm/pat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index ecb1b69..8f0c44f 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) {