Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758243Ab3FCOiH (ORCPT ); Mon, 3 Jun 2013 10:38:07 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:42949 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755177Ab3FCOiF (ORCPT ); Mon, 3 Jun 2013 10:38:05 -0400 Message-ID: <1370270282.2910.9.camel@dabdike> Subject: Re: [PATCH 0/4] EFI 1:1 mapping From: James Bottomley To: Matthew Garrett Cc: Borislav Petkov , Linux EFI , Matt Fleming , Jiri Kosina , X86-ML , LKML , Borislav Petkov Date: Mon, 03 Jun 2013 07:38:02 -0700 In-Reply-To: <20130603143010.GA20252@srcf.ucam.org> References: <1370177770-26661-1-git-send-email-bp@alien8.de> <20130602225620.GA5496@srcf.ucam.org> <20130603081148.GB13607@nazgul.tnic> <1370269642.2910.4.camel@dabdike> <20130603143010.GA20252@srcf.ucam.org> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.8.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1897 Lines: 39 On Mon, 2013-06-03 at 15:30 +0100, Matthew Garrett wrote: > On Mon, Jun 03, 2013 at 07:27:22AM -0700, James Bottomley wrote: > > > That's correct. I think not calling SetVirtualAddressMap() and just > > using a 1:1 mapping is far safer (having looked at what tianocore does > > for SetVirtualAddressMap()). The chances are that all the UEFI bioses > > are only tested with windows, so the pointer chases it has to do to > > switch address maps only work with the operations windows does. > > Windows calls SetVirtualAddressMap(), so the only way these systems have > been tested is with SetVirtualAddressMap(). I know, but that's not what I said. If you look at the implementation, SetVirtualAddressMap() does a massive pointer chase through the images. It not only tries to relocate the text and data, but it also tries to relocate all the users of the data. Some of these sources of data are boot time and some runtime. Those both need to be relocated by a separate pointer chase. What we saw with the QueryVariableInfo() problem was that a boot time pointer wasn't relocated. That's got to mean that windows only calls QueryVariableInfo from runtime. My point is that if we elect to call SetVirtualAddressMap() we'll be restricted to only making the calls at boot time that windows does otherwise we'll end up with these unrelocated pointers. That's a huge nasty verification burden on us. Alternatively, if we never call SetVirtualAddressMap() it seems to me that we just don't have to worry about pointer relocation issues. Thus, I think it would be better we use the 1:1 mapping instead of calling SetVirtualAddressMap(). James -- 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/