Received: by 10.223.185.111 with SMTP id b44csp8616wrg; Thu, 8 Mar 2018 23:41:51 -0800 (PST) X-Google-Smtp-Source: AG47ELvf3r80QVIBCXS2c20J+mBwXz3zJlHE6QeZ7p0ymu5eWk09ZNjtWzQ+dpy1oh1WkxsXUDYi X-Received: by 10.101.101.10 with SMTP id x10mr23834743pgv.223.1520581311474; Thu, 08 Mar 2018 23:41:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520581311; cv=none; d=google.com; s=arc-20160816; b=oMogsD7yjWGnh4NlnGa4jW46DC4Gu/7DdDSXFeX8nU59G/yswNEs6bFSSFQtVl0Z4g aDoimmGgXzizyxPuHKnSeH6M0N7hIZJRiuk79/8kjhRmrDn0bKcRcysqqfkqQpxhTdds PhZ28vMbaf9vpCeb1kdGefN21+tnQTdvrStoHWX7zKW47nUA5gzj388p4oRdBVfeDanc dJ1AsIDrI+o6gNB8Q52Zved3DjoaT+WnNDKEzuvEPYW9mwpK/4bgXdXzAp+fz0PbEO6n gtehX40zXEPoTv8HVdV8b5idzcSKZ0jhZIWO3JCMpDw5M6QleursMgeWSk3lYhgYzlPn vj6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=KvHaz7YT8hokapK4iHgDtjylmZxZPogrwFp+lzW6wW8=; b=gCie2Mlazw2XuxxjGIg3PIo0666b8LiMIuQs4CIi/1KSrhSoc9Z7WVqtUcfO0H9tcz wpYDLgfeTRVim8jyEWDAeocfVH2haaHkvjGLecbId+O31eWbm5Q/EjQ0eA3SRYp27C5d BYPCWSXWFi3ekZO3GA1uk1eyZmgUjl3fgYhLlE64CWkFyZTd9AB98h74UT0P6NSZCLcb Fz7ulqHg0x+OePsTGEDnuD/VW7Uo1bOOJUkRd5VSEBR31vka33qWzam2EGs8gs8qNt04 HAopKHJRuNtfNRKqgi6xPTKMGH+ByozKbkNVY+sqgHtvLndA1GPS5ic49kptt+EI7/qt fOsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GhiMla6S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si345529pgt.680.2018.03.08.23.41.35; Thu, 08 Mar 2018 23:41:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GhiMla6S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751271AbeCIHkl (ORCPT + 99 others); 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 Received: by mail-wr0-f194.google.com with SMTP id v111so8062918wrb.3; Thu, 08 Mar 2018 23:40:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KvHaz7YT8hokapK4iHgDtjylmZxZPogrwFp+lzW6wW8=; b=GhiMla6SgQASNqJQ/xX8ZKJcjAKYANYZQuU/plCMZHtH478W8suqDzyW0sYqlG0uHT zu2X9+2uyyA5nTab6l7pEClwr4rE6Cp3Fzg7dLzjrc4Q1VVJybu+1dv2GNSG1mz+1YHR nYT3Ife4rcYIt9Oz7C7pS3D480YEKpUUSVU6MAptNfhCnYqaeADEABOi4Ti8yqRZwFXu 5jLyibdKX6zPwz76tmr/Yi7UoHtWNlTY412As9QTzvP0xL9fHw9HyzYtEKUtOwAuYHHo Rg3exXtUkp0zIza6owk4t++u+3pXB9q6Qp6hKGaJ+eS8Pqk7BcADK1h1LuXVaKra2fr1 hzzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=KvHaz7YT8hokapK4iHgDtjylmZxZPogrwFp+lzW6wW8=; b=AddIDP/0Xp2QrHaA2tnrwazN27oBvIHBmYuCnHKqkqbtLlPUUoOghU6uhP7xhhOQoy 1FgVBZujM4hPGSdvftAZI8iDw/7fXa+Oa1RD1JlHMuWhflv+a+CwdTs4r3EBgXtQst/D h1KbxHIAV73+2wY2kz2eDK/nv9tZTinoSouwyVXeoEY7OX+ANWrWuwOCXL6ZgTKOKFun F6qa6brseRV4rUfL8b8B7XHkGPopvgXXCYKqbqbKwlQaRCkoM1jywBLT5Kqez1bUbF7W qEOxAfm+4r+S1yJTGKPRuIblFlVx9xoCltwMXixVLV+98T1IP988zHOoYKFgm2Ahas2n 2Hcw== X-Gm-Message-State: APf1xPC89MAEfTfOvEXwb+2Uyk3cudFpuLtLfSheohPm6pbO6Xycoo9g GpcXNKR5YXMjvwIHMDF3d2M= X-Received: by 10.223.209.68 with SMTP id b4mr24960197wri.161.1520581237914; Thu, 08 Mar 2018 23:40:37 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id w16sm400240wrc.26.2018.03.08.23.40.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Mar 2018 23:40:36 -0800 (PST) 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 Precedence: bulk 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