audk/MdeModulePkg/Universal/Acpi/AcpiTableDxe
Laszlo Ersek f798e8bff7 MdeModulePkg: Acpi: enforce exclusion between FirmwareCtrl and XFirmwareCtrl
The code in AcpiTableDxe handles the installation of FADT and FACS in both
possible orders. In the [FADT, FACS] installation order, the FACS is at
once linked into the FADT. In the [FACS, FADT] installation order, the
FACS is stashed temporarily, and it is linked into the FADT when the FADT
is installed later.

According to the ACPI specification, *at most one* of FADT.FirmwareCtrl
and FADT.XFirmwareCtrl may be nonzero. The code is aware of this
requirement, and it never sets both of them to nonzero values at once.

However, the code doesn't expect the following:

- The caller first installs the FACS, which is stashed. The address that
  is saved happens to fall below 4GB.

- The caller then installs a FADT, with a zero FirmwareCtrl field, and a
  nonzero (pre-populated) XFirmwareCtrl field.

In this case the code sets FADT.FirmwareCtrl to the less-than-4GB address
of the stashed FACS, and leaves the different nonzero value in
FADT.XFirmwareCtrl. This violates the ACPI specification.

Prevent this by always zeroing the field that we do *not* set.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.Yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16659 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-26 08:05:04 +00:00
..
AcpiSdt.c Update code to support VS2013 tool chain. 2014-07-28 07:52:57 +00:00
AcpiSdt.h Add ACPI5.0 header file. 2011-11-30 03:57:39 +00:00
AcpiTable.c Fix VS2003 build error 2010-05-19 06:02:17 +00:00
AcpiTable.h Create PCDs in MdeModulePkg for ACPI table OEM_ID/OEM_TABLE_ID/OEM_REVISION/CREATOR_ID/CREATOR_REVISION customization. 2013-09-16 02:20:52 +00:00
AcpiTableDxe.inf MdeModulePkg: INF/DEC file updates to EDK II packages 2014-08-28 06:34:06 +00:00
AcpiTableDxe.uni MdeModulePkg: Convert non DOS format files to DOS format and remove unused module UNI files. 2014-09-03 08:39:12 +00:00
AcpiTableDxeExtra.uni MdeModulePkg: INF/DEC file updates to EDK II packages 2014-08-28 06:53:43 +00:00
AcpiTableProtocol.c MdeModulePkg: Acpi: enforce exclusion between FirmwareCtrl and XFirmwareCtrl 2015-01-26 08:05:04 +00:00
Aml.c 1) Add type cast for better coding style. 2014-08-07 08:54:34 +00:00
AmlChild.c Update code to support VS2013 tool chain. 2014-07-28 07:52:57 +00:00
AmlNamespace.c Update code to support VS2013 tool chain. 2014-07-28 07:52:57 +00:00
AmlOption.c MdeModulePkg: 2010-05-18 02:26:49 +00:00
AmlString.c MdeModulePkg: Remove variables that are set, but not used 2011-10-31 15:58:05 +00:00