From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755318AbeAMRMz (ORCPT + 1 other); Sat, 13 Jan 2018 12:12:55 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50020 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755102AbeAMRMy (ORCPT ); Sat, 13 Jan 2018 12:12:54 -0500 Date: Sat, 13 Jan 2018 18:12:53 +0100 From: Greg KH To: Pavel Tatashin Cc: steven.sistare@oracle.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, jkosina@suse.cz, hughd@google.com, dave.hansen@linux.intel.com, luto@kernel.org, torvalds@linux-foundation.org Subject: Re: [PATCH 4.9] x86/pti/efi: broken conversion from efi to kernel page table Message-ID: <20180113171253.GA6797@kroah.com> References: <20180111215820.29736-1-pasha.tatashin@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180111215820.29736-1-pasha.tatashin@oracle.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, Jan 11, 2018 at 04:58:20PM -0500, Pavel Tatashin wrote: > The page table order must be increased for EFI table in order to avoid a > bug where NMI tries to change the page table to kernel page table, while > efi page table is active. > > For more disccussion about this bug, see this thread: > http://lkml.iu.edu/hypermail/linux/kernel/1801.1/00951.html > > Signed-off-by: Pavel Tatashin > Reviewed-by: Steven Sistare > Acked-by: Jiri Kosina > --- > arch/x86/include/asm/pgalloc.h | 11 +++++++++++ > arch/x86/platform/efi/efi_64.c | 2 +- > 2 files changed, 12 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h > index b6d425999f99..1178a51b77f3 100644 > --- a/arch/x86/include/asm/pgalloc.h > +++ b/arch/x86/include/asm/pgalloc.h > @@ -27,6 +27,17 @@ static inline void paravirt_release_pud(unsigned long pfn) {} > */ > extern gfp_t __userpte_alloc_gfp; > > +#ifdef CONFIG_PAGE_TABLE_ISOLATION > +/* > + * Instead of one PGD, we acquire two PGDs. Being order-1, it is > + * both 8k in size and 8k-aligned. That lets us just flip bit 12 > + * in a pointer to swap between the two 4k halves. > + */ > +#define PGD_ALLOCATION_ORDER 1 > +#else > +#define PGD_ALLOCATION_ORDER 0 > +#endif This conflicts with the definition of PGD_ALLOCATION_ORDER in arch/x86/mm/pgtable.c that says: /* * Instead of one pgd, Kaiser acquires two pgds. Being order-1, it is * both 8k in size and 8k-aligned. That lets us just flip bit 12 * in a pointer to swap between the two 4k halves. */ #define PGD_ALLOCATION_ORDER kaiser_enabled So, which is it? I'm going to go drop this from the 4.9 stable queue because of this. thanks, greg k-h