audk/MdeModulePkg
Michael Kubacki 302eb57b18 MdeModulePkg/Variable: Fix VarErrorFlag RT cache offset calculation
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2457

This commit fixes an offset calculation that is used to write the
VarErrorFlag UEFI variable to the UEFI variable runtime cache.

Currently a physical address is used instead of an offset. This
commit changes the offset to zero with a length of the entire
non-volatile variable store so the entire non-volatile variable
store buffer in SMRAM (with the variable update modification) is
copied to the runtime variable cache. This follows the same pattern
used in other SynchronizeRuntimeVariableCache () calls for
consistency.

* Observable symptom: An exception in SMM will most likely occur
  due to the invalid memory reference when the VarErrorFlag variable
  is written. The variable is most commonly written when the UEFI
  variable store is full.

* The issue only occurs when the variable runtime cache is enabled
  by the following PCD being set to TRUE:
  gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache

Fixes: aab3b9b9a1

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Turner <michael.turner@microsoft.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2020-01-17 02:51:42 +00:00
..
Application
Bus MdeModulePkg/SdMmcPciHcDxe: Fix unknown doxygen tag error 2020-01-13 01:24:13 +00:00
Core MdeModulePkg PeiCore: Improve comment semantics 2019-12-11 07:00:10 +00:00
Include MdeModulePkg: remove EnterS3WithImmediateWake () from ResetSystemLib 2020-01-10 07:00:51 +00:00
Library MdeModulePkg/UefiBootManagerLib: log reserved mem allocation failure 2020-01-14 10:53:42 +00:00
Logo
Universal MdeModulePkg/Variable: Fix VarErrorFlag RT cache offset calculation 2020-01-17 02:51:42 +00:00
MdeModulePkg.ci.yaml MdeModulePkg: Add YAML file for CI builds 2019-11-11 13:02:17 -08:00
MdeModulePkg.dec MdeModulePkg: Add EDK2 Platform Boot Manager Protocol 2020-01-08 07:28:39 +00:00
MdeModulePkg.dsc MdeModulePkg: LzmaCustomDecompressLib.inf don't support EBC anymore 2019-12-05 00:21:35 +00:00
MdeModulePkg.uni MdeModulePkg/MdeModulePkg.uni: Add missing strings for PCD 2019-12-04 05:05:57 +00:00
MdeModulePkgExtra.uni