public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch v3 0/2] MdeModulePkg/Variable/RuntimeDxe: Restore Variable Lock Protocol behavior
@ 2020-12-11  4:51 Michael D Kinney
  2020-12-11  4:51 ` [Patch v3 1/2] " Michael D Kinney
  2020-12-11  4:51 ` [Patch v3 2/2] MdeModulePkg/Variable/RuntimeDxe: Add Variable Lock Protocol Unit Tests Michael D Kinney
  0 siblings, 2 replies; 6+ messages in thread
From: Michael D Kinney @ 2020-12-11  4:51 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu, Liming Gao, Bret Barkelew

New in V3
==========
* Split into 2 patches.  One for code change.  Second for unit tests.
* Remove duplicate code and use ValidateSetVariable() to detect if a
  variable is already locked.

https://bugzilla.tianocore.org/show_bug.cgi?id=3111

The VariableLock shim currently fails if called twice because the
underlying Variable Policy engine returns an error if a policy is set
on an existing variable.

This breaks existing code which expect it to silently pass if a variable
is locked multiple times (because it should "be locked").

Refactor the shim to confirm that the variable is indeed locked and then
change the error to EFI_SUCCESS and generate a DEBUG_ERROR message so
the duplicate lock can be reported in a debug log and removed.

Add host based unit tests for the multiple lock case using Variable Lock
Protocol, Variable Policy Protocol, and mixes of Variable Lock Protocol
and Variable Policy Protocol.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Bret Barkelew <Bret.Barkelew@microsoft.com>

Bret Barkelew (1):
  MdeModulePkg/Variable/RuntimeDxe: Restore Variable Lock Protocol
    behavior

Michael D Kinney (1):
  MdeModulePkg/Variable/RuntimeDxe: Add Variable Lock Protocol Unit
    Tests

 MdeModulePkg/Test/MdeModulePkgHostTest.dsc    |  11 +
 .../VariableLockRequestToLockUnitTest.c       | 565 ++++++++++++++++++
 .../VariableLockRequestToLockUnitTest.inf     |  36 ++
 .../RuntimeDxe/VariableLockRequestToLock.c    |  95 +--
 4 files changed, 671 insertions(+), 36 deletions(-)
 create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
 create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.inf

-- 
2.29.2.windows.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-11  7:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-11  4:51 [Patch v3 0/2] MdeModulePkg/Variable/RuntimeDxe: Restore Variable Lock Protocol behavior Michael D Kinney
2020-12-11  4:51 ` [Patch v3 1/2] " Michael D Kinney
2020-12-11  5:40   ` Wu, Hao A
2020-12-11  7:53     ` Michael D Kinney
2020-12-11  4:51 ` [Patch v3 2/2] MdeModulePkg/Variable/RuntimeDxe: Add Variable Lock Protocol Unit Tests Michael D Kinney
2020-12-11  5:43   ` [edk2-devel] " Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox