audk/OvmfPkg/Include/IndustryStandard
Laszlo Ersek 04ff9d663b OvmfPkg/IndustryStandard: add MCH_DEFAULT_SMBASE* register macros
In Intel datasheet 316966-002 (the "q35 spec"), Table 5-1 "DRAM Controller
Register Address Map (D0:F0)" leaves the byte register at config space
offset 0x9C unused.

On QEMU's Q35 board, for detecting the "SMRAM at default SMBASE" feature,
firmware is expected to write MCH_DEFAULT_SMBASE_QUERY (0xFF) to offset
MCH_DEFAULT_SMBASE_CTL (0x9C), and read back the register. If the value is
MCH_DEFAULT_SMBASE_IN_RAM (0x01), then the feature is available, and the
range mentioned below is open (accessible to code running outside of SMM).

Then, once firmware writes MCH_DEFAULT_SMBASE_LCK (0x02) to the register,
the MCH_DEFAULT_SMBASE_SIZE (128KB) range at 0x3_0000 (SMM_DEFAULT_SMBASE)
gets closed and locked down, and the register becomes read-only. The area
is reopened, and the register becomes read/write, at platform reset.

Add the above-listed macros to "Q35MchIch9.h".

(There are some other unused offsets in Table 5-1; for example we had
scavenged 0x50 for implementing the extended TSEG feature. 0x9C is the
first byte-wide register standing in isolation after 0x50.)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Message-Id: <20200129214412.2361-4-lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2020-02-05 12:59:32 +00:00
..
Xen OvmfPkg: strip trailing whitespace 2019-10-04 11:18:32 +01:00
E820.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
I440FxPiix4.h OvmfPkg/IndustryStandard: define macros for QEMU's CPU hotplug registers 2020-01-29 17:28:22 +00:00
LegacyVgaBios.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
LinuxBzimage.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
Q35MchIch9.h OvmfPkg/IndustryStandard: add MCH_DEFAULT_SMBASE* register macros 2020-02-05 12:59:32 +00:00
QemuCpuHotplug.h OvmfPkg/IndustryStandard: define macros for QEMU's CPU hotplug registers 2020-01-29 17:28:22 +00:00
QemuFwCfg.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
QemuPciBridgeCapabilities.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
QemuTpm.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
Virtio.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
Virtio10.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
Virtio10Net.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
Virtio095.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
Virtio095Net.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
VirtioBlk.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
VirtioGpu.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
VirtioNet.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
VirtioScsi.h OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00