From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sai Praneeth Prakhya Subject: Re: [PATCH] x86/efi: Add EFI_PGT_DUMP support for x86_32, kexec and efi=old_map Date: Thu, 11 May 2017 11:44:17 -0700 Message-ID: <1494528257.8845.11.camel@intel.com> References: <1494456545-26300-1-git-send-email-sai.praneeth.prakhya@intel.com> <20170511111828.pu2i3pn6lyiukgaf@pd.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170511111828.pu2i3pn6lyiukgaf-fF5Pk5pvG8Y@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Borislav Petkov Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Ricardo Neri , Matt Fleming , Ard Biesheuvel , Ravi Shankar List-Id: linux-efi@vger.kernel.org On Thu, 2017-05-11 at 13:18 +0200, Borislav Petkov wrote: > On Wed, May 10, 2017 at 03:49:05PM -0700, Sai Praneeth Prakhya wrote: > > From: Sai Praneeth > > > > EFI_PGT_DUMP, as the name suggests dumps efi page tables to dmesg during > > kernel boot. This feature is very useful while debugging page > > faults/null pointer dereferences to efi related addresses. Presently, > > this feature is limited only to x86_64, so let's extend it to other efi > > configurations like kexec kernel, efi=old_map and to x86_32 as well. > > This doesn't effect normal boot path because this config option should > > be used only for debug purposes. > > > > Signed-off-by: Sai Praneeth Prakhya > > Cc: Borislav Petkov > > Cc: Ricardo Neri > > Cc: Matt Fleming > > Cc: Ard Biesheuvel > > Cc: Ravi Shankar > > --- > > arch/x86/platform/efi/efi.c | 2 ++ > > arch/x86/platform/efi/efi_32.c | 9 ++++++++- > > arch/x86/platform/efi/efi_64.c | 5 ++++- > > 3 files changed, 14 insertions(+), 2 deletions(-) > > > > diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c > > index 217dc166c649..a6d6cd8fe78a 100644 > > --- a/arch/x86/platform/efi/efi.c > > +++ b/arch/x86/platform/efi/efi.c > > @@ -890,6 +890,8 @@ static void __init kexec_enter_virtual_mode(void) > > if (efi_enabled(EFI_OLD_MEMMAP) && (__supported_pte_mask & _PAGE_NX)) > > runtime_code_page_mkexec(); > > > > + efi_dump_pagetable(); > > You can call that only once at the end of efi_enter_virtual_mode() > instead of adding it here and leaving it in __efi_enter_virtual_mode(). > Thanks for the suggestion Boris, Sure! will roll out v2 with this change Regards, Sai From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934217AbdEKSrc (ORCPT ); Thu, 11 May 2017 14:47:32 -0400 Received: from mga02.intel.com ([134.134.136.20]:41571 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755537AbdEKSra (ORCPT ); Thu, 11 May 2017 14:47:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,325,1491289200"; d="scan'208";a="1146753295" Message-ID: <1494528257.8845.11.camel@intel.com> Subject: Re: [PATCH] x86/efi: Add EFI_PGT_DUMP support for x86_32, kexec and efi=old_map From: Sai Praneeth Prakhya To: Borislav Petkov Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri , Matt Fleming , Ard Biesheuvel , Ravi Shankar Date: Thu, 11 May 2017 11:44:17 -0700 In-Reply-To: <20170511111828.pu2i3pn6lyiukgaf@pd.tnic> References: <1494456545-26300-1-git-send-email-sai.praneeth.prakhya@intel.com> <20170511111828.pu2i3pn6lyiukgaf@pd.tnic> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-05-11 at 13:18 +0200, Borislav Petkov wrote: > On Wed, May 10, 2017 at 03:49:05PM -0700, Sai Praneeth Prakhya wrote: > > From: Sai Praneeth > > > > EFI_PGT_DUMP, as the name suggests dumps efi page tables to dmesg during > > kernel boot. This feature is very useful while debugging page > > faults/null pointer dereferences to efi related addresses. Presently, > > this feature is limited only to x86_64, so let's extend it to other efi > > configurations like kexec kernel, efi=old_map and to x86_32 as well. > > This doesn't effect normal boot path because this config option should > > be used only for debug purposes. > > > > Signed-off-by: Sai Praneeth Prakhya > > Cc: Borislav Petkov > > Cc: Ricardo Neri > > Cc: Matt Fleming > > Cc: Ard Biesheuvel > > Cc: Ravi Shankar > > --- > > arch/x86/platform/efi/efi.c | 2 ++ > > arch/x86/platform/efi/efi_32.c | 9 ++++++++- > > arch/x86/platform/efi/efi_64.c | 5 ++++- > > 3 files changed, 14 insertions(+), 2 deletions(-) > > > > diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c > > index 217dc166c649..a6d6cd8fe78a 100644 > > --- a/arch/x86/platform/efi/efi.c > > +++ b/arch/x86/platform/efi/efi.c > > @@ -890,6 +890,8 @@ static void __init kexec_enter_virtual_mode(void) > > if (efi_enabled(EFI_OLD_MEMMAP) && (__supported_pte_mask & _PAGE_NX)) > > runtime_code_page_mkexec(); > > > > + efi_dump_pagetable(); > > You can call that only once at the end of efi_enter_virtual_mode() > instead of adding it here and leaving it in __efi_enter_virtual_mode(). > Thanks for the suggestion Boris, Sure! will roll out v2 with this change Regards, Sai