* [PATCH v1 1/2] MdeModulePkg/Variable: Remove some debug print for runtime
[not found] <20200304024852.30669-1-ming.huang-@outlook.com>
@ 2020-03-04 2:48 ` Ming Huang
2020-03-04 2:48 ` [PATCH v1 2/2] MdeModulePkg/Variable: Move FindVariable after AutoUpdateLangVariable Ming Huang
1 sibling, 0 replies; 2+ messages in thread
From: Ming Huang @ 2020-03-04 2:48 UTC (permalink / raw)
To: devel, hao.a.wu, liming.gao, edk2-devel
Cc: phoenix.liyi, songdongkuang, huangming23, shenlimei, wanghuiqiang,
Ming Huang
System will hang at debug print if enter RecordVarErrorFlag
in runtime.
This patch fix hang issue when run fwts in OS:
fwts uefirtmisc
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang <ming.huang-@outlook.com>
---
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index d23aea4bc712..40efa10839ad 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -278,18 +278,16 @@ RecordVarErrorFlag (
VAR_ERROR_FLAG *VarErrFlag;
VAR_ERROR_FLAG TempFlag;
- DEBUG_CODE (
- DEBUG ((EFI_D_ERROR, "RecordVarErrorFlag (0x%02x) %s:%g - 0x%08x - 0x%x\n", Flag, VariableName, VendorGuid, Attributes, VariableSize));
- if (Flag == VAR_ERROR_FLAG_SYSTEM_ERROR) {
- if (AtRuntime ()) {
- DEBUG ((EFI_D_ERROR, "CommonRuntimeVariableSpace = 0x%x - CommonVariableTotalSize = 0x%x\n", mVariableModuleGlobal->CommonRuntimeVariableSpace, mVariableModuleGlobal->CommonVariableTotalSize));
- } else {
+ if (!AtRuntime ()) {
+ DEBUG_CODE (
+ DEBUG ((EFI_D_ERROR, "RecordVarErrorFlag (0x%02x) %s:%g - 0x%08x - 0x%x\n", Flag, VariableName, VendorGuid, Attributes, VariableSize));
+ if (Flag == VAR_ERROR_FLAG_SYSTEM_ERROR) {
DEBUG ((EFI_D_ERROR, "CommonVariableSpace = 0x%x - CommonVariableTotalSize = 0x%x\n", mVariableModuleGlobal->CommonVariableSpace, mVariableModuleGlobal->CommonVariableTotalSize));
+ } else {
+ DEBUG ((EFI_D_ERROR, "CommonMaxUserVariableSpace = 0x%x - CommonUserVariableTotalSize = 0x%x\n", mVariableModuleGlobal->CommonMaxUserVariableSpace, mVariableModuleGlobal->CommonUserVariableTotalSize));
}
- } else {
- DEBUG ((EFI_D_ERROR, "CommonMaxUserVariableSpace = 0x%x - CommonUserVariableTotalSize = 0x%x\n", mVariableModuleGlobal->CommonMaxUserVariableSpace, mVariableModuleGlobal->CommonUserVariableTotalSize));
- }
- );
+ );
+ }
if (!mEndOfDxe) {
//
--
2.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH v1 2/2] MdeModulePkg/Variable: Move FindVariable after AutoUpdateLangVariable
[not found] <20200304024852.30669-1-ming.huang-@outlook.com>
2020-03-04 2:48 ` [PATCH v1 1/2] MdeModulePkg/Variable: Remove some debug print for runtime Ming Huang
@ 2020-03-04 2:48 ` Ming Huang
1 sibling, 0 replies; 2+ messages in thread
From: Ming Huang @ 2020-03-04 2:48 UTC (permalink / raw)
To: devel, hao.a.wu, liming.gao, edk2-devel
Cc: phoenix.liyi, songdongkuang, huangming23, shenlimei, wanghuiqiang,
Ming Huang
When occur reclaim in AutoUpdateLangVariable(), the CurrPtr of Variable
is invalid. The State will be update with wrong position after
UpdateVariable in this situation and two valid PlatformLang or Lang
variables will exist. BmForEachVariable() will enter endless loop while
exist two valid PlatformLang variables. So FindVariable() should be
invoked atfer AutoUpdateLangVariable().
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang <ming.huang-@outlook.com>
---
.../Universal/Variable/RuntimeDxe/Variable.c | 26 ++++++++++----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 40efa10839ad..9a20be3e581f 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -2735,6 +2735,19 @@ VariableServiceSetVariable (
mVariableModuleGlobal->NonVolatileLastVariableOffset = (UINTN) NextVariable - (UINTN) Point;
}
+ if (!FeaturePcdGet (PcdUefiVariableDefaultLangDeprecate)) {
+ //
+ // Hook the operation of setting PlatformLangCodes/PlatformLang and LangCodes/Lang.
+ //
+ Status = AutoUpdateLangVariable (VariableName, Data, DataSize);
+ if (EFI_ERROR (Status)) {
+ //
+ // The auto update operation failed, directly return to avoid inconsistency between PlatformLang and Lang.
+ //
+ goto Done;
+ }
+ }
+
//
// Check whether the input variable is already existed.
//
@@ -2757,19 +2770,6 @@ VariableServiceSetVariable (
}
}
- if (!FeaturePcdGet (PcdUefiVariableDefaultLangDeprecate)) {
- //
- // Hook the operation of setting PlatformLangCodes/PlatformLang and LangCodes/Lang.
- //
- Status = AutoUpdateLangVariable (VariableName, Data, DataSize);
- if (EFI_ERROR (Status)) {
- //
- // The auto update operation failed, directly return to avoid inconsistency between PlatformLang and Lang.
- //
- goto Done;
- }
- }
-
if (mVariableModuleGlobal->VariableGlobal.AuthSupport) {
Status = AuthVariableLibProcessVariable (VariableName, VendorGuid, Data, DataSize, Attributes);
} else {
--
2.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-04 2:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200304024852.30669-1-ming.huang-@outlook.com>
2020-03-04 2:48 ` [PATCH v1 1/2] MdeModulePkg/Variable: Remove some debug print for runtime Ming Huang
2020-03-04 2:48 ` [PATCH v1 2/2] MdeModulePkg/Variable: Move FindVariable after AutoUpdateLangVariable Ming Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox