From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-sn1nam02on0066.outbound.protection.outlook.com ([104.47.36.66] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dNLwB-0008CH-Mi for kexec@lists.infradead.org; Tue, 20 Jun 2017 16:23:33 +0000 Subject: Re: [PATCH v7 11/36] x86/mm: Add SME support for read_cr3_pa() References: <20170616184947.18967.84890.stgit@tlendack-t1.amdoffice.net> <20170616185154.18967.71073.stgit@tlendack-t1.amdoffice.net> From: Tom Lendacky Message-ID: <9a1c0df8-ca12-eebc-5565-ced847989169@amd.com> Date: Tue, 20 Jun 2017 11:23:03 -0500 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Andy Lutomirski Cc: "linux-efi@vger.kernel.org" , Brijesh Singh , Toshimitsu Kani , "linux-doc@vger.kernel.org" , Matt Fleming , X86 ML , "linux-mm@kvack.org" , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Alexander Potapenko , "H. Peter Anvin" , Larry Woodman , linux-arch , kvm list , Jonathan Corbet , Joerg Roedel , "Michael S. Tsirkin" , kasan-dev , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Konrad Rzeszutek Wilk , Borislav Petkov , Boris Ostrovsky , Dmitry Vyukov , Juergen Gross , kexec@lists.infradead.org, "linux-kernel@vger.kernel.org" , xen-devel , iommu@lists.linux-foundation.org, Thomas Gleixner , Paolo Bonzini On 6/20/2017 11:17 AM, Andy Lutomirski wrote: > On Fri, Jun 16, 2017 at 11:51 AM, Tom Lendacky wrote: >> The cr3 register entry can contain the SME encryption mask that indicates >> the PGD is encrypted. The encryption mask should not be used when >> creating a virtual address from the cr3 register, so remove the SME >> encryption mask in the read_cr3_pa() function. >> >> During early boot SME will need to use a native version of read_cr3_pa(), >> so create native_read_cr3_pa(). >> >> Signed-off-by: Tom Lendacky >> --- >> arch/x86/include/asm/processor-flags.h | 3 ++- >> arch/x86/include/asm/processor.h | 5 +++++ >> 2 files changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/arch/x86/include/asm/processor-flags.h b/arch/x86/include/asm/processor-flags.h >> index 79aa2f9..cb6999c 100644 >> --- a/arch/x86/include/asm/processor-flags.h >> +++ b/arch/x86/include/asm/processor-flags.h >> @@ -2,6 +2,7 @@ >> #define _ASM_X86_PROCESSOR_FLAGS_H >> >> #include >> +#include >> >> #ifdef CONFIG_VM86 >> #define X86_VM_MASK X86_EFLAGS_VM >> @@ -33,7 +34,7 @@ >> */ >> #ifdef CONFIG_X86_64 >> /* Mask off the address space ID bits. */ >> -#define CR3_ADDR_MASK 0x7FFFFFFFFFFFF000ull >> +#define CR3_ADDR_MASK __sme_clr(0x7FFFFFFFFFFFF000ull) > > Can you update the comment one line above, too? Yup, will do. Thanks, Tom > _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec