Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752195AbcD1M5W (ORCPT ); Thu, 28 Apr 2016 08:57:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:57221 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751912AbcD1M5U (ORCPT ); Thu, 28 Apr 2016 08:57:20 -0400 Date: Thu, 28 Apr 2016 14:57:11 +0200 From: Borislav Petkov To: Alex Thorlton Cc: linux-kernel@vger.kernel.org, Matt Fleming , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-efi@vger.kernel.org, Russ Anderson , Dimitri Sivanich , mike travis , Nathan Zimmer Subject: Re: [BUG] x86/efi: MMRs no longer properly mapped after switch to isolated page table Message-ID: <20160428125711.GB9164@pd.tnic> References: <20160427154132.GB113599@stormcage.americas.sgi.com> <20160427225122.GG21282@pd.tnic> <20160428014128.GF113599@stormcage.americas.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160428014128.GF113599@stormcage.americas.sgi.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2354 Lines: 68 On Wed, Apr 27, 2016 at 08:41:28PM -0500, Alex Thorlton wrote: > In this particular instance, it's not using the EFI page table - it's > showing that the register isn't mapped into the main kernel page table, > via the bad paging request. The issue isn't that there's something > wrong with the EFI page table, but that something appears to be missing > from the kernel table. So my question stands: you said 67a9108ed4313 is causing this and this commit creates an EFI-specific page table and that shouldn't have anything to do with how the MMR stuff is mapped, should it? > Well, quite a while back, these MMRs got mapped in using > init_extra_mapping_uc in map_low_mmrs. Back then, yes, they were mapped > straight into the kernel page table. > > After d2f7cbe7b26a74 ("x86/efi: Runtime services virtual mapping") was > introduced (I'm sure you remember the BIOS issue we had a while back) we > had to fall back to using EFI_OLD_MEMMAP, so for a while we relied on > efi_ioremap. Hmm, but you see my confusion, right? Why is init_extra_mapping_uc() influenced by the EFI changes? It uses __init_extra_mapping() and it maps into init_mm's pgd. > Eventually we got a BIOS fix that allowed us to start using the new > memmap scheme, at which point we removed the init_extra_mapping_uc()s, > since the efi_map_region code appeared to be doing what we needed. Why would you even do that? Why are you even mapping MMRs using EFI facilities? I'm more confused today. So what I see from here is this: * MMRs and EFI shouldn't have anything in common. Imagine there were an UV box without EFI (you probably are going to say there's no such thing but imagine anyway): how are you going to map the MMR space then? * I think you should restore the old case where you mapped the MMRs using init_extra_mapping_uc(). And I think d394f2d9d8e1 ("x86/platform/UV: Remove EFI memmap quirk for UV2+") was wrong in doing + if (is_uv1_hub()) + map_low_mmrs(); for the simple fact that MMRs mapping and EFI shouldn't depend on one another. So the proper fix would be to remove the if- check. Or am I missing something here and MMRs need EFI? (However, UV1 apparently works fine without it). Right? -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --