Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756282Ab3EaRgS (ORCPT ); Fri, 31 May 2013 13:36:18 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:32931 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753780Ab3EaRgJ (ORCPT ); Fri, 31 May 2013 13:36:09 -0400 Message-ID: <1370021732.6250.4.camel@dabdike> Subject: Re: [regression, bisected] x86: efi: Pass boot services variable info to runtime code From: James Bottomley To: Matthew Garrett Cc: Russ Anderson , Ingo Molnar , Borislav Petkov , Jiri Kosina , joeyli , Matt Fleming , matt.fleming@intel.com, linux-efi@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , "H. Peter Anvin" , Linus Torvalds , Andrew Morton Date: Fri, 31 May 2013 10:35:32 -0700 In-Reply-To: <20130531162815.GA8082@srcf.ucam.org> References: <20130530221737.GA11105@sgi.com> <20130531101250.GD30394@gmail.com> <20130531123015.GC17843@nazgul.tnic> <20130531124356.GA8212@gmail.com> <20130531143425.GA5850@srcf.ucam.org> <1370011357.1913.15.camel@dabdike.int.hansenpartnership.com> <20130531144826.GB5850@srcf.ucam.org> <20130531154348.GA17145@sgi.com> <20130531162815.GA8082@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: 1906 Lines: 44 On Fri, 2013-05-31 at 17:28 +0100, Matthew Garrett wrote: > On Fri, May 31, 2013 at 10:43:49AM -0500, Russ Anderson wrote: > > > When did writing EFI variables to nvram become necessary to boot on > > UEFI? And if it is necessary, why is it that only linux boot loaders > > that use EFI stubs (generally grub2) need it? The current kernel > > boots using EFI/grub and EFI/elilo. It is just when EFI stubs are > > used that the boot fails. > > I think you've misunderstood the problem. If nvram becaomes full, some > systems crash during firmware initialisation. So we can't let nvram > become full. The obvious thing to do here is to look at the values from > QueryVariableInfo, but many systems won't perform any garbage collection > until they're almost out of space and so variables that have been > deleted still show up as used space. We can work around that by adding > up the size of the variables ourselves, but that only gives us the value > for runtime-visible variables. We also need to know how much space is > used by variables that are only visible during boot, hence calling > QueryVariableInfo before ExitBootServices. > > > Which means the previous patch(es) that caused the bricking should > > get pulled, too. > > There are no patches that cause the bricking. This is the description of the original problem: http://www.h-online.com/open/news/item/Booting-Linux-using-UEFI-can-brick-Samsung-laptops-1793958.html And the further investigation: http://mjg59.dreamwidth.org/22855.html If you read the latter, it shows you why we have to use QueryVariableInfo to try to work out how much space we have available. 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/