Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752585AbdFGTRM (ORCPT ); Wed, 7 Jun 2017 15:17:12 -0400 Received: from mail-sn1nam02on0088.outbound.protection.outlook.com ([104.47.36.88]:57984 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752343AbdFGTRE (ORCPT ); Wed, 7 Jun 2017 15:17:04 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=amd.com; From: Tom Lendacky Subject: [PATCH v6 21/34] x86/mm: Add support to access persistent memory in the clear 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, linux-mm@kvack.org, iommu@lists.linux-foundation.org Cc: Rik van Riel , Radim =?utf-8?b?S3LEjW3DocWZ?= , Toshimitsu Kani , Arnd Bergmann , Jonathan Corbet , Matt Fleming , "Michael S. Tsirkin" , Joerg Roedel , Konrad Rzeszutek Wilk , Paolo Bonzini , Larry Woodman , Brijesh Singh , Ingo Molnar , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Dave Young , Thomas Gleixner , Dmitry Vyukov Date: Wed, 07 Jun 2017 14:16:51 -0500 Message-ID: <20170607191651.28645.70995.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170607191309.28645.15241.stgit@tlendack-t1.amdoffice.net> References: <20170607191309.28645.15241.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR16CA0040.namprd16.prod.outlook.com (10.172.42.154) To CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR12MB1141: X-MS-Office365-Filtering-Correlation-Id: 0b1f46c8-cd9a-4abb-ecc3-08d4add9c268 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:kUICFa5BvmTEcbPKEzsPfrnyKGo1QHdf17ojlFd4QJQfkmOH/aNgyZYIfQuAm6RXKr+PgiC6c0M2bE/dptIBIre00qaMgE5cJ8QiRFZc5M6cwz8EN1KZ695WrIDusxydCJW0X56i/R9oMiZfaflGacRvkWyjCjxG0wQQV5u+knURAdOr6VQA8u2LWSpfut1iDAl0psWa9fBeGVlGfZvsogPSjFEUImJgHpbya2MqVB6eIqKe7B4osTVCkEaMV3peZ0mODO2G5crSqTifuX51CoVSGpRMmR4QoZWlo5tRF1j59AVwFWOFaIuUvHoyC79RSwYo6/p/xEvhy+Q4FIsL89I84SEu6JEEZ/LC3QqD3Wo=;25:NZbSKVaFtCu37bsIUJJqvrwRQvdMWdQ9LiB9xZt6tt8qA6YybFAkNMNqOntmcqIk7M5LPOAGdBnofngcX/cg8K0uE07YEu0w8holYEdbvuWZPlue2inFKDHj2XUqssK47NRgqBYItuCeXJlHT+FKmNt/mUix1tq3qemL41GJgJJdveBT0toFj7amkbdxNZm5Pt5MV6ZlwUjE4DglqP/5Xb/YPLs9ypaJGnp/CN9ys6yWL6sdamoO63c9mU5kRe4NesHXBfsMCI/TSzAT0dJZMNS3+9pAX4HUWsjfDzNqJfb+udEIkllhGcH3PtHhWdZuUPXYRlV/toEO78ogpGeropBBF+1cYsRPtE2egJJWIQ78e5fxLbgsvridrqf+qxFjkDlT0ZfQoxGHf/6RoSXRIIR+I0QK6LS+jw0gFcp9j2MlKf3gne7jfS3WsYZxHoHayO9VfMDa9ote7L20CfRqDblubVSq1bcekPQXtZMgBgQ= X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;31:NgJofml2z/itnFyFdft5Vfk2TpCvB935GidRMdJN9e3xPpt/CeG9bmN8p/5Pr1UZ7GljTUK5L+h+U7sNGCgMMfnGLK3QQIQWhPu0AMW/S3/mYAieI12iOHGppwN0pGk999zNRz8xfpIdQKLcgd/PtbH6gowMuZQtVvlx/ZKGypvuYbf2qsvGiBahpam+I5RMmEUcTkLvFSQT0l6kePGl/Svf9Nw84UJyEr4dp3EPcyA=;20:PorGqs2vZCqeuuBvjly6AF01VdjJ2shlEoO35s0JgNnJY6TCFT3qH77bzoF/fUcWg0HNGLbTZFW3ZkbTS9ZmLACZaFw1ADPiNkMd/Lsp7dONejCR7rxLdwE6VMhF17UHJyPzmlmcZ+niFRywhEah70ha10t8X5GgZfIgJ2kVtulnLTclTTe+W3w4Gh29wtqAXgTtqA+kRLlCpk+3AX6e53Jc/szhYCCIqkR95na+Rq6U795RGgilIQLIfU0si313tWkjNWyFWqfC4Gy/ysy6rRv0uDL0LAQaOw6Mu8DwVRkqzh4cyTddwgN9ZIrvDHYqrn5+dk+607Gzc6CxqI0pXUUuHxAzZ5uZkQFA1LnEhGFqwevH1yQuGSua2Gq7Hh9OTHGG6t0fsgKrwMJXh/Vsiay+jXdnKOz/6YNcBEP7/S8AWz+mQXl2uhcUg61100gj/KVprQEhlUo4cyDR2ulmqKRZA/SBiJdS2Rs7G/0D9SP6BOgr03htQpRIyOlmGSvp 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)(20161123555025)(20161123558100)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(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?MTtDWTRQUjEyTUIxMTQxOzQ6bFlES0lIUEhqM0xBN2lFL01mS3cxallvTTk3?= =?utf-8?B?TWVVc1JlWDlsREpTaUM1N1ljcklaY3ZoaWFOTW9oYTBRSTd0aDhlOHcrcEVt?= =?utf-8?B?Njdha1VIaE9sbHFCaTFVUlQ0bXJSVy9lTDVOdXc2LzdGRHJ6b0YvNCs4V2du?= =?utf-8?B?OGd1emdGalpiUmIyK2doRlR1OGtpTVhUUGFva0F0VVFySXJpTldzUklxZ2l5?= =?utf-8?B?OWFkQ3BJZ0tkenEyeEdVWEUzUDZPZ2VRa3dSc1RZclFCQm1Zb2gyRTRTTWYw?= =?utf-8?B?TEdFcFBDcVlMck5keHR4TzducVpNR3h0VW9XcU1uSUdoTm9VSmpqWkY0RkJS?= =?utf-8?B?akQrbDA1dStPQzk3b1Fnb1F6VEtPZGtXdWxXS1dpN0xvWTA2Y2pmTE1vb2xh?= =?utf-8?B?MVVMVEd1WEE5TVNPVmJXeml1T1RKVzZ4azdCZjlVbElXTEVvbG5yQ1JObnpP?= =?utf-8?B?UjRINCsxZFg4dVIrTE1FU2ZNdVplYnNvSThkdTc5L1FoWk1HRDEyVG45ZVRk?= =?utf-8?B?R2o1T2RxM0FjR2RBRGxuSVRWMlA4QnNSeXhCWkhPVE9oY1RveXp4SDVNVFIv?= =?utf-8?B?SGVNZXg0SHJTSG16MDQ2TkdtTGVqT0tlRTg3S1BaQndWa3J1Y29jbmdSV2h2?= =?utf-8?B?b3Rwc3BYTnRLY29GemdwM3dhT3JTdG9odnMzeWxKYzYyVGtIeGFXVXpQQmdj?= =?utf-8?B?alNxQStBdE5OdVpSUUQ3b0RUR2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q?OFw3dzlEqK07i3Oyt7p?= X-Forefront-PRVS: 03319F6FEF X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39450400003)(39840400002)(39860400002)(39410400002)(39850400002)(39400400002)(9686003)(54906002)(55016002)(6506006)(66066001)(4326008)(47776003)(110136004)(103116003)(25786009)(38730400002)(72206003)(478600001)(83506001)(305945005)(7736002)(86362001)(76176999)(50466002)(53936002)(54356999)(97746001)(7416002)(7406005)(23676002)(1076002)(6116002)(33646002)(3846002)(50986999)(230700001)(53416004)(42186005)(5660300001)(4001350100001)(8676002)(81166006)(2906002)(2950100002)(189998001)(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?MTtDWTRQUjEyTUIxMTQxOzIzOm5aQmpQQ2UyL1NkRUhXdnhsZTFlNmZidEl0?= =?utf-8?B?VnFZWW5tVmFiMDR0ZVpKZDh3bEhXQ3A1aXZ6K2YweVlOWXdVczBibW42UHRX?= =?utf-8?B?b3lITHN4WElRb3Y2L1lGWG9IQmt4NTJkVG5VYlExNE5GN0dGM3NEeUUrYzdL?= =?utf-8?B?ZFdFZGprUE5QdlkwaWppUThrV2lyVjFjMTIvcm5HL1VqTXJuaVhtOFZDTnJ5?= =?utf-8?B?VTZZY1hIV3pMRk11dGtNTnU2MXkrK0c4VmFkdGRLWFpDQVp5QVFsVnNZUHQv?= =?utf-8?B?ZzRrbFQ2a01ZdkxTSlJSSnU1N2xaUVZCZGtaSUp6UGl3czBpMlNDa09mVjgy?= =?utf-8?B?NzY3b29aendXazlWaXJyZzZncGE2elZINko5c2YvNXNLUUtWT3BkVExsNm9v?= =?utf-8?B?eGVsOWxXYjAwRUh5UDBPcHRzNHEvUWFydmJnK2NaUDhYcXpOK1VLdG5LNGJs?= =?utf-8?B?VmNYbndpbTlwVEUxTktKZVhQanlm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wgEmlnPaNE2h+xKqOJWgoQ/D+LTyNpDqS0qclaMObz4Wj3JH41oecfsz0upshaRQVLh645AgAaYdK4Bos3O5MNOW7s02h4yOJTpKnYhA3CMN2/qJMfUltbNaU20jhj/fg3VoFT3zIxY/Bpmqx X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2017 19:16:53.5059 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1141 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2099 Lines: 63 Persistent memory is expected to persist across reboots. The encryption key used by SME will change across reboots which will result in corrupted persistent memory. Persistent memory is handed out by block devices through memory remapping functions, so be sure not to map this memory as encrypted. Signed-off-by: Tom Lendacky --- arch/x86/mm/ioremap.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 34ed59d..99cda55 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -428,17 +428,46 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr) * 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. + * areas should be mapped decrypted. And since the encryption key can + * change across reboots, persistent memory should also be mapped + * decrypted. */ static bool memremap_should_map_decrypted(resource_size_t phys_addr, unsigned long size) { + int is_pmem; + + /* + * Check if the address is part of a persistent memory region. + * This check covers areas added by E820, EFI and ACPI. + */ + is_pmem = region_intersects(phys_addr, size, IORESOURCE_MEM, + IORES_DESC_PERSISTENT_MEMORY); + if (is_pmem != REGION_DISJOINT) + return true; + + /* + * Check if the non-volatile attribute is set for an EFI + * reserved area. + */ + if (efi_enabled(EFI_BOOT)) { + switch (efi_mem_type(phys_addr)) { + case EFI_RESERVED_TYPE: + if (efi_mem_attributes(phys_addr) & EFI_MEMORY_NV) + return true; + break; + default: + break; + } + } + /* 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: + case E820_TYPE_PRAM: return true; default: break;