From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753234AbcHRGL1 (ORCPT ); Thu, 18 Aug 2016 02:11:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36122 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752992AbcHRGLZ (ORCPT ); Thu, 18 Aug 2016 02:11:25 -0400 Date: Thu, 18 Aug 2016 14:11:13 +0800 From: Dave Young To: Alex Thorlton Cc: Borislav Petkov , Matt Fleming , linux-kernel@vger.kernel.org, Russ Anderson , Dimitri Sivanich , Mike Travis , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-efi@vger.kernel.org Subject: Re: [PATCH] Map in physical addresses in efi_map_region_fixed Message-ID: <20160818061113.GA26001@dhcp-128-65.nay.redhat.com> References: <1470441575-96065-1-git-send-email-athorlton@sgi.com> <20160815124258.GF30909@codeblueprint.co.uk> <20160815150709.GA6085@nazgul.tnic> <20160815184731.GS214806@stormcage.americas.sgi.com> <20160817070151.GC5498@dhcp-128-65.nay.redhat.com> <20160817160031.GV214806@stormcage.americas.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160817160031.GV214806@stormcage.americas.sgi.com> User-Agent: Mutt/1.6.2 (2016-07-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 18 Aug 2016 06:11:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/17/16 at 11:00am, Alex Thorlton wrote: > On Wed, Aug 17, 2016 at 03:01:51PM +0800, Dave Young wrote: > > > > Why do you guys need the physical mapping all of a sudden? > > > > > > It's not that we need it all of the sudden, necessarily, it's just that > > > we've had to make other changes to make things work with the new, > > > (almost) completely isolated, EFI page tables. We ended up choosing the > > > lesser of two evils, and have decided to temporarily rely on the > > > physical address of our runtime code, instead of continuing to rely on > > > EFI_OLD_MEMMAP. > > > > In efi_map_region, there is already mapped md->phys_addr for broken > > firmware. SGI still need EFI_OLD_MEMMAP? I means in 1st kernel instead > > of kexec kernel. > > We're actually in the middle of trying to move *away* from > EFI_OLD_MEMMAP, which is why we're just starting to uncover some of > these things. efi_map_region covers us on the primary kernel, because > it maps in the physical address of each md (as you note here), but that > little piece is missing in the kexec'd kernel. So, our primary kernel > works without efi=old_map, but the second kernel won't, without this > change (supplying "noefi" on the kexec command line also works, but then > we don't have any of our runtime stuff available). > > As noted in a previous message, we're aware that our code needs a little > more work to be "perfect," but this small change buys us most of (all > of?) the stuff we'd get by implementing the other changes that we're > aware we need to make, i.e. update our runtime function pointer to its > efi_va during SetVirtualAddressMap, at least from a kexec perspective. Thanks for explanation, I still do not get why the original ioremap way works if SetVirtualAddressMapdo does not update runtime function pointer. But if it fixes the problem in primary kernel, it should be fine to do same in kexec kernel. Thanks Dave