From: Jordan Justen <jljusten@gmail.com>
To: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Cc: Gleb Natapov <gleb@redhat.com>,
Stefan Hajnoczi <stefanha@gmail.com>,
qemu-devel <qemu-devel@nongnu.org>,
Michal Suchanek <hramrach@centrum.cz>,
Kevin O'Connor <kevin@koconnor.net>, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] Re: RFC: emulation of system flash
Date: Thu, 10 Mar 2011 18:12:04 -0800 [thread overview]
Message-ID: <AANLkTikRM2KMrs8EXT3y0gUQ4gygZy76dUKLvDNy9EVC@mail.gmail.com> (raw)
In-Reply-To: <4D7961AA.7070404@gmx.net>
On Thu, Mar 10, 2011 at 15:41, Carl-Daniel Hailfinger
<c-d.hailfinger.devel.2006@gmx.net> wrote:
> Auf 10.03.2011 23:58, Jordan Justen schrieb:
>> Would the firmware
>> be able to depend on having control of the device at OS runtime? This
>> would be needed for UEFI non-volatile variables to make sure they can
>> always be written.
>>
>
> UEFI _should not_ have control of the device at OS runtime on real
> hardware for security reasons, unless UEFI slipped a rootkit into the
> OS. Not sure about Windows, but I'm pretty sure Linux will not run any
> UEFI code (except maybe during early init).
UEFI non-volatile variables are a runtime service, meaning the OS
should be able to utilize them at any time.
It is up to the OS whether it wants to actually make use of the
runtime services, of course. Both Windows and Linux do have
interfaces available to modify UEFI variables at runtime.
> Think flash update. If some flash update software runs under your OS of
> choice, and UEFI is allowed to perform read/write accesses to flash at
> the same time, you will get random corruption. You could do it like some
> AMD chipsets, and provide some sort of semaphore for flash access
> coordination between a flash updater and the BIOS/EFI, but I don't think
> any Intel chipset can do that. Newer Intel chipsets allow locking out
> flash accesses not coming from the management engine, but UEFI does not
> run in the management engine, so that feature won't help us here.
The UEFI systems (meaning motherboard+firmware) that I have worked on
generally do not allow the flash (code) to be modified while the OS is
running. Instead, UEFI has a 'capsule' concept where firmware update
data is transfered to the firmware from the OS during a 'reboot' of
sorts. The firmware validates the capsule data, and then flashes it
on the boot following the reset.
But, the sections of the flash which non-volatile variables are stored
in can be updated by the UEFI firmware, and there are mechanisms which
can restrict this access as well to prevent corruption of the NV
variables.
Unfortunately, I assume these security mechanisms often come into
conflict with useful tools like flashrom. (At least during OS
runtime.)
> That said, if any OS out there indeed runs UEFI code regularly during OS
> runtime, and that UEFI code wants to access flash, it has to hope that
> nobody else is trying to access flash at the same time. An easy way out
> would be to use the ACPI NVS region while the machine is running an OS,
> but changes would not automatically be persistent without help from the
> OS or some ACPI handler on shutdown.
To be UEFI compatible, the non-volatile variable write should become
persistent immediately after the call returns successfully. This has
been the case on most UEFI systems that I have worked on.
-Jordan
next prev parent reply other threads:[~2011-03-11 2:12 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-10 4:51 [Qemu-devel] RFC: emulation of system flash Jordan Justen
2011-03-10 9:10 ` [Qemu-devel] " Avi Kivity
2011-03-10 18:43 ` Jordan Justen
2011-03-10 21:52 ` Carl-Daniel Hailfinger
2011-03-10 22:14 ` Jordan Justen
2011-03-10 22:31 ` Carl-Daniel Hailfinger
2011-03-10 22:58 ` Jordan Justen
2011-03-10 23:41 ` Carl-Daniel Hailfinger
2011-03-11 2:12 ` Jordan Justen [this message]
2011-03-10 9:47 ` Gleb Natapov
2011-03-10 11:27 ` Jan Kiszka
2011-03-10 11:46 ` Jan Kiszka
2011-03-10 11:53 ` Paolo Bonzini
2011-03-10 12:07 ` Jan Kiszka
2011-03-10 19:03 ` Jordan Justen
2011-03-10 19:23 ` Anthony Liguori
2011-03-10 20:05 ` Jordan Justen
2011-03-10 11:48 ` Gleb Natapov
2011-03-10 12:06 ` Jan Kiszka
2011-03-10 12:17 ` Gleb Natapov
2011-03-10 12:27 ` Jan Kiszka
2011-03-10 19:08 ` Jordan Justen
2011-03-10 19:13 ` Gleb Natapov
2011-03-10 21:46 ` Carl-Daniel Hailfinger
2011-03-10 22:11 ` Scott Wood
2011-03-10 21:41 ` Carl-Daniel Hailfinger
2011-03-10 22:05 ` Jordan Justen
2011-03-10 18:59 ` Jordan Justen
2011-03-10 19:12 ` Gleb Natapov
2011-03-10 19:50 ` Jordan Justen
2011-03-10 20:08 ` Антон Кочков
2011-03-10 20:21 ` Gleb Natapov
2011-03-11 21:41 ` Jordan Justen
2011-03-14 14:29 ` Gleb Natapov
2011-03-10 21:37 ` [Qemu-devel] " Carl-Daniel Hailfinger
2011-03-10 21:55 ` Jordan Justen
2011-03-10 22:10 ` Carl-Daniel Hailfinger
2011-03-10 22:29 ` Jordan Justen
2011-03-10 23:53 ` Carl-Daniel Hailfinger
2011-03-11 0:19 ` [Qemu-devel] " Jan Kiszka
2011-03-11 0:27 ` Carl-Daniel Hailfinger
2011-03-11 19:09 ` Jordan Justen
2011-03-11 23:10 ` Michal Suchanek
2011-03-12 9:24 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTikRM2KMrs8EXT3y0gUQ4gygZy76dUKLvDNy9EVC@mail.gmail.com \
--to=jljusten@gmail.com \
--cc=avi@redhat.com \
--cc=c-d.hailfinger.devel.2006@gmx.net \
--cc=gleb@redhat.com \
--cc=hramrach@centrum.cz \
--cc=kevin@koconnor.net \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).