From patchwork Fri Jun 16 18:53:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9793281 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 05E2860325 for ; Fri, 16 Jun 2017 18:55:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAAAD2865B for ; Fri, 16 Jun 2017 18:55:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD95328670; Fri, 16 Jun 2017 18:55:49 +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 105732865B for ; Fri, 16 Jun 2017 18:55:49 +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 1dLwNK-00031k-0C; Fri, 16 Jun 2017 18:53:42 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLwNI-00030h-CT for xen-devel@lists.xen.org; Fri, 16 Jun 2017 18:53:40 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id 0F/D9-02180-33924495; Fri, 16 Jun 2017 18:53:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA1V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-206.messagelabs.com!1497639216!103601478!1 X-Originating-IP: [104.47.34.87] 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 19295 invoked from network); 16 Jun 2017 18:53:37 -0000 Received: from mail-by2nam01on0087.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) (104.47.34.87) by server-6.tower-206.messagelabs.com with AES256-SHA256 encrypted SMTP; 16 Jun 2017 18:53:37 -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=CfXgY+yVDZEjn+zPrMB+E3XOwIVOh9WeLM4k0YpeZOA=; b=jamjpGqw+bbqFskHJcmLwOCqFWTPtrOWqqv0R/jZxLlc8JuQiEoXxRFIIBeCvdzZYR3lqzpBlIC6Jig88h7XSyYoDBA7PJK7d+0tEmkrRQK+gXRjAtmzDVcfUsTM5avxC2YKsrFVEMNKUSIAwSlMrfrpiDzMuQvYsgcPBCk1tiw= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by DM5PR12MB1148.namprd12.prod.outlook.com (10.168.236.143) 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:53:29 +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:53:26 -0500 Message-ID: <20170616185326.18967.43278.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: BN6PR04CA0050.namprd04.prod.outlook.com (10.174.93.167) To DM5PR12MB1148.namprd12.prod.outlook.com (10.168.236.143) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR12MB1148: X-MS-Office365-Filtering-Correlation-Id: 6c7b9f89-f22c-4418-4a71-08d4b4e8fc9b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:DM5PR12MB1148; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 3:/aggh815zlWZcFcha+XfOvkBpMnpueCN/8MU775l6xXPMbYSnPP1jlc6D0mGlcra/G6gek0vgu5/1YTTe0uyPKkhkh+s5PIVWu4YyvHjmBc3zub3Nhku/EsdIncpiUXjjHF0cfiM9nggilhNteq3a5EABMUmk92w6wpj8bj1liC4bMpCy3VLu6R37muZJg3Iqiz2MSLmdam4yFVctbOrrHwORXd+mYigaYlXEfFubS8WQzuiF07ufpeK4gz6rpky0KzWdFH5Edo8zb3ihfQ5DDREVr3bLooYORncm8s31APvkIL0qmDJGt25JxdxiCeG0dX8ewd6JUBsm8UbJ4p6faPFkJuf2tG/Bq+3Tdt3elo= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 25:DXgI/dn6pQk2A5m55KUykbUTUOMvlR4JCvbbSehdeogYs3Chg3Z3SLJvDAp06RfwBd5namdvlaq/5Jad/00PDvvrouBu89hIXLy7V9B3uaQbi/cYlhNsspkXIbxnpOB+QOS7AvKwWyKiYovlak0RBuONXuFUiJbksRPRo2lCwZtEHx6sCuQ9X3RDdBMZylUqEjkFR8HeKBUHzzMOdrTwkr0ptHOQn+tvTQg2CbUaxhFgUxs0bpqdRAWS+l5an0ZKRv28sTgRVUDDcdU/SR+CxH3ayG56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rgdm/NAAInoAXlm/Xrrrxi2TafPfXv1gCps3rvOP7n3Seq88UUk0FTKNM0hcmkWp/9AyOAMBWnuqFPWz3mcah3E8focBKurBhzVc54rWImhc7xEosYhgeDm36q8p9NEnCWZbn+dLMw1o6hOkEWDBY60RlXMx+UTHVnAc71FVpiSZNqpshDjAYfwOzJvoLn3HWcj03ZpD2K/LLvjw0TY9snR6SRUFgQhD/p3mN7SsZZFZPEIoVFu3iYFYvCU/KM0L6HJXVA9Jwt24xZVAVFebSUMv0lWsfGiC2VTUHaluiJc= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 20:eGtYi4JWyc1FwDWsYWV1Xrf5k8x5YJKlpfIlTdhB2CAdyapmod1KyvNXYAK1SFo2qjqbhz3L6AZPY1MUvSiuPHrzsiOxz1mPSjJn8G9bXRYMk69Rp+vMGUvboxnWMSd53Z40DmukpyErZQQNuZN4TUw5hlBSs8qRllz/LRCjoBC76aSEa9Z9GWT4wBvqaOepkbyjWrqF/wNzKVQnp42t6IG5n7/WAGJp4YPJwvPqaQSzWHAMfINh8hqldd/A0CwjDtb6iJapn1e+HRyIyCbXg9Q7fU98WHi+kykqUekeIgeeg7+2VJ1ntuLWzs31oUrcEioqlQP/2BJBRHh+C9VsXB4yUpKTN8WoqIDsIlYtMnvqLdGmvaI1Qlw4XBElp68SdPPeDLNkd7lzLwEN0KyORJS1LBlNqTq9Frxygj3E2lcg5PeyHYGNhJ69XFzwCCFZNYqyC9ZyXtNrmVZKj920DVdzDiAPEPZ4G/c3sByXy3uUEFl7X83uOou06TjMvXq2 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)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR12MB1148; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR12MB1148; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ4OzQ6am5sY1hpbG9wN2xnWFlrSm05bG9PdXFRZCtR?= =?utf-8?B?M3JoY2QySnNtMFlVZnNiWG82VVUxdGdvSldkelRWRll5STFlRU5NTWthQ0NQ?= =?utf-8?B?L3lVaEJISkZyOC8wTTlaZDYzcjhZb3REOHdDcVd6ZUsvbGNIbG5HOWt6Q2Ft?= =?utf-8?B?M0lmSXYzM28xQ3ZPL25qQWdtZGkvYnBFdzVpd0lqSW1pMkcvbnJuQjVJSHhV?= =?utf-8?B?bVF0UXM2TEhHNTdOSDV6eUIxQkZhaFZEMk0yTDZjdHFOLzVJaWhESUdqV3Rx?= =?utf-8?B?Lyt4TVZyZGJweVRTS3VzMFo4eFVMNlZOSGpLVU1tK0w2ekVMSVFtOTZKSzVC?= =?utf-8?B?b2NDcERhdThXMldUbzVVakxQdU1jQ0FVRjEvTWpOTWdMb1orMjVtVWxCWUli?= =?utf-8?B?V0t5UXYvelR5MzQ5bm9wL1k3OW5xVERwcTNPNTdGL0RBb3NLYjdXdW1uczhy?= =?utf-8?B?L3l3YXREU3pEVmRueXRwUGhIMlVmQ2FMamF5c2hrcEFXK3kxSWtWaE55UHBC?= =?utf-8?B?aWl2Rnc5c0l3aVBYNTIyR0ovbVBRb1NxZGVDOVYzdlpkNmMvRTcwL0tmUzM4?= =?utf-8?B?eGZrYlhrRVVBUWpBNjJBd2o5dE5VOHo5VXZySXhOKzFWRzRFVHowUGd3Z1JB?= =?utf-8?B?UWx2S05vWnVXdTlSYzQ5UnlOcFQwZDVzc3NVUk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NElIbjJ3R1lybVZsQVdzbi9TVTZJbUNVTXNYb1BrWFhZNGxpMUwwS3hj?= =?utf-8?Q?R145KSBeGrEuU0yu4o9?= X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39860400002)(39850400002)(39400400002)(39840400002)(39450400003)(53416004)(7416002)(7406005)(6666003)(33646002)(8676002)(478600001)(42186005)(25786009)(2950100002)(4001350100001)(81166006)(6116002)(3846002)(23676002)(83506001)(1076002)(189998001)(47776003)(72206003)(5660300001)(6506006)(2906002)(230700001)(305945005)(55016002)(7736002)(4326008)(9686003)(54906002)(110136004)(38730400002)(103116003)(50986999)(50466002)(54356999)(53936002)(575784001)(86362001)(66066001)(76176999)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1148; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ4OzIzOlliMmFjSmN4WjdDUHA2aUdUSk5tT1FodHZS?= =?utf-8?B?TndlMDFESE1kejROSGk5QUlwYXhCODNSeUZFNktIL2VTTHN5MFdGQnk1bm02?= =?utf-8?B?WjhXcXRLLzFlVm0zNDhCY2JTRVVkaEdMNFpBakNNbXVVcWxIZFhBczgxSzhs?= =?utf-8?B?RFp0QXZhbURpVWhKeE0wVXJBemE0bTl3S3FSZVBMSnB5ejE1Z3AzL25RcVpt?= =?utf-8?B?ODFDa3l2SW04ZCttWVRNRTdpbnhMY1FPVVVmcDhoaGMxb1BvWXBsY0J5bVY4?= =?utf-8?B?M0QvQmZZdk5zK2xyNmdpMzl1Z01UUlQ4eW9odjVrc0ZpTnFZQjhlZDlNRCtB?= =?utf-8?B?bkNLVjR4VVBpM2RYdmtZN3FpeEh3U2tQQ0UxenpEdTVHTVVNd3o5Nk9sSVRh?= =?utf-8?B?TWJoQUt6aW1tUElveG1MWHh2ZFl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rnLrpJ+hrbkoa3B9aLLiy7AeWVKlJTYmDz1nWi1kgWGjvECy3fw2ktvBC/zuMeKalzg8RxPRxmL+tvQyR2nDUxAPg/eEQohkdalAcFUdimMS6v4yX/5QWRiDHs5mRDaxDTmFlTKmO9TIIZnKIBE+zD3rJCIBbdYBXQkU4ymXg+oWvYgczqVKw+IJOclGumcBCDgcOE9zomKUSdlLazz8nq0JjgxR3kFkaY9vY6/noWk1VGa75TZ0Q5endiOm6TdrTDJa5WdwHqnUW+C1ZDcykuSjq0n4BE45i8PuyQLobpQBzMONDGzIwMDFt995TtPQf27cvX+asCXhEUMqvurvPviQ8yEdwFl/PbZ5mikbgiEmMW6OagbYEKOCfMuz+oMcebLedSMeoOSwg5GghMbX7eP/HWY/5RYg3v1XacJ0q6F7J91UgOaSRhSwWOWq6Nh7dApyF8smtlwlKDB0IhscVfuPuARcTukhFIvF+fS/fn9nl0eh2M= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 20:vUq1I8scflypOrKxR8Je7gWIkPvW1+yBeEM2XAdSJvCXSaoW2oJfodUPky+bB/WkBfMdPDzNYCjKPvnJI1D8wAu8rfkUGW1QAl8y6IqCUnVKxNIdf2In2/ExgBxEXWVNtIPa4rYwRnjiIKBqDI6zzAds7rASbnS27Dx0YpRJ5HsvFpLcnhrQlT+kWcjtK17BQgQ+pOL944V0yC4x1edPueYenpMKH6Sdjc/VBXoZI8ri44o2eUUkQuz5xjv2Cw4D X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 18:53:29.6092 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1148 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 19/36] x86/mm: Add support to access boot related data in the clear 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 Boot data (such as EFI related data) is not encrypted when the system is booted because UEFI/BIOS does not run with SME active. In order to access this data properly it needs to be mapped decrypted. Update early_memremap() to provide an arch specific routine to modify the pagetable protection attributes before they are applied to the new mapping. This is used to remove the encryption mask for boot related data. Update memremap() to provide an arch specific routine to determine if RAM remapping is allowed. RAM remapping will cause an encrypted mapping to be generated. By preventing RAM remapping, ioremap_cache() will be used instead, which will provide a decrypted mapping of the boot related data. Signed-off-by: Tom Lendacky Reviewed-by: Borislav Petkov Reviewed-by: Matt Fleming --- arch/x86/include/asm/io.h | 5 + arch/x86/mm/ioremap.c | 179 +++++++++++++++++++++++++++++++++++++++++++++ include/linux/io.h | 2 + kernel/memremap.c | 20 ++++- mm/early_ioremap.c | 18 ++++- 5 files changed, 217 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 7afb0e2..09c5557 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -381,4 +381,9 @@ extern int __must_check arch_phys_wc_add(unsigned long base, #define arch_io_reserve_memtype_wc arch_io_reserve_memtype_wc #endif +extern bool arch_memremap_can_ram_remap(resource_size_t offset, + unsigned long size, + unsigned long flags); +#define arch_memremap_can_ram_remap arch_memremap_can_ram_remap + #endif /* _ASM_X86_IO_H */ diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 4feda83..f3fa007 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -22,6 +23,7 @@ #include #include #include +#include #include "physaddr.h" @@ -422,6 +424,183 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr) iounmap((void __iomem *)((unsigned long)addr & PAGE_MASK)); } +/* + * Examine the physical address to determine if it is an area of memory + * that should be mapped decrypted. If the memory is not part of the + * kernel usable area it was accessed and created decrypted, so these + * areas should be mapped decrypted. + */ +static bool memremap_should_map_decrypted(resource_size_t phys_addr, + unsigned long size) +{ + /* Check if the address is outside kernel usable area */ + switch (e820__get_entry_type(phys_addr, phys_addr + size - 1)) { + case E820_TYPE_RESERVED: + case E820_TYPE_ACPI: + case E820_TYPE_NVS: + case E820_TYPE_UNUSABLE: + return true; + default: + break; + } + + return false; +} + +/* + * Examine the physical address to determine if it is EFI data. Check + * it against the boot params structure and EFI tables and memory types. + */ +static bool memremap_is_efi_data(resource_size_t phys_addr, + unsigned long size) +{ + u64 paddr; + + /* Check if the address is part of EFI boot/runtime data */ + if (!efi_enabled(EFI_BOOT)) + return false; + + paddr = boot_params.efi_info.efi_memmap_hi; + paddr <<= 32; + paddr |= boot_params.efi_info.efi_memmap; + if (phys_addr == paddr) + return true; + + paddr = boot_params.efi_info.efi_systab_hi; + paddr <<= 32; + paddr |= boot_params.efi_info.efi_systab; + if (phys_addr == paddr) + return true; + + if (efi_is_table_address(phys_addr)) + return true; + + switch (efi_mem_type(phys_addr)) { + case EFI_BOOT_SERVICES_DATA: + case EFI_RUNTIME_SERVICES_DATA: + return true; + default: + break; + } + + return false; +} + +/* + * Examine the physical address to determine if it is boot data by checking + * it against the boot params setup_data chain. + */ +static bool memremap_is_setup_data(resource_size_t phys_addr, + unsigned long size) +{ + struct setup_data *data; + u64 paddr, paddr_next; + + paddr = boot_params.hdr.setup_data; + while (paddr) { + unsigned int len; + + if (phys_addr == paddr) + return true; + + data = memremap(paddr, sizeof(*data), + MEMREMAP_WB | MEMREMAP_DEC); + + paddr_next = data->next; + len = data->len; + + memunmap(data); + + if ((phys_addr > paddr) && (phys_addr < (paddr + len))) + return true; + + paddr = paddr_next; + } + + return false; +} + +/* + * Examine the physical address to determine if it is boot data by checking + * it against the boot params setup_data chain (early boot version). + */ +static bool __init early_memremap_is_setup_data(resource_size_t phys_addr, + unsigned long size) +{ + struct setup_data *data; + u64 paddr, paddr_next; + + paddr = boot_params.hdr.setup_data; + while (paddr) { + unsigned int len; + + if (phys_addr == paddr) + return true; + + data = early_memremap_decrypted(paddr, sizeof(*data)); + + paddr_next = data->next; + len = data->len; + + early_memunmap(data, sizeof(*data)); + + if ((phys_addr > paddr) && (phys_addr < (paddr + len))) + return true; + + paddr = paddr_next; + } + + return false; +} + +/* + * Architecture function to determine if RAM remap is allowed. By default, a + * RAM remap will map the data as encrypted. Determine if a RAM remap should + * not be done so that the data will be mapped decrypted. + */ +bool arch_memremap_can_ram_remap(resource_size_t phys_addr, unsigned long size, + unsigned long flags) +{ + if (!sme_active()) + return true; + + if (flags & MEMREMAP_ENC) + return true; + + if (flags & MEMREMAP_DEC) + return false; + + if (memremap_is_setup_data(phys_addr, size) || + memremap_is_efi_data(phys_addr, size) || + memremap_should_map_decrypted(phys_addr, size)) + return false; + + return true; +} + +/* + * Architecture override of __weak function to adjust the protection attributes + * used when remapping memory. By default, early_memremap() will map the data + * as encrypted. Determine if an encrypted mapping should not be done and set + * the appropriate protection attributes. + */ +pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr, + unsigned long size, + pgprot_t prot) +{ + if (!sme_active()) + return prot; + + if (early_memremap_is_setup_data(phys_addr, size) || + memremap_is_efi_data(phys_addr, size) || + memremap_should_map_decrypted(phys_addr, size)) + prot = pgprot_decrypted(prot); + else + prot = pgprot_encrypted(prot); + + return prot; +} + #ifdef CONFIG_ARCH_USE_MEMREMAP_PROT /* Remap memory with encryption */ void __init *early_memremap_encrypted(resource_size_t phys_addr, diff --git a/include/linux/io.h b/include/linux/io.h index 2195d9e..32e30e8 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -157,6 +157,8 @@ enum { MEMREMAP_WB = 1 << 0, MEMREMAP_WT = 1 << 1, MEMREMAP_WC = 1 << 2, + MEMREMAP_ENC = 1 << 3, + MEMREMAP_DEC = 1 << 4, }; void *memremap(resource_size_t offset, size_t size, unsigned long flags); diff --git a/kernel/memremap.c b/kernel/memremap.c index 23a6483..9b4fbd5 100644 --- a/kernel/memremap.c +++ b/kernel/memremap.c @@ -34,13 +34,24 @@ static void *arch_memremap_wb(resource_size_t offset, unsigned long size) } #endif -static void *try_ram_remap(resource_size_t offset, size_t size) +#ifndef arch_memremap_can_ram_remap +static bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size, + unsigned long flags) +{ + return true; +} +#endif + +static void *try_ram_remap(resource_size_t offset, size_t size, + unsigned long flags) { unsigned long pfn = PHYS_PFN(offset); /* In the simple case just return the existing linear address */ - if (pfn_valid(pfn) && !PageHighMem(pfn_to_page(pfn))) + if (pfn_valid(pfn) && !PageHighMem(pfn_to_page(pfn)) && + arch_memremap_can_ram_remap(offset, size, flags)) return __va(offset); + return NULL; /* fallback to arch_memremap_wb */ } @@ -48,7 +59,8 @@ static void *try_ram_remap(resource_size_t offset, size_t size) * memremap() - remap an iomem_resource as cacheable memory * @offset: iomem resource start address * @size: size of remap - * @flags: any of MEMREMAP_WB, MEMREMAP_WT and MEMREMAP_WC + * @flags: any of MEMREMAP_WB, MEMREMAP_WT, MEMREMAP_WC, + * MEMREMAP_ENC, MEMREMAP_DEC * * memremap() is "ioremap" for cases where it is known that the resource * being mapped does not have i/o side effects and the __iomem @@ -95,7 +107,7 @@ void *memremap(resource_size_t offset, size_t size, unsigned long flags) * the requested range is potentially in System RAM. */ if (is_ram == REGION_INTERSECTS) - addr = try_ram_remap(offset, size); + addr = try_ram_remap(offset, size, flags); if (!addr) addr = arch_memremap_wb(offset, size); } diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c index d7d30da..b1dd4a9 100644 --- a/mm/early_ioremap.c +++ b/mm/early_ioremap.c @@ -30,6 +30,13 @@ static int __init early_ioremap_debug_setup(char *str) static int after_paging_init __initdata; +pgprot_t __init __weak early_memremap_pgprot_adjust(resource_size_t phys_addr, + unsigned long size, + pgprot_t prot) +{ + return prot; +} + void __init __weak early_ioremap_shutdown(void) { } @@ -215,14 +222,19 @@ void __init early_iounmap(void __iomem *addr, unsigned long size) void __init * early_memremap(resource_size_t phys_addr, unsigned long size) { - return (__force void *)__early_ioremap(phys_addr, size, - FIXMAP_PAGE_NORMAL); + pgprot_t prot = early_memremap_pgprot_adjust(phys_addr, size, + FIXMAP_PAGE_NORMAL); + + return (__force void *)__early_ioremap(phys_addr, size, prot); } #ifdef FIXMAP_PAGE_RO void __init * early_memremap_ro(resource_size_t phys_addr, unsigned long size) { - return (__force void *)__early_ioremap(phys_addr, size, FIXMAP_PAGE_RO); + pgprot_t prot = early_memremap_pgprot_adjust(phys_addr, size, + FIXMAP_PAGE_RO); + + return (__force void *)__early_ioremap(phys_addr, size, prot); } #endif