efi: Implement mandatory locking for UEFI Runtime Services
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 4 Aug 2014 16:16:00 +0000 (18:16 +0200)
committerMatt Fleming <matt.fleming@intel.com>
Fri, 3 Oct 2014 17:40:57 +0000 (18:40 +0100)
According to section 7.1 of the UEFI spec, Runtime Services are not fully
reentrant, and there are particular combinations of calls that need to be
serialized. Use a spinlock to serialize all Runtime Services with respect
to all others, even if this is more than strictly needed.

We've managed to get away without requiring a runtime services lock
until now because most of the interactions with EFI involve EFI
variables, and those operations are already serialised with
__efivars->lock.

Some of the assumptions underlying the decision whether locks are
needed or not (e.g., SetVariable() against ResetSystem()) may not
apply universally to all [new] architectures that implement UEFI.
Rather than try to reason our way out of this, let's just implement at
least what the spec requires in terms of locking.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>

No differences found