Specify runtime access to file-backed variable stores#169
Open
ricardosalveti wants to merge 2 commits into
Open
Specify runtime access to file-backed variable stores#169ricardosalveti wants to merge 2 commits into
ricardosalveti wants to merge 2 commits into
Conversation
Firmware that stores EFI variables in a file cannot write that file once the OS controls the storage device. U-Boot keeps servicing the variable runtime services from a memory-backed store and delegates persisting it to the OS: the RTStorageVolatile variable names the store file on the ESP and VarToFile exports the content the file must have. The mechanism is also implemented by EDK2-based vendor firmware and supported by libefivar (rhboot/efivar#282), but it is only documented in U-Boot. Specify the mechanism so that firmware and operating systems can implement it from EBBR alone: define the vendor GUID, the semantics of the two variables, the firmware requirements including the runtime SetVariable() restrictions, and the write-back duties of the OS. While at it, retitle the chapter, whose scope now goes beyond the store file format, extend the limitations section accordingly, and add the chapter 2 anchor the new section refers to. Suggested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
The Runtime Variable Access section only describes the option of not implementing SetVariable() after ExitBootServices() and claims that neither U-Boot nor Tianocore have a generic solution for variable stores on shared media, which is no longer accurate. Require firmware that stores EFI variables in a file on storage shared with the OS to implement the mechanism now specified in chapter 5, keeping GetVariable(), GetNextVariableName() and SetVariable() available during runtime services, and reflect this conditional requirement in the runtime services table. Platforms without a file-backed store keep the existing EFI_UNSUPPORTED / RuntimeServicesSupported fallback. Fixes: ARM-software#143 Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Specify the mechanism U-Boot uses to provide SetVariable() at runtime with a
file-backed variable store, as requested in #143. The firmware services the
variable runtime services from memory and exports the store file content
through two volatile variables, RTStorageVolatile and VarToFile, which the
OS writes back to the ESP. The same protocol is implemented by EDK2-based
vendor firmware and supported by libefivar since rhboot/efivar#282 (systemd
doesn't use libefivar; equivalent support is proposed in
systemd/systemd#42905).
Chapter 5 defines the vendor GUID, the two variables and the firmware/OS
requirements. Chapter 2 makes GetVariable(), GetNextVariableName() and
SetVariable() required at runtime for file-backed variable stores only;
everything else keeps the existing EFI_UNSUPPORTED fallback, so SetVariable()
at runtime is not unconditionally mandatory.