lkml.org 
[lkml]   [2013]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [regression, bisected] x86: efi: Pass boot services variable info to runtime code
On Fri, May 31, 2013 at 11:20:59PM -0500, Russ Anderson wrote:

> And when QueryVariableInfo reports insufficient space, don't write
> and everything is fine.

And then installs fail, which is why we implemented this additional
code.

> But when QueryVariableInfo reports insufficient space and you
> write anyway, the system can get bricked. Is that the problem?

No.

> Some bios implementation may be "*including garbage*", but can
> you definitively say ALL do? The spec explicitly says "the
> implementation of variable storage is not defined in this
> specification". You can't assume any form of garbage collection.

No. We can't assume that. But nor can we rely upon the spec, because
behaving according to the spec results in dead computers. So we're
forced to write code that behaves according to reality rather than
paper, which is unfortunate, but if *your* firmware behaved according to
the specification then you wouldn't be seeing any problems with the
current code, so I think there's a lesson for us all here.

> I don't see anything in here about the OS being free to use
> more nvram than QueryVariableInfo() reported as being available.
> What happened to following the spec?

That would be the same spec that tells you not to use physical addresses
after SetVirtualAddressMap() has been called, right? Regardless, we
don't use more space than QueryVariableInfo() reports as being
available. We would expect that any attempt to do so would fail. But nor
can we assume that we're free to use as much space as
QueryVariableInfo() *does* report, because doing so results in dead
computers. So instead we're forced to rely on workarounds that happen to
break your broken firmware, so now we're going to have to find a
different set of workarounds and hope that they don't break someone
else's computer instead.

> > There's a limited number of situations where the firmware can write to
> > nvram, but they're basically uninteresting. Practically speaking, it's
> > always via the kernel once ExitBootServices() has been called.
>
> How can you say "they're basically uninteresting"???
> Do you know what EVERY bios implementation does???

We have to assume that firmware doesn't behave in a pathological manner,
because the alternative is to give up entirely and declare that Linux
doesn't run on UEFI systems. I suspect that that would be problematic
for your employers.

--
Matthew Garrett | mjg59@srcf.ucam.org


\
 
 \ /
  Last update: 2013-06-01 07:21    [W:1.427 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site