From patchwork Fri Jun 16 18:52:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9793249 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 5CA7260325 for ; Fri, 16 Jun 2017 18:54:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EB262865B for ; Fri, 16 Jun 2017 18:54:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41C1A28670; Fri, 16 Jun 2017 18:54:26 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 8BD682865B for ; Fri, 16 Jun 2017 18:54:25 +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 1dLwM2-00022L-OO; Fri, 16 Jun 2017 18:52:22 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLwM1-000219-AA for xen-devel@lists.xen.org; Fri, 16 Jun 2017 18:52:21 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id 53/08-01732-4E824495; Fri, 16 Jun 2017 18:52:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA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abs.com!1497639137!67485374!1 X-Originating-IP: [104.47.40.61] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 50113 invoked from network); 16 Jun 2017 18:52:19 -0000 Received: from mail-co1nam03on0061.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) (104.47.40.61) by server-6.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 16 Jun 2017 18:52:19 -0000 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=M1YbKYbv2MLWbxayttKSJD9i2dbEtBp5BtWKDRtvr8Q=; b=oN8mcISUPby02XqBhgZ5IRa8Q0o3w8embY8cTxLyFCvrDkHFeeIJIHFVBTy7x6xBTYkmgvDTCcNAffLC9WZzKlbyCwhQyTexjyWyjxcd95nDitT6VIKynL/HZq0qVWoBJOcPlAv3AKB7fKx8lgTPOHlCzHMucIKPNckKvsTEZvw= 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_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Fri, 16 Jun 2017 18:52:11 +0000 From: Tom Lendacky To: linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, xen-devel@lists.xen.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org Date: Fri, 16 Jun 2017 13:52:08 -0500 Message-ID: <20170616185208.18967.72141.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170616184947.18967.84890.stgit@tlendack-t1.amdoffice.net> References: <20170616184947.18967.84890.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: BN6PR04CA0060.namprd04.prod.outlook.com (10.174.93.177) To CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR12MB1141: X-MS-Office365-Filtering-Correlation-Id: 764815ef-f74c-4521-c16e-08d4b4e8ce76 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1141; 3:5MoVfHqF28IG04XcVFUslmGYlKs2NBbPJ92siDs3nkAZQcKZJ7NhtNAmu5/CISkCxA9yuzIoFSMCQZGZumYAAGIDC3VeE1DgkI7U4DyBwzrC/FRFAaPMZYU9SSXgqPegV6CUtgRAv8cixiDfLBAYAj2ZB8dd42RYoDo1EC+T7NDKdTklgccz9NKgrXjW2qgX068HNmceAl725DEtIAX2iu60Ve8VYbDJVBnYoQbpCIAxq/pYpIDazpGc/eqvqXQ54XhScAHGp7eHyh7GIibFaeIhwYNlpWASFrP6QcbsR8OZbCv1cVj/pNy6CLQsitjreM/Il4GiAxK8ANrivcivgemks6oJoyrkav9A0vKkDL4=; 25:9ho7wkDih00mXo+p8KYm5bg69ZzMjC3et/a7A7T5bwokrKSvBi8Bcxtc45ztAltg7WGfhyAXQ75H7CNR1x1CtDv9WyecObVbAVPlKrM4XrJaJdvFGMoQJ/UHzzMSH0MAS/GqbvH2IbITazVrasLOVVhtUDS7HLXqwXTc+JiLI4iSiFjZDqv2dlDW280EDDOqs9S037lKFzaFDobpttWQKPdbXDr6q+KHx+0xdX+bL1kAzZV8iWxzVrzjJtqX17G7wO04k4Mcxk7JN/YzrLziv41CInjfJEF42MQeVfeaWM78Bg789OgtdXGuWsGN7kRO7UMgo0hsS1zFT8Xdxtdl3dulDck1Vw0j1pM/lFdwPfaGvlJjbdxK9ijcR1JJBhxM4tUI85J1fvL554EoXAuXzfr2KdfzE1nM4c7ba+gYF4vTaJZLfG+VQLTIxXuLtfMkLKpsZE181LE7FU72n0wsybsWe43beb05OPuh8uVVzgk= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1141; 31:m4hDiXVnq/VRA+keqR/BogL9AthFlQJVkxYRSI+OhtMPVXcDRhi8puOQLW1qSCsSoCHWwsb/0b8UGa0/iSqPxnbyYKnZFxAb2xat9mekYfFZjRGvn5ycUr5u45FfpYA47Fs2GPEL0w2GGIHz5ZqbekRr3owSW9B07qVaNMLLAYxC6iJfE8zcvj7zMEfptcMRGJkkcn20FDl583X7p+xfi1BnfM+rdSaqS20EX0XBSfc=; 20:jMzQ60XR7H8WjNbQDFecdtNuV8y829sa9pokt5PkX5Yyn4jZOLX5TqKxL4JEC5/o+LnqsGql3XkMxlwxwCj+efveA8lbO929O/xDxaamUhlijDpvHSi028JEbkRMC11hQwghUNsL7NAky8IAU68XRUhQhoTsUqiWhYzjcqRTIDi0wi0WOTn456figyB01IY0pQ9g7iORCDj0z6xjQ5UlaZBb05002AU7J0oW4wCqknjU/JGGg1T/8qqFcnxuIRn7sxL9UAE5CuL8A5MwXUDZsQfQABKSIBPOogmGUwRjJTLRJHqogEhkiHMrrdRr/IhjIKreBI4aVwSEYyovNgGxyfqIw4rNb0sCwrn/P1FmUPR1zyaEnMeb92r6gR5uqfFaByfwMXHudJH8ZfxU2E1mF0vPaScfRTfj87BZdH05eAVVmw9qq1LcG7a2JOf5DWU0OnrTWqnpw4P6BoMRNw8aWUqCC/z+z9xajJV955FJm72Mg4lbMw1RAa8BjIVU8rF/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR12MB1141; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzQ6RXYvWEh5dlU2ck9DcER4cEl5ek4wREI2aDlw?= =?utf-8?B?WkhKaEZ3YWNqUS92R0VnMyszakJnNENKN1AyT2ZET3VvUk5ra3NjOHZPNGF2?= =?utf-8?B?UExXQ3BPQkgxVUZFbjVYUmtSL2RoVU81QXk0eXNNekpTcHlLU0NGNzVFdUNO?= =?utf-8?B?VDMwaEhaN2p1YkRaWnRreUpzZ1I2OUtyRUJCNDF6UEkxYUxZd0xCWXY5aHpv?= =?utf-8?B?VVRoYUwreWRpZTNXMUs2bmo2aFlSL1Bza2lHNG1CMDVEVVdTbHN2eHoycGVD?= =?utf-8?B?K2hDYlRtS2VJOWsxaUZ3b09VN2d4ZlNhYk8vV3RvVHI4dVZzUEl4bjNaSmRE?= =?utf-8?B?ZU5nNjMwNDI1WW04Rzd2c1E5S0ptOUhLR3FqcmU1ZWJZeUUrRGpQVThMY0Zo?= =?utf-8?B?Y3l1NTVOemF4WE9lK0kyOGd5a0JoeXg5MnFWUVVxTmlWWi92ZUtoc3ZWc3lM?= =?utf-8?B?cDU3emw1amVqWVQ5NFdpZkx6T0thaDhyMFd2NUJBVjUrMnVqaFQ2eklUa01X?= =?utf-8?B?Mm5LaEJ0MFllaHhmOVVqV2cwVkNqLzBldG5lQ0Fob0pqaHJqSi8rNTVyY3ZE?= =?utf-8?B?UHVBcHN0NHV6QmhucmhXZ2M5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V1Rlo5cGFUZ0JpR214MmE5N1pwTXNrV3ZmdU9yTkhBZ2lpallq?= =?utf-8?B?QjVMQXdFMXFIZ2N2K3RSejNxMzNJYlE2Zm5TY0Myay94MnZ6SERJQ0IyTEpI?= =?utf-8?Q?BHDZH0qCdS0JdNJ+NYz?= X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39840400002)(39400400002)(39860400002)(39410400002)(39850400002)(54356999)(4001350100001)(50986999)(305945005)(86362001)(76176999)(8676002)(81166006)(6506006)(7736002)(4326008)(189998001)(83506001)(25786009)(5660300001)(1076002)(6666003)(230700001)(9686003)(3846002)(6116002)(47776003)(66066001)(2906002)(23676002)(33646002)(103116003)(2950100002)(7416002)(50466002)(54906002)(7406005)(110136004)(478600001)(38730400002)(55016002)(53416004)(72206003)(42186005)(53936002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1141; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzIzOks0bTVDUWMrUk15cUc1ZVAyK3dBQXlneVVT?= =?utf-8?B?a1FHdjV3RDBaSC9JdDR5MDNNeThiZ3J5NTc1QmM1YUxmbHlmTGwxRk1ZR05W?= =?utf-8?B?SWpZRlh5dUNQc2crYUZkNk4vWDR4YjV4NVFnUGgvRWlXcG5BZzJpcDJOUEFQ?= =?utf-8?B?V0x0T3FQQUVWSmJjOFV3aGhmd3FWSXhpTG9CZU9TSXRhNzZ3dHl2M0pKNC8r?= =?utf-8?B?UStQa2lwMTdEVkVaVmpaVlVzTFZUakRxM3lBMW9wdWZwZHZGc1NrY2gxOHlM?= =?utf-8?B?Y3BBaUFwc1N1SjFKaDF0OHlZaGhDem5ZTG5kTnNWWUFULzdkcXY3LzN6THFp?= =?utf-8?B?TXhrZU0vZGgwanFzWkFkNzlyRW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DNSpvxg1bAd5lNEM4VhjvKPegr3PSYQAS5I3eBHTY/y0Bg3ROOT9rb+nl5i426ZMFzl6hrgmqCY8sCFtyjieOsGE9bt0yRhnU0+SH9lkPd5Yv5qyPa0YIp2J9Uk6RYsxoMZBGzwF+Pph9B+xMuUQ7zwIkRtOSMTFPMu9RCDlFfkOBZcC87sr61FY8M5rhRZCrk/jCOoNAEggLNmUnqZHD479KDGFZIQIvgnVyGa3+gTBmhTPQA9rsWrdP2o1IjWeDBbFc8Ajl8FOzTsrIaY1X1DUt/2Fm7tUepgkkSVV6rDlkzQXW1t1B3xLwAQiNgB02YtbNXfpvIVbYvIumHJ1yy3gCQ4u5fX7JpeR/fas0F6qxZOLxda0TScwEy+QAX2D/s53jvT4ny90lcT0PCcL3yOdkyG/axk/WaySHhGoL3nzkKqi/HrPIzcpvT6M9qWF7nM1Mv7Ba+yrU+jw1jgTT9uBb4lKJNpQpQIkFVJSNlSXn5Uq3oid857bIDKIqhdWQcg8gIQTohXz5AXg= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1141; 20:jRCigXllqmr3wMozaizcsxspZTirO/K0FWHXt4MOE/BUtqVAS2dwxSLKOwM96Lf0Ge7h4vzPeDMl+sLH6QkfRIhC+LwOPa6V4/t9ZdtDlnYDkgEB3tHaR2FFrAqOcvhMlVpQKfP64tvfjIpfPl5Z0dxp2xYMgEnlWLMhmW68Ofu89Nhtlq2NGJ3dO+xnRbvBd6RSMcZaB1Y9a8e1xyDe7qcx1KxalK6nszleznsEklUyu3fEg9QAsrm+tB984RLP X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 18:52:11.8213 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1141 Cc: Brijesh Singh , Toshimitsu Kani , "Michael S. Tsirkin" , Matt Fleming , Alexander Potapenko , "H. Peter Anvin" , Boris Ostrovsky , Jonathan Corbet , Joerg Roedel , Radim =?utf-8?b?S3LEjW3DocWZ?= , Larry Woodman , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , Dmitry Vyukov , Juergen Gross , Paolo Bonzini Subject: [Xen-devel] [PATCH v7 12/36] x86/mm: Extend early_memremap() support with additional attrs 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 Add early_memremap() support to be able to specify encrypted and decrypted mappings with and without write-protection. The use of write-protection is necessary when encrypting data "in place". The write-protect attribute is considered cacheable for loads, but not stores. This implies that the hardware will never give the core a dirty line with this memtype. Reviewed-by: Borislav Petkov Signed-off-by: Tom Lendacky --- arch/x86/Kconfig | 4 +++ arch/x86/include/asm/fixmap.h | 13 ++++++++++ arch/x86/include/asm/pgtable_types.h | 8 ++++++ arch/x86/mm/ioremap.c | 44 ++++++++++++++++++++++++++++++++++ include/asm-generic/early_ioremap.h | 2 ++ mm/early_ioremap.c | 10 ++++++++ 6 files changed, 81 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index cf74791..0b09b88 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1433,6 +1433,10 @@ config AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT If set to N, then the encryption of system memory can be activated with the mem_encrypt=on command line option. +config ARCH_USE_MEMREMAP_PROT + def_bool y + depends on AMD_MEM_ENCRYPT + # Common NUMA Features config NUMA bool "Numa Memory Allocation and Scheduler Support" diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h index d9ff226..dcd9fb5 100644 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h @@ -164,6 +164,19 @@ static inline void __set_fixmap(enum fixed_addresses idx, */ #define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_IO_NOCACHE +/* + * Early memremap routines used for in-place encryption. The mappings created + * by these routines are intended to be used as temporary mappings. + */ +void __init *early_memremap_encrypted(resource_size_t phys_addr, + unsigned long size); +void __init *early_memremap_encrypted_wp(resource_size_t phys_addr, + unsigned long size); +void __init *early_memremap_decrypted(resource_size_t phys_addr, + unsigned long size); +void __init *early_memremap_decrypted_wp(resource_size_t phys_addr, + unsigned long size); + #include #define __late_set_fixmap(idx, phys, flags) __set_fixmap(idx, phys, flags) diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index de32ca3..32095af 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -161,6 +161,7 @@ enum page_cache_mode { #define _PAGE_CACHE_MASK (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT) #define _PAGE_NOCACHE (cachemode2protval(_PAGE_CACHE_MODE_UC)) +#define _PAGE_CACHE_WP (cachemode2protval(_PAGE_CACHE_MODE_WP)) #define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED) #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | \ @@ -189,6 +190,7 @@ enum page_cache_mode { #define __PAGE_KERNEL_VVAR (__PAGE_KERNEL_RO | _PAGE_USER) #define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE) #define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE) +#define __PAGE_KERNEL_WP (__PAGE_KERNEL | _PAGE_CACHE_WP) #define __PAGE_KERNEL_IO (__PAGE_KERNEL) #define __PAGE_KERNEL_IO_NOCACHE (__PAGE_KERNEL_NOCACHE) @@ -202,6 +204,12 @@ enum page_cache_mode { #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | \ _PAGE_DIRTY | _PAGE_ENC) +#define __PAGE_KERNEL_ENC (__PAGE_KERNEL | _PAGE_ENC) +#define __PAGE_KERNEL_ENC_WP (__PAGE_KERNEL_WP | _PAGE_ENC) + +#define __PAGE_KERNEL_NOENC (__PAGE_KERNEL) +#define __PAGE_KERNEL_NOENC_WP (__PAGE_KERNEL_WP) + #define PAGE_KERNEL __pgprot(__PAGE_KERNEL | _PAGE_ENC) #define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO | _PAGE_ENC) #define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC | _PAGE_ENC) diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index a382ba9..4feda83 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -422,6 +422,50 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr) iounmap((void __iomem *)((unsigned long)addr & PAGE_MASK)); } +#ifdef CONFIG_ARCH_USE_MEMREMAP_PROT +/* Remap memory with encryption */ +void __init *early_memremap_encrypted(resource_size_t phys_addr, + unsigned long size) +{ + return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_ENC); +} + +/* + * Remap memory with encryption and write-protected - cannot be called + * before pat_init() is called + */ +void __init *early_memremap_encrypted_wp(resource_size_t phys_addr, + unsigned long size) +{ + /* Be sure the write-protect PAT entry is set for write-protect */ + if (__pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] != _PAGE_CACHE_MODE_WP) + return NULL; + + return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_ENC_WP); +} + +/* Remap memory without encryption */ +void __init *early_memremap_decrypted(resource_size_t phys_addr, + unsigned long size) +{ + return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_NOENC); +} + +/* + * Remap memory without encryption and write-protected - cannot be called + * before pat_init() is called + */ +void __init *early_memremap_decrypted_wp(resource_size_t phys_addr, + unsigned long size) +{ + /* Be sure the write-protect PAT entry is set for write-protect */ + if (__pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] != _PAGE_CACHE_MODE_WP) + return NULL; + + return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_NOENC_WP); +} +#endif /* CONFIG_ARCH_USE_MEMREMAP_PROT */ + static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)] __page_aligned_bss; static inline pmd_t * __init early_ioremap_pmd(unsigned long addr) diff --git a/include/asm-generic/early_ioremap.h b/include/asm-generic/early_ioremap.h index 734ad4d..2edef8d 100644 --- a/include/asm-generic/early_ioremap.h +++ b/include/asm-generic/early_ioremap.h @@ -13,6 +13,8 @@ extern void *early_memremap(resource_size_t phys_addr, unsigned long size); extern void *early_memremap_ro(resource_size_t phys_addr, unsigned long size); +extern void *early_memremap_prot(resource_size_t phys_addr, + unsigned long size, unsigned long prot_val); extern void early_iounmap(void __iomem *addr, unsigned long size); extern void early_memunmap(void *addr, unsigned long size); diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c index 6d5717b..d7d30da 100644 --- a/mm/early_ioremap.c +++ b/mm/early_ioremap.c @@ -226,6 +226,16 @@ void __init early_iounmap(void __iomem *addr, unsigned long size) } #endif +#ifdef CONFIG_ARCH_USE_MEMREMAP_PROT +void __init * +early_memremap_prot(resource_size_t phys_addr, unsigned long size, + unsigned long prot_val) +{ + return (__force void *)__early_ioremap(phys_addr, size, + __pgprot(prot_val)); +} +#endif + #define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT) void __init copy_from_early_mem(void *dest, phys_addr_t src, unsigned long size)