From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kees Cook Subject: Re: [PATCH v4 15/75] x86/boot/compressed/64: Always switch to own page-table Date: Tue, 14 Jul 2020 18:23:47 -0700 Message-ID: <202007141823.326D9DC102@keescook> References: <20200714120917.11253-1-joro@8bytes.org> <20200714120917.11253-16-joro@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200714120917.11253-16-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org To: Joerg Roedel Cc: x86@kernel.org, Joerg Roedel , hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Sean Christopherson , Martin Radev , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org List-Id: virtualization@lists.linuxfoundation.org On Tue, Jul 14, 2020 at 02:08:17PM +0200, Joerg Roedel wrote: > From: Joerg Roedel > > When booted through startup_64 the kernel keeps running on the EFI > page-table until the KASLR code sets up its own page-table. Without > KASLR the pre-decompression boot code never switches off the EFI > page-table. Change that by unconditionally switching to a kernel > controlled page-table after relocation. > > This makes sure we can make changes to the mapping when necessary, for > example map pages unencrypted in SEV and SEV-ES guests. > > Also remove the debug_putstr() calls in initialize_identity_maps() > because the function now runs before console_init() is called. > > Signed-off-by: Joerg Roedel Reviewed-by: Kees Cook -- Kees Cook