Re: [edk2-devel] [PATCH] OvmfPkg/PlatformInitLib: Fix integrity checking failed of NvVarStore in some cases

2022-12-14 Thread joeyli via groups.io
On Wed, Dec 14, 2022 at 03:12:22PM +0100, Gerd Hoffmann wrote: > > Sorry for I forgot to put my testing environment in patch description. > > My testing is on qemu with OVMF: > > > > - edk2-master or edk2-stable202211 > > build --verbose --debug=1 -D SECURE_BOOT_ENABLE -D TPM_ENABLE -D > >

Re: [edk2-devel] [PATCH] OvmfPkg/PlatformInitLib: Fix integrity checking failed of NvVarStore in some cases

2022-12-14 Thread joeyli via groups.io
Hi Jiewen, Thanks for your response! On Wed, Dec 14, 2022 at 06:53:42AM +, Yao, Jiewen via groups.io wrote: > Hey > Good catch! > > I think we need handle below valid cases: > 1. VAR_HEADER_VALID_ONLY (0x7F) <-- Header added (*) > 2. VAR_ADDED (0x3F) <-- Header + data added > 3. VAR_ADDED

Re: [edk2-devel] [PATCH] OvmfPkg/PlatformInitLib: Fix integrity checking failed of NvVarStore in some cases

2022-12-14 Thread joeyli via groups.io
Hi, On Wed, Dec 14, 2022 at 09:46:36PM +0800, joeyli wrote: > Hi Gerd, > > Thanks for your response! > > On Wed, Dec 14, 2022 at 07:15:28AM +0100, Gerd Hoffmann via groups.io wrote: > > Hi, > > > > > When the variable store has those variables, then system > > > booting/rebooting will > >

Re: [edk2-devel] [PATCH] OvmfPkg/PlatformInitLib: Fix integrity checking failed of NvVarStore in some cases

2022-12-14 Thread Gerd Hoffmann
> Sorry for I forgot to put my testing environment in patch description. > My testing is on qemu with OVMF: > > - edk2-master or edk2-stable202211 > build --verbose --debug=1 -D SECURE_BOOT_ENABLE -D TPM_ENABLE -D > TPM_CONFIG_ENABLE \ > -D NETWORK_IP6_ENABLE -D

Re: [edk2-devel] [PATCH] OvmfPkg/PlatformInitLib: Fix integrity checking failed of NvVarStore in some cases

2022-12-14 Thread joeyli via groups.io
Hi Gerd, Thanks for your response! On Wed, Dec 14, 2022 at 07:15:28AM +0100, Gerd Hoffmann via groups.io wrote: > Hi, > > > When the variable store has those variables, then system booting/rebooting > > will > > hangs in a ASSERT: > > > > NvVarStore Variable header State was invalid. > >

Re: [edk2-devel] [PATCH] OvmfPkg/PlatformInitLib: Fix integrity checking failed of NvVarStore in some cases

2022-12-13 Thread Yao, Jiewen
Hey Good catch! I think we need handle below valid cases: 1. VAR_HEADER_VALID_ONLY (0x7F) <-- Header added (*) 2. VAR_ADDED (0x3F) <-- Header + data added 3. VAR_ADDED & VAR_IN_DELETED_TRANSITION (0x3E) <-- marked as deleted, but still valid, before new data is added. (*) 4. VAR_ADDED &

Re: [edk2-devel] [PATCH] OvmfPkg/PlatformInitLib: Fix integrity checking failed of NvVarStore in some cases

2022-12-13 Thread Gerd Hoffmann
Hi, > 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)) I'm wondering how

[edk2-devel] [PATCH] OvmfPkg/PlatformInitLib: Fix integrity checking failed of NvVarStore in some cases

2022-12-13 Thread Lee, Chun-Yi
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