From patchwork Tue Jun 27 15:10:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9812431 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 7B5A260351 for ; Tue, 27 Jun 2017 15:13:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0709C283B0 for ; Tue, 27 Jun 2017 15:13:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED71E286C3; Tue, 27 Jun 2017 15:13:22 +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 1C278283B0 for ; Tue, 27 Jun 2017 15:13:21 +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 1dPs8t-0001Hj-GN; Tue, 27 Jun 2017 15:11:03 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPs8s-0001Gi-EO for xen-devel@lists.xen.org; Tue, 27 Jun 2017 15:11:02 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id 32/C0-02181-58572595; Tue, 27 Jun 2017 15:11:01 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjk+JIrShJLcpLzFFi42LJ0Fc1120pDYo 0OH1c22LJx8UsDoweR3f/ZgpgjGLNzEvKr0hgzTj+9S1jwTL/iqU7DBoYO526GLk4WARamCWO XGljBnEYBSYzSqy9PgnMERJoZZL4dqePqYuRk4NNQEfi2tsvYLawQJzEmemfmUFsEYEFTBKPp gmANDALvGWT2HfuDBtIgklARmLBoqVgRSwCqhL9N86yg9i8Ah4SL9r3gNmcAp4S86deAxsqBB Q/83MvWFxUQE5i5eUWVoh6QYmTM5+wdDFyAC3QlFi/Sx8kzCwgL7H97Ryw8RICChLbv39nA7l BQqCdUaJt8hpGiJkqErM+X2CHKJKVOHp2DguE7SvR+m8zO8hMCQFliVMtfhC9B5kkTm18ClV/ lk1i4mFHCFtLYvmJflaIokfsEq93TmaBclglzk76zgjhbGORWDx3GtRNORLn94LcB7KiVqJlV wZEzRlWie4nR5ggnOeCErPn7mWdwKg7C8mrsxBenYXk1QWMzKsYNYpTi8pSi3SNLPSSijLTM0 pyEzNzdA0NjPVyU4uLE9NTcxKTivWS83M3MQITRT0DA+MOxvYTfocYJTmYlER5V0sERQrxJeW nVGYkFmfEF5XmpBYfYlTn4BBYdLQpWIolLz8vVUmCt60EqEywKDU9tSItMweYyGAqJTh4lER4 rxUApXmLCxJzizPTIVKnGBWlxHnNQPoEQBIZpXlwbbDkeYlRVkqYl5GBgUGIpyC1KDezBFX+F aM4B6OSMO/CYqApPJl5JXDTXwEtZgJazDIvAGRxSSJCSqqBUdNBbmtc+Jyip3f7vKe4t1jXRk Yd8bENXDpHbPld7tt9fxhif4t01krHb6gyWC6gtaL4+bKVj+cEBlQLC8XseunqtyjgphzvdJO 7qxZ+P5c91Sq5j/HFz5Sptwo1nrjWLDKfrSD7QGDFX72Vy06EO74MnsH2ynDS78idxXr3W+Zd EpH/3rzwhBJLcUaioRZzUXEiAHGc0smZAwAA X-Env-Sender: Thomas.Lendacky@amd.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1498576259!69067938!1 X-Originating-IP: [104.47.37.55] 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 64648 invoked from network); 27 Jun 2017 15:11:00 -0000 Received: from mail-cys01nam02on0055.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) (104.47.37.55) by server-6.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 27 Jun 2017 15:11:00 -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=lOftDB4tF6SJMhLNPyx3QO2r1WpGTX2FEZtOUJFvfNjLTYZ5zcu04hHzY041ag6bRNmU/j9aZDvKylvloGyI2boPYHNmgn8/p9QV7Z7h14YYWcwV/OYUVDCpWQtU6Altpbt/3p0WXQZWQvEAs8t2kZeVgEtAB1t7Z5X2Fp66l0Y= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by MWHPR12MB1149.namprd12.prod.outlook.com (10.169.204.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Tue, 27 Jun 2017 15:10:51 +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 10:10:48 -0500 Message-ID: <20170627151048.17428.56847.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170627150718.17428.81813.stgit@tlendack-t1.amdoffice.net> References: <20170627150718.17428.81813.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: BN6PR03CA0019.namprd03.prod.outlook.com (10.168.230.157) To MWHPR12MB1149.namprd12.prod.outlook.com (10.169.204.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5e5687be-b362-4804-60e2-08d4bd6eb597 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:MWHPR12MB1149; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1149; 3:YmV66Sbg0m0iioGMid71qX+OZvHxYmsJMenZ/Grs2GXruyJy9tcM3fDWjCsd4GJM9rTwIGBqZQcx9EekAy85Ed25C5YzixSPOc3GJ+qIWaebHuLYX2yxHGGKEXrnlYJteFqfEHRKivHUgInaOU/pu0CItPetY01zR9amCj1xuHwYWtNCBbjx+56jsM31vAfpMwsHljHhBeUhFzBp/2OH/S3LhmEJ1hYhILWW8FQ+AUbTKhrH+AQEw7XziCQVJovHcHO8beSdjd1AdVTQ3jnL6Aw/BB+kG47ySk8IP1Ed68J+xF9pyUO0EWBKqSd1mz55ylNGqwk+AYwFFGgM1xu4kZO+OCuz0734AfHiof/iu72+ObfIpRKZc8104rAAiPiD/kQktsIV5pmVk/0NDVGZhOkh/GNyRAblzi2CPKsVXG9SFskg/8VZg4pVuz5V0FMQjJQGS6VzErJkdom3HstZZSeg7zv/uOI+ESxnxY6vpdOBZ1BF2Na7XiMYbkNEqgS6916w9dm/cknfxtWIwOugqJIvjgSyCjaSMv8ciaQquWYd1TVDfn78FY3sVoL9jcliwxVdEI3MaBxWNgT6jC0MauEI6H9kAF82Wr8Qcnaqbgj4syftETUXJIzmBGw2WRwgMAl2ZK/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HhwPbDUKdMREQk6RKfuA1oxfDEJqjQ4HcWasPl/B5tnI0jseCogbuiSNtVKa6TyFfIkKM8RmRm8r5fHug/t3kTNY10Ud+mBUMz+QpyVxAXndCodot84e1/20IIxxT/qyeYBeL8rx7CHl8LOW02K3V2vPuQlajbPnzwsIiBOonXqNCRkSE56867Ah+HQAVhgiNzCko4VwSAqZN3GcUCsRZqLAK+Om1bW0iD2QcchD9SlGStsFo+oqZLrpg/AwWMUV+y2jvHQ2SboqMM 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)(5005006)(8121501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(20161123558100)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR12MB1149; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR12MB1149; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMTQ5OzQ6OWcvbFYxSkRjZHd6TkQvUGs0ejhzU3R5T1Jl?= =?utf-8?B?aUFWbHhGZ1NLU3pudE1IZDVqcEZodXZseXR5UFpHR2Z3emdhTzArTEp6cVFo?= =?utf-8?B?ZW95d3ZWWDhIZzlBWElRZzcyWTN4MzZLakNHWm5JSjJQbE8wTGJvaURWZVNz?= =?utf-8?B?am1qRkg0TnkxZ3FOa1JTQUZ4REwybG9oNkxxS1IraVI1cHZ3dkFPbnl6YnBQ?= =?utf-8?B?TzBMc2gzeDhhSlpmQ0Q5bndSdFF1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ZHaWNnWkhuQzBab2Q3Y2dTYmF3c1lEd01rWGd4RVpVbG9q?= =?utf-8?B?VE81QmdMdmU2aERzaVZJWG9pNXQ5NlJhd3dPVDdSSUgrdGJCQUduWDBEbWt6?= =?utf-8?B?MFI4TUZuYnJ2b21oYkRGc0c2Ky9zRmpESEZ2TFQ1cGVMVGdzSUpxOEIwS1Az?= =?utf-8?B?cm95RTVoR3lRcnZmV3ZlQW0ySlBwYmo0U2dud1lYTTJnQmR6RlRnUmxpZURk?= =?utf-8?B?TXJ6ZG03dkYzMnFBN3M4MVdSbURyVU1TRTlxL2VJZTBGMG1ZU3MwYUUvazZs?= =?utf-8?B?LzlVeHlVaUV0ZUt1d3BabTlJVks2MitxeXhRNS9zNUNGN2ljMjFtRW5MRDBk?= =?utf-8?B?Z091VHFiU3Z6dVEyVWlDaEVncG1jLzlwV0xHSHFaVHZCVE93VXpXdmgwdlJH?= =?utf-8?B?cGE5bDM4eW9jc3YvazR3TlJhcm9qc3JsNlRhYVpkK2l4ajNWTEFabVRwVjcz?= =?utf-8?B?UUtDVVZ4L1lxYVM5aklOOGlPNzRLVllZNnRJZiswQjFmZjk2dlZGYVkyK3Ew?= =?utf-8?B?ZWdzYnVTcVRoMC9OL091TkhmVGVIdG5DMGg4dUZUTnRxb25OTllML3JrU2Rz?= =?utf-8?B?emxtNnVCR3hqRWdnRVE1YkxnMDhaeE5kWjUxZDZ5WFVFRG0ydnJDUUV6TUZB?= =?utf-8?Q?S7bTiylsihpU?= X-Forefront-PRVS: 0351D213B3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39860400002)(39850400002)(39400400002)(39410400002)(39840400002)(39450400003)(97746001)(7736002)(230700001)(25786009)(103116003)(1076002)(83506001)(8676002)(81166006)(110136004)(575784001)(86362001)(53936002)(189998001)(50986999)(54356999)(76176999)(6116002)(4001350100001)(38730400002)(3846002)(305945005)(2950100002)(6666003)(2906002)(33646002)(54906002)(55016002)(66066001)(42186005)(7416002)(7406005)(47776003)(50466002)(6506006)(53416004)(23676002)(478600001)(5660300001)(72206003)(9686003)(4326008)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1149; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMTQ5OzIzOmFoQUFVQUlGbnVSVjNURFc5WmhtenhMVE84?= =?utf-8?B?b0tCU2NLdGZ6cC9YNEdHaVdZOXJ0S0gyQ25YeE9tNDVRRVlhdThDalJTSzNZ?= =?utf-8?B?TWplcjNvYURvSmFUUmNWajlnQVhSMTU1MnFEcC9SNjk2N0RtdVFoZlhOVjNJ?= =?utf-8?B?VXdjRWRyOS9iWFEraGZJWGF1VEs5Ynd4TXBDVDlNOWxUSjRXRXNEeUk2eDlz?= =?utf-8?B?SVNEZ1R0cjdPTUpvcU9xQ2JTUDl3Z1pMTGR0OU1EWVpTNkYrODdaL0htUXNR?= =?utf-8?B?b3Rxa055R3MxT3ZDVEF5ZmEzTVdic1FOc1Y5aGVFcVV1Y1NjaEFDOXdMa2hR?= =?utf-8?B?bXNkMTRFT1VMaWxjL2g4VXFQMm5MS042cCtjVXE4NW1ZQVUrTTlWQlNGejND?= =?utf-8?B?NVlsM25tWG1KSC9rNEQzT2VSdURhaDFCWitmL2l2YlJsQjF5eDNlQk1mdHBm?= =?utf-8?B?N0VwRkFRNHYxenZpNiszRVFCV0ZQN2ZQWm01MDRiVEdSRVd0NHpQRm53WTFr?= =?utf-8?B?b1VGYzliT2dPb2ZtWkxkclpSUXB1L2N5bnhORkcrcjZKYTAxS3hLVlU2WUlH?= =?utf-8?B?anFJYXBQV3RuY0VzU04xZU85Rk91UUp2V1Rhb1JzeDMzMjh3UURsTHUzZERR?= =?utf-8?B?Vk9ZQ2FPTE5WVGRhVG1RWkRaclg4YWMrdE44MUlGcFlLUExQNExJaXlLR2ZS?= =?utf-8?B?MVdHcDVZR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Yu9lVoqMPiKOzevxnSrRCLsqP19Ol1l5VB30nTygq9zjq2t6NXIlQPYx7yChVXPw1cp+gSVTA6eE9LhE/QdP8rKnlIqBMrw8b3zzlTpkvFaa7oiFCvz0pNaraaJvxuFcYalDhwZ1H0rAP/ynCl5hEXG86EsAcBmUCmDrDkeuxDga4MpMLeEzvV5fIfISlVTNmiARsPmu6OlQ= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1149; 20:jwWtWRm78wi+vdDKAc3jbnczMYnLvmyPU4wW0onrmcgI7GvruxHUl04APt3L3K1X+cZAmKmiLPN0DvGLuT5qjV/F0Gu1rjE0WVCV85Bojrg2y4NVk8UHG+EJbT+avv2MhvDmZHor4jTVmp+xHVF77BlZ3MNjSgSOfHLcMPt3dIwp4f0OWMqlERvPXeQQRPjEoZb5pmxDVovKuREa2KGe2QQ82sXjjF/kDadREtq7NPS2RSF02a4G4FFcmu6aYUm3 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2017 15:10:51.5547 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1149 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 RESEND 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