From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751284AbeCIHkl (ORCPT ); Fri, 9 Mar 2018 02:40:41 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36837 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750909AbeCIHkj (ORCPT ); Fri, 9 Mar 2018 02:40:39 -0500 X-Google-Smtp-Source: AG47ELunOvo78PBdnNN9Va5HEA70pyz9QQMLZSPf0i4Ww5xzg5+HyulwBb8Lb+EwyWvvGCSoXdZcsQ== Date: Fri, 9 Mar 2018 08:40:34 +0100 From: Ingo Molnar To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, Thomas Gleixner , Sai Praneeth , linux-kernel@vger.kernel.org, "Lee, Chun-Yi" , Borislav Petkov , Tony Luck , Andy Lutomirski , "Michael S . Tsirkin" , Ricardo Neri , Ravi Shankar Subject: Re: [PATCH 07/12] efi: Use efi_mm in x86 as well as ARM Message-ID: <20180309074034.put3ko6zxmaoizzr@gmail.com> References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> <20180308080020.22828-8-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180308080020.22828-8-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Ard Biesheuvel wrote: > From: Sai Praneeth > > Presently, only ARM uses mm_struct to manage efi page tables and efi > runtime region mappings. As this is the preferred approach, let's make > this data structure common across architectures. Specially, for x86, > using this data structure improves code maintainability and readability. > diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h > index 85f6ccb80b91..00f977ddd718 100644 > --- a/arch/x86/include/asm/efi.h > +++ b/arch/x86/include/asm/efi.h > @@ -2,10 +2,14 @@ > #ifndef _ASM_X86_EFI_H > #define _ASM_X86_EFI_H > > +#include > +#include > + > #include > #include > #include > #include > +#include > > /* > * We map the EFI regions needed for runtime services non-contiguously, > diff --git a/include/linux/efi.h b/include/linux/efi.h > index f5083aa72eae..f1b7d68ac460 100644 > --- a/include/linux/efi.h > +++ b/include/linux/efi.h > @@ -966,6 +966,8 @@ extern struct efi { > unsigned long flags; > } efi; > > +extern struct mm_struct efi_mm; > + > static inline int > efi_guidcmp (efi_guid_t left, efi_guid_t right) > { Ugh, I can see three problems with this patch: 1) Why is the low level asm/efi.h header polluted with two of the biggest header files in existence, to add a type to _another_ header (efi.h)? 2) Why is included if what is being relied on is mm_struct? 3) But even looks unnecessary in efi.h, a simple forward declaration of mm_struct would do ... The high level MM and sched headers should be added to the actual .c files that make use of them. Thanks, Ingo