From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757521AbcBXTpG (ORCPT ); Wed, 24 Feb 2016 14:45:06 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:36791 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754407AbcBXTpE (ORCPT ); Wed, 24 Feb 2016 14:45:04 -0500 Date: Wed, 24 Feb 2016 19:45:01 +0000 From: Matt Fleming To: Linus Torvalds Cc: Andy Lutomirski , Borislav Petkov , Sai Praneeth Prakhya , "Ravi V. Shankar" , Toshi Kani , Brian Gerst , Thomas Gleixner , Ingo Molnar , Luis Rodriguez , Andrew Morton , Denys Vlasenko , "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , Peter Zijlstra , ricardo.neri@intel.com, Hugh Dickins , Ard Biesheuvel , Sylvain Chouleur Subject: Re: [tip:efi/core] x86/mm/pat: Use _PAGE_GLOBAL bit for EFI page table mappings Message-ID: <20160224194501.GE2603@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 10:56:13AM, Linus Torvalds wrote: > On Wed, Feb 24, 2016 at 8:36 AM, Andy Lutomirski wrote: > >> > >> So the EFI runtime crap should not change once it is mapped. And those > >> should be global. It is only natural. > > > > Why is it natural? > > > > Long-term, I'd rather see EFI runtime services use an actual mm_struct > > and use_mm. > > Definitely. > > The EFI runtime page mapping may be unchanging, but that doesn't mean > we should be mapping it all the time - the mapping may not change, but > we will change away from it. There is movement towards hanging the EFI memory map off of mm_struct for x86. ARM and arm64 already do this and there were some patches from Sylvain (Cc'd) to do this for the purposes of having a task context that could be preempted while in the middle of an EFI runtime call for some Intel platforms, https://lkml.kernel.org/r/1452702762-27216-4-git-send-email-sylvain.chouleur@gmail.com Apart from the code simplification and not being required to open-code the %cr3 diddling, are there other benefits of mm_struct and use_mm() that make it appealing in the non-preemptible case? Not that those aren't reasons enough. > So marking those pages global is very wrong. Ingo, Andy, how do you want to handle this patch? Maybe just drop it from tip/efi/core while we prod around making all the EFI mappings non-global? Nothing else depends on it, it can be dropped without any harm.