Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ovmf for openSUSE:Factory checked in 
at 2022-12-15 19:24:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ovmf (Old)
 and      /work/SRC/openSUSE:Factory/.ovmf.new.1835 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ovmf"

Thu Dec 15 19:24:22 2022 rev:86 rq:1042945 version:202211

Changes:
--------
--- /work/SRC/openSUSE:Factory/ovmf/ovmf.changes        2022-12-04 
14:57:31.659984501 +0100
+++ /work/SRC/openSUSE:Factory/.ovmf.new.1835/ovmf.changes      2022-12-15 
19:24:25.707791149 +0100
@@ -1,0 +2,14 @@
+Thu Dec  8 12:16:49 UTC 2022 - Joey Lee <j...@suse.com>
+
+- Add ovmf-OvmfPkg-PlatformInitLib-Fix-integrity-checking-faile.patch
+  to avoid "NvVarStore Variable header State was invalid" issue when
+  rebooting or booting second time. System hangs when booting. (bsc#1206078)
+
+  The error message in ovmf log:
+       Select Item: 0x19
+       Select Item: 0x25
+       Reserved variable store memory: 0x7FF7C000; size: 528kb
+       NvVarStore Variable header State was invalid.  
+       ASSERT 
/home/abuild/rpmbuild/BUILD/edk2-edk2-stable202211/OvmfPkg/Library/PlatformInitLib/Platform.c(807):
 ((BOOLEAN)(0==1)) 
+
+-------------------------------------------------------------------

New:
----
  ovmf-OvmfPkg-PlatformInitLib-Fix-integrity-checking-faile.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ovmf.spec ++++++
--- /var/tmp/diff_new_pack.ZeUtMH/_old  2022-12-15 19:24:26.639796451 +0100
+++ /var/tmp/diff_new_pack.ZeUtMH/_new  2022-12-15 19:24:26.643796474 +0100
@@ -60,6 +60,8 @@
 Patch12:        
%{name}-Revert-MdeModulePkg-Replace-Opcode-with-the-correspo.patch
 # Bug 1205978 - Got Page-Fault exception when VM is booting with 
edk2-stable202211 ovmf
 Patch13:        
%{name}-Revert-OvmfPkg-PlatformInitLib-dynamic-mmio-window-s.patch
+# Bug 1206078 - qemu-ovmf-x86_64-202211 is broken: NvVarStore Variable header 
State was invalid
+Patch14:        
%{name}-OvmfPkg-PlatformInitLib-Fix-integrity-checking-faile.patch
 BuildRequires:  bc
 BuildRequires:  cross-arm-binutils
 BuildRequires:  cross-arm-gcc%{gcc_version}
@@ -184,6 +186,7 @@
 %patch12 -p1
 %endif
 %patch13 -p1
+%patch14 -p1
 
 # add openssl
 pushd CryptoPkg/Library/OpensslLib/openssl






++++++ ovmf-OvmfPkg-PlatformInitLib-Fix-integrity-checking-faile.patch ++++++
>From c91dc77bb5218049c9904b43e217d7a89e1ddc99 Mon Sep 17 00:00:00 2001
From: "Lee, Chun-Yi" <j...@suse.com>
Date: Tue, 13 Dec 2022 23:29:29 +0800
Subject: [PATCH] OvmfPkg/PlatformInitLib: Fix integrity checking failed of
 NvVarStore in some cases

In the commit 4f173db8b4 "OvmfPkg/PlatformInitLib: Add functions for 
EmuVariableNvStore"
, it introduced a PlatformValidateNvVarStore() function for checking the
integrity of NvVarStore.

In some cases when the VariableHeader->StartId is VARIABLE_DATA, the 
VariableHeader->State
is not just one of the four primary states: VAR_IN_DELETED_TRANSITION, 
VAR_DELETED,
VAR_HEADER_VALID_ONLY, VAR_ADDED. The state may combined two or three
states, e.g.
    0x3C = (VAR_IN_DELETED_TRANSITION & VAR_ADDED) & VAR_DELETED
or
    0x3D = VAR_ADDED & VAR_DELETED

When the variable store has those variables, then system booting/rebooting will
hangs in a ASSERT:

NvVarStore Variable header State was invalid.
ASSERT
/mnt/working/source_code-git/edk2/OvmfPkg/Library/PlatformInitLib/Platform.c(819):
((BOOLEAN)(0==1))

Adding more log to UpdateVariable() and PlatformValidateNvVarStore(), we
can see there have some variables have 0x3C or 0x3D state in store.
e.g.

UpdateVariable(), VariableName=BootOrder
L1871, State=0000003F                   <-- VAR_ADDED
State &= VAR_DELETED=0000003D
FlushHobVariableToFlash(), VariableName=BootOrder
...
UpdateVariable(), VariableName=InitialAttemptOrder
L1977, State=0000003F
State &= VAR_IN_DELETED_TRANSITION=0000003E
L2376, State=0000003E
State &= VAR_DELETED=0000003C
FlushHobVariableToFlash(), VariableName=InitialAttemptOrder
...
UpdateVariable(), VariableName=ConIn
L1977, State=0000003F
State &= VAR_IN_DELETED_TRANSITION=0000003E
L2376, State=0000003E
State &= VAR_DELETED=0000003C
FlushHobVariableToFlash(), VariableName=ConIn
...

So, only allowing the four primary states is not enough. This patch adds
two more combined states to the valid states list:

    (VAR_IN_DELETED_TRANSITION & VAR_ADDED) & VAR_DELETED = 0x3c

    VAR_ADDED & VAR_DELETED = 0x3d

Signed-off-by: "Lee, Chun-Yi" <j...@suse.com>
---
 OvmfPkg/Library/PlatformInitLib/Platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: edk2-edk2-stable202211/OvmfPkg/Library/PlatformInitLib/Platform.c
===================================================================
--- edk2-edk2-stable202211.orig/OvmfPkg/Library/PlatformInitLib/Platform.c
+++ edk2-edk2-stable202211/OvmfPkg/Library/PlatformInitLib/Platform.c
@@ -704,7 +704,9 @@ PlatformValidateNvVarStore (
       if (!((VariableHeader->State == VAR_IN_DELETED_TRANSITION) ||
             (VariableHeader->State == VAR_DELETED) ||
             (VariableHeader->State == VAR_HEADER_VALID_ONLY) ||
-            (VariableHeader->State == VAR_ADDED)))
+            (VariableHeader->State == VAR_ADDED) ||
+            (VariableHeader->State == (VAR_ADDED & VAR_DELETED)) ||
+            (VariableHeader->State == (VAR_ADDED & VAR_IN_DELETED_TRANSITION & 
VAR_DELETED))))
       {
         DEBUG ((DEBUG_ERROR, "NvVarStore Variable header State was 
invalid.\n"));
         return FALSE;

Reply via email to