audk/OvmfPkg/Bhyve/PlatformPei
Gerd Hoffmann ce4c76e46d OvmfPkg/Sec: Setup MTRR early in the boot process.
Specifically before running lzma uncompress of the main firmware volume.
This is needed to make sure caching is enabled, otherwise the uncompress
can be extremely slow.

Adapt the ASSERTs and MTRR setup in PlatformInitLib to the changes.

Background:  Depending on virtual machine configuration kvm may uses EPT
memory types to apply guest MTRR settings.  In case MTRRs are disabled
kvm will use the uncachable memory type for all mappings.  The
vmx_get_mt_mask() function in the linux kernel handles this and can be
found here:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/x86/kvm/vmx/vmx.c?h=v6.7.1#n7580

In most VM configurations kvm uses MTRR_TYPE_WRBACK unconditionally.  In
case the VM has a mdev device assigned that is not the case though.

Before commit e8aa4c6546 ("UefiCpuPkg/ResetVector: Cache Disable
should not be set by default in CR0") kvm also ended up using
MTRR_TYPE_WRBACK due to KVM_X86_QUIRK_CD_NW_CLEARED.  After that commit
kvm evaluates guest mtrr settings, which why setting up MTRRs early is
important now.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-06-26 06:04:49 +00:00
..
AmdSev.c OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ClearCache.c OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
Cmos.c OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Cmos.h OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
FeatureControl.c
Fv.c OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
MemDetect.c OvmfPkg/Sec: Setup MTRR early in the boot process. 2024-06-26 06:04:49 +00:00
Platform.c OvmfPkg/Bhyve: use a proper PCI IO range 2023-12-07 16:59:09 +00:00
Platform.h OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PlatformPei.inf OvmfPkg/Bhyve: build platform info HOB 2023-08-18 12:24:35 +00:00