From patchwork Tue Jun 27 14:59:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9812237 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 AF30E60351 for ; Tue, 27 Jun 2017 15:02:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EBFA27F97 for ; Tue, 27 Jun 2017 15:02:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61EAF28111; Tue, 27 Jun 2017 15:02:45 +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 9023B27F97 for ; Tue, 27 Jun 2017 15:02:44 +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 1dPry2-0004KF-TS; Tue, 27 Jun 2017 14:59:50 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPry1-0004IL-2N for xen-devel@lists.xen.org; Tue, 27 Jun 2017 14:59:49 +0000 Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id 75/39-10689-4E272595; Tue, 27 Jun 2017 14:59:48 +0000 X-Brightmail-Tracker: H4sIAAAAA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com!1498575585!106923390!1 X-Originating-IP: [104.47.34.46] 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 35086 invoked from network); 27 Jun 2017 14:59:47 -0000 Received: from mail-by2nam01on0046.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) (104.47.34.46) by server-10.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 27 Jun 2017 14:59:47 -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=3y2ISV2syykMD8glIMRivrac+B66hvfB+oDUUVp7Q9U=; b=ZBeeGeseHDae9/qQKPx7geXzouhIk+aoBZf3tCfyHJjkWIgRpOdkTb1LBL1eEG8xsmV14BQTykZQ70IUN2pJDGANoLxY82GspydVt7bwO/9WXvHWfh4W8r8pqeu3PGzfLSQ7o2ACqkVVD/tebcUko7bIBz6n87wFBy+W9nSMHVQ= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by MWHPR12MB1150.namprd12.prod.outlook.com (10.169.204.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15; Tue, 27 Jun 2017 14:59:38 +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: Tue, 27 Jun 2017 09:59:35 -0500 Message-ID: <20170627145935.15908.91473.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170627145607.15908.26571.stgit@tlendack-t1.amdoffice.net> References: <20170627145607.15908.26571.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: BN6PR03CA0038.namprd03.prod.outlook.com (10.175.124.24) To MWHPR12MB1150.namprd12.prod.outlook.com (10.169.204.14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9323f4e1-6a15-4583-8bb5-08d4bd6d24cb X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506067)(300135500095); SRVR:MWHPR12MB1150; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1150; 3:GDNxecst1WVRaZzmpqYfgssekzy+hgL5ZHoRUeSPnmLPZ5Nl4X4nhgVE4YXKvwwL+gNU+wE0dC8ojrDxoeZgsQlFXyuetImPqJjN5rkCr4Q/tKgyT2zHWfv7tE+gNeIm8toXF5YFOjQADOuY9/axTPY78XJamP5Be5RNiCv4AKgxuI52kIKtxUdqF0QSNRETBruw/MOzS6PJz6NsXxGFttsxcKoxXLv9EqVNmCaZqT0M0rrSgzf8THLKYwid6YX+0Rw15TrN8bUs7v+RrFkINTQiqnBwYKO2Wfu855kcg3qkRg4Rarm6gekwYyKcRGeiijYtt9cKnJO7GByOGgP7RD04A/7RsmYJft8Ry+D/n9yGgXYKb7BGIoi24vkDz4ObK8kVMjAcv1pBSnz+ICfi6h3taprcFSJisuV5wanAhu2uZ9KT+cCUPSGhMgEks+28t9KSiaCZos79CA2VjuTsZgGV+HaPjHmpci7L4AuGFXOiHl+HhIP2qGudYRXYEUlT62skMjlOW+e3JCPVUIRKCshalga/tjNf9oMe2f76WTvVlhAwXiJz1Y5cqGK784fgE+M0kuVfjzHtAvNoy+S5X2zlL5ZZMUT9Ypj1WGQWWDUQ+0ia+beJPBXQBUQd8ASx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lvfWfr+1p8iBZMMqOm94/uor4YkFVCj6tWa1byK645lMcuDkDOBTHniQf2GjrKS7j7ZCaH0yun3+FZ/0cXJx1Twej9NvUyeLl6YXRb3RylS62FVUaKtRbJBjTgPkibscVH3FypzrB9qtfT7CPqFvWtHu/JCijZ8S/sFYqVrtgt5vry2lyRwNG24zByf1gQAP4nlKv3gUZoymBljOXuxEO/aqLBAcbNBJo1PznvYuCWmie4DdQPGLrKpFDSYUNKde6+p X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(236129657087228)(767451399110)(148574349560750)(167848164394848); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR12MB1150; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR12MB1150; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMTUwOzQ6R2tVTzZQVm13RC9scXEweFBXaVYvZGlTayty?= =?utf-8?B?Y2ZyMVpGYXpYVWNyV09rUVNlQTRzNGhydjEySUZJK3NoSUJjZVpCY0QxZ2tr?= =?utf-8?B?LzBVQzZoQjY4K1p4UjFqNk50M2hsUnVLTC9ZMjgwRUJGZWFEeTNkRmgwM0Ez?= =?utf-8?B?ZkFqay9EQmlYUldRMldWYmRLY2ZpMXRzRUpjRVdXcTMzOFExVm5nbzl1TmRm?= =?utf-8?B?Y1ZJa1FpdmQ3bEdjOFNkclJaVjA4bFIyYWFjTitvclNjd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FCeTVnR3p3ODBsU1dQ?= =?utf-8?B?ak41NHdXQyszYkNIdHZrVUNnQjNSZXpIRTFuQ1RjNWU1bUV0RUZvRDdVL042?= =?utf-8?B?bjFaTjg3WGQxMld3Q2ZYS3ovanJiVGRnQUpYVFJZVUdJeXBwU2tGMHprNlVw?= =?utf-8?B?RUlKR0NRUGJaNkdROXlDdUVEa201d2JMS3ZZR2xhWmIzMXhvWDl3THo1WjI2?= =?utf-8?B?ZWlvZWNxem1qR2EreVltNko5ZEt1bGVkaEgybVJpQmdoZUJNVEx4eStPcmpv?= =?utf-8?B?NzJzMG9hdWw0d0NPMVRBT0ZETk9WWk53VFlIdkc0V0VFQzh4UElSWCtqNjlq?= =?utf-8?B?OFFhNWUxT2RxTGFaRkExOUVKb3dxVTBsNk5FejFpMlhEeUdjYlNRNG1rYnVv?= =?utf-8?B?cE45RGlacXFGVHBKUk8xTTBiY2hLMnZLT0NOVWF2T2tqVlhvRVFNRUZyMzJZ?= =?utf-8?B?dXZoS2UzSWZ3UHVzaGZPSUlmUUtMM1JEU0NycUJ4TFdSUVk4R0NmV2FCRTBr?= =?utf-8?B?bHc2MERyMnpKWmhEbXlVcUkyRkdiZ0xVWG82b0V3V2JwdlU5R1cwOUd3eFZ6?= =?utf-8?B?TStwZEdKVWNEcEtrZXFjTWQ5VWtCMENnVnU1STNKWVBUTmw2ZTN5UW1HamJF?= =?utf-8?Q?wgw7oAUvzknW?= X-Forefront-PRVS: 0351D213B3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39850400002)(39400400002)(39840400002)(39450400003)(39860400002)(39410400002)(54356999)(25786009)(76176999)(47776003)(72206003)(478600001)(66066001)(23676002)(2906002)(3846002)(1076002)(6116002)(230700001)(50466002)(53416004)(50986999)(33646002)(97746001)(86362001)(54906002)(55016002)(6666003)(6506006)(103116003)(42186005)(4001350100001)(110136004)(2950100002)(189998001)(575784001)(38730400002)(7736002)(9686003)(83506001)(5660300001)(7416002)(81166006)(53936002)(4326008)(8676002)(7406005)(305945005)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1150; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMTUwOzIzOm5MUmQ0dVhVZnBnWnRpL2RDSldlN3BLY0FW?= =?utf-8?B?aXUvL1BnSndJUXJYZko4WjZIQnNqVU1XZlN1MVMzM0p5STdBNWFJSzFkNGwz?= =?utf-8?B?dkVVLzJsTnN5bmxuQWdvVkhwZ2Z0cUt3cGNrRG9IWUhxREduNE5Sdm00Uk5W?= =?utf-8?B?Z0VkQ0ZQbmYvaW1WUjZvMzdVczkxRFhJdkZGQ1plZVZWWkNWeDRUNkF0UnRi?= =?utf-8?B?Z0xYd2pqS2ZQWmUxajltY0NmUjNPVU9EV1BxVms0SHdKblp1NUl2TmJuWDQ5?= =?utf-8?B?aFZKQWpkTml3clRQaStMeW9WMmFGdTYyS2tETVNGUWRzQWU2NVg4TkN0VHpF?= =?utf-8?B?ZDJVNjdvckoxL2JETWNwb25sUFMzMTJyRkx3Z3dkQ0h5UmdnV09kUDB1QUhL?= =?utf-8?B?WXdPK1c0M3orMjZ4OWROcTZmRE1Oanl6SWsxdDlXbEJ5STgyZC9IV2NMUVJP?= =?utf-8?B?MEZBYlIxc2FWUHYxWHpzRVVFUDBROXd2bWZrbmx6Q00xSGV2bDBYeFR0MVJ3?= =?utf-8?B?dHdROGNnWUEwVFdrcjRpcHdaMkZvaDM5bDRjaEp5ZWNDTFlUcmZRb3BnTEQ3?= =?utf-8?B?QllJcjQzaHpqM1Q4VWthMmtQTGllYUtKckhEaHlMUGVPRjMxNUdEMFpORHdW?= =?utf-8?B?VlQ5R0FxelEvN2FjVEptV20ySUFnNTNISFdEYTZnQ3ZkdmlVSkZqMWtuZ256?= =?utf-8?B?QUJ2K3IvZDFZeTc3S2I1Y01HRkw1VC9SRHBxN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tKrFBIx7HP7nuCrq4LEVzDWTkun+BbTQSWRWkjcR+oAFgMS8WwjN4ySC6AEsruKBBDi2z76Lu53eH/hkuXpX4h3/3+hIBQmsjjJK9rpVh2ofTSxIw/qm4Gye1PvESp0iMImuyKFcvLwefPIxIcyL/KikQkWAw/kRoiPLOy+iztEOB2bOb5yJIkfftB4Gf/5P6Eqw8= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1150; 20:7tyz3BgIgwpR/+DnblCchnmC6D/lGqBEjMRXy6Sncq5X6T9NVvXGJsXKYgp6XhmBS8cn42AFKdVWrwpYpotDNnyC0svzJYMJo6XzPbmBHrdZo7Vc/VeVwyhzHo3jui+zrm0x0rNzxSuNoZbCBKx7Wi+o+XvGzS6+8FeMlfFgotgb24SFScfXAo+1fqISUDbITnKULExOYv2ynaJNCpSDk/jr4aYPe4lJOneaDRYvgPwvGBRSf9dVpbx5F3BwknF8 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2017 14:59:38.8267 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1150 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 v8 19/38] 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. Reviewed-by: Matt Fleming Reviewed-by: Borislav Petkov Signed-off-by: Tom Lendacky --- 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 26db273..ee33838 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" @@ -414,6 +416,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