Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753254AbbG3OFu (ORCPT ); Thu, 30 Jul 2015 10:05:50 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:36665 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753171AbbG3OFr (ORCPT ); Thu, 30 Jul 2015 10:05:47 -0400 Date: Thu, 30 Jul 2015 15:05:42 +0100 From: Matt Fleming To: joeyli Cc: Borislav Petkov , "H. Peter Anvin" , "Lee, Chun-Yi" , Thomas Gleixner , Ingo Molnar , x86@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address Message-ID: <20150730140542.GI2725@codeblueprint.co.uk> References: <1438230757-30840-1-git-send-email-jlee@suse.com> <55B9D806.7030705@zytor.com> <20150730080323.GD8984@nazgul.tnic> <20150730101131.GB2725@codeblueprint.co.uk> <20150730110959.GJ15651@linux-rxt1.site> <20150730111819.GK15651@linux-rxt1.site> <20150730120916.GD2725@codeblueprint.co.uk> <20150730123116.GL15651@linux-rxt1.site> <20150730131723.GG2725@codeblueprint.co.uk> <20150730133947.GN15651@linux-rxt1.site> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150730133947.GN15651@linux-rxt1.site> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1142 Lines: 25 On Thu, 30 Jul, at 09:39:47PM, joeyli wrote: > > OK, understood! Thanks for your suggestion! > > But, I have a question about mapping Boot Code/Data to -4G area. I understand > we need Runtime regions, and 1:1 mapping is the workaround of some buggy BIOS. > But why should kernel mapping Boot regions to -4G area? We map the Boot Service regions in the -4G area for simplicity, i.e. it's easier to iterate through the EFI memory map in order, and map things starting at -4G and working down to lower addresses, than it would be to make different mapping decisions based on the region type. As for why we map the Boot Service regions *at all*, that's also a bug workaround, see commit 916f676f8dc0 ("x86, efi: Retain boot service code until after switching to virtual mode"). We setup the mappings before we call efi_free_boot_services(). -- Matt Fleming, Intel Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/