Re: Return EFI_INVALID_PARAMETER if attribute only has EFI_VARIABLE_NON_VOLATILE set
On 10/21/21 12:18, Sunny Wang wrote:
Hi Liming, Hao, and allThe Self Certification Test (SCT) II Case Specification, June 2017 explicitly forbids this value for QueryVariableInfo(): <cite> 5.2.1.4.5 Call QueryVariableInfo service with the Attributes: * EFI_VARIABLE_NON_VOLATILE * EFI_VARIABLE_RUNTIME_ACCESS * EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_RUNTIME_ACCESS The returned code must be EFI_INVALID_PARAMETER. </cite> This corresponds to the UEFI specification saying: <cite> QueryVariableInfo() Status Codes returned EFI_INVALID_PARAMETER: An invalid combination of attribute bits was supplied. </cite> A variable being not accessible at BootTime seems not to be foreseen by the specification: <cite> SetVariable() ... If software uses a nonvolatile variable, it should use a variable that is only accessible at boot services time if possible. ... Attributes that have EFI_VARIABLE_RUNTIME_ACCESS set must also have EFI_VARIABLE_BOOTSERVICE_ACCESS set. </cite> This sounds like a nonvolatile variable should always be accessible at boot services time. But an explicit rule forbidding the creation of inaccessible variables, i.e. without EFI_VARIABLE_BOOTSERVICE_ACCESS, is missing. It would be good to have a paragraph in the specification that unambiguously defines which combination of attribute bits are valid. How about: "All variables must be created with attribute bit EFI_VARIABLE_BOOTSERVICE_ACCESS." Best regards Heinrich
|
|