From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [PATCH] x86/efi: Don't unmap EFI boot services code/data regions for EFI_OLD_MEMMAP and EFI_MIXED_MODE Date: Tue, 25 Dec 2018 10:51:07 +0100 Message-ID: <20181225095107.GA100072@gmail.com> References: <20181222022234.7573-1-sai.praneeth.prakhya@intel.com> <20181222105410.GA130780@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: "Prakhya, Sai Praneeth" Cc: Ard Biesheuvel , linux-efi , Linux Kernel Mailing List , the arch/x86 maintainers , Borislav Petkov , Andy Lutomirski , "Hansen, Dave" , Bhupesh Sharma , Peter Zijlstra , Thomas Gleixner List-Id: linux-efi@vger.kernel.org * Prakhya, Sai Praneeth wrote: > > > > + /* > > > > + * To Do: Remove this check after adding functionality to unmap EFI > > boot > > > > + * services code/data regions from direct mapping area because > > > > + * "efi=old_map" maps EFI regions in swapper_pg_dir. > > > > + */ > > > > + if (efi_enabled(EFI_OLD_MEMMAP)) > > > > + return; > > > > + > > > > + /* > > > > + * EFI mixed mode has all RAM mapped to access arguments while > > making > > > > + * EFI runtime calls, hence don't unmap EFI boot services code/data > > > > + * regions. > > > > + */ > > > > + if (!efi_is_native() && IS_ENABLED(CONFIG_EFI_MIXED)) > > > > AFAIK efi_is_native() can only return false is CONFIG_EFI_MIXED is set, so this > > expression can be simplified. > > Makes sense. > efi_is_native() returns true for 32-bit machines running 32-bit firmware. Forgot to mention that I performed this simplification in the commit I applied: + /* + * To Do: Remove this check after adding functionality to unmap EFI boot + * services code/data regions from direct mapping area because + * "efi=old_map" maps EFI regions in swapper_pg_dir. + */ + if (efi_enabled(EFI_OLD_MEMMAP)) + return; + + /* + * EFI mixed mode has all RAM mapped to access arguments while making + * EFI runtime calls, hence don't unmap EFI boot services code/data + * regions. + */ + if (!efi_is_native()) + return; Thanks, Ingo