diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2024-01-23 15:33:51 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-06-26 06:04:49 +0000 |
commit | ce4c76e46d52e24551f4986bded4c9b764502200 (patch) | |
tree | 8851a1f2604a421e469ef5c6356bfc8d23d6e4f9 /ArmVirtPkg | |
parent | e21bfae345f9eee1c3f585013ca50ad6ab4f86a1 (diff) | |
download | edk2-ce4c76e46d52e24551f4986bded4c9b764502200.zip edk2-ce4c76e46d52e24551f4986bded4c9b764502200.tar.gz edk2-ce4c76e46d52e24551f4986bded4c9b764502200.tar.bz2 |
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 e8aa4c6546ad ("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>
Diffstat (limited to 'ArmVirtPkg')
0 files changed, 0 insertions, 0 deletions