From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Fleming Subject: Re: [PATCH v7 19/36] x86/mm: Add support to access boot related data in the clear Date: Thu, 22 Jun 2017 12:04:05 +0100 Message-ID: <20170622110405.GC3129@codeblueprint.co.uk> References: <20170616184947.18967.84890.stgit@tlendack-t1.amdoffice.net> <20170616185326.18967.43278.stgit@tlendack-t1.amdoffice.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20170616185326.18967.43278.stgit@tlendack-t1.amdoffice.net> Sender: owner-linux-mm@kvack.org To: Tom Lendacky Cc: 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, Brijesh Singh , Toshimitsu Kani , Radim =?utf-8?B?S3LEjW3DocWZ?= , Alexander Potapenko , "H. Peter Anvin" , Larry Woodman , Jonathan Corbet , Joerg Roedel , "Michael S. Tsirkin" , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Konrad Rzeszutek Wilk , Borislav Petkov List-Id: linux-arch.vger.kernel.org On Fri, 16 Jun, at 01:53:26PM, Tom Lendacky wrote: > 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 > --- > 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(-) Reviewed-by: Matt Fleming -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f182.google.com ([209.85.128.182]:33685 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752993AbdFVLEN (ORCPT ); Thu, 22 Jun 2017 07:04:13 -0400 Received: by mail-wr0-f182.google.com with SMTP id r103so18494932wrb.0 for ; Thu, 22 Jun 2017 04:04:13 -0700 (PDT) Date: Thu, 22 Jun 2017 12:04:05 +0100 From: Matt Fleming Subject: Re: [PATCH v7 19/36] x86/mm: Add support to access boot related data in the clear Message-ID: <20170622110405.GC3129@codeblueprint.co.uk> References: <20170616184947.18967.84890.stgit@tlendack-t1.amdoffice.net> <20170616185326.18967.43278.stgit@tlendack-t1.amdoffice.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170616185326.18967.43278.stgit@tlendack-t1.amdoffice.net> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Tom Lendacky Cc: 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, Brijesh Singh , Toshimitsu Kani , Radim =?utf-8?B?S3LEjW3DocWZ?= , Alexander Potapenko , "H. Peter Anvin" , Larry Woodman , Jonathan Corbet , Joerg Roedel , "Michael S. Tsirkin" , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Konrad Rzeszutek Wilk , Borislav Petkov , Andy Lutomirski , Boris Ostrovsky , Dmitry Vyukov , Juergen Gross , Thomas Gleixner , Paolo Bonzini Message-ID: <20170622110405.YgG_BjTts_nQ5A2rg82Gqen0i5IkdGkJuxO4Pa5W204@z> On Fri, 16 Jun, at 01:53:26PM, Tom Lendacky wrote: > 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 > --- > 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(-) Reviewed-by: Matt Fleming