From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757550AbcBXTdV (ORCPT ); Wed, 24 Feb 2016 14:33:21 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:34197 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756439AbcBXTdS (ORCPT ); Wed, 24 Feb 2016 14:33:18 -0500 Date: Wed, 24 Feb 2016 19:33:15 +0000 From: Matt Fleming To: Andy Lutomirski Cc: Borislav Petkov , Sai Praneeth Prakhya , "Ravi V. Shankar" , Toshi Kani , Brian Gerst , Thomas Gleixner , Ingo Molnar , Linus Torvalds , Luis Rodriguez , Andrew Morton , Denys Vlasenko , "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , Peter Zijlstra , ricardo.neri@intel.com, Hugh Dickins , Ard Biesheuvel Subject: Re: [tip:efi/core] x86/mm/pat: Use _PAGE_GLOBAL bit for EFI page table mappings Message-ID: <20160224193315.GD2603@codeblueprint.co.uk> References: <1455712566-16727-4-git-send-email-matt@codeblueprint.co.uk> <1456275002.2781.41.camel@intel.com> <20160224141046.GA2603@codeblueprint.co.uk> <20160224162002.GE3888@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 24 Feb, at 08:36:33AM, Andy Lutomirski wrote: > On Wed, Feb 24, 2016 at 8:20 AM, Borislav Petkov wrote: > > On Wed, Feb 24, 2016 at 02:10:46PM +0000, Matt Fleming wrote: > >> > Normally, the only pages with are _PAGE_GLOBAL are those that are in > >> > the normal kernel mappings (swapper_pg_dir and normal mm_struct pgds). > >> > By allowing _PAGE_GLOBAL to be set in EFI mappings, you're breaking > >> > that convention, which forces you to use extra-expensive > >> > __flush_tlb_all calls in efi_call_virt. > > > > Hold on, do you mean the __flush_tlb_all() in the CONFIG_EFI_MIXED code? > > > > That's mixed mode. I think you mean the FLUSH_TLB_ALL in efi_call. > > That's EFI on 64-bit but that is mandated by the spec, AFAIR. > > I mean the one in efi_call_virt. Why would the spec mandate a TLB > flush at all? EFI runtime services have no business touching the > paging structures directly. Heck, the 32-bit ones don't even know the > *format* of the paging structures. Right, and it would necessitate copying out arguments because the firmware won't understand where/how the kernel has mapped things. No firmware is going to be doing that.