]> git.ipfire.org Git - thirdparty/qemu.git/commit
x86: Clear MTRRs on vCPU reset
authorAlex Williamson <alex.williamson@redhat.com>
Thu, 14 Aug 2014 21:39:39 +0000 (15:39 -0600)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 10 Sep 2014 14:30:57 +0000 (09:30 -0500)
commit3e8966df025cf7e5ae1506c228879347054796ec
treed5baa30a72bda74b367caeffbcfdb2636b3a643d
parentba8576f338554004138a5a90d6563707336eb548
x86: Clear MTRRs on vCPU reset

The SDM specifies (June 2014 Vol3 11.11.5):

    On a hardware reset, the P6 and more recent processors clear the
    valid flags in variable-range MTRRs and clear the E flag in the
    IA32_MTRR_DEF_TYPE MSR to disable all MTRRs. All other bits in the
    MTRRs are undefined.

We currently do none of that, so whatever MTRR settings you had prior
to reset is what you have after reset.  Usually this doesn't matter
because KVM often ignores the guest mappings and uses write-back
anyway.  However, if you have an assigned device and an IOMMU that
allows NoSnoop for that device, KVM defers to the guest memory
mappings which are now stale after reset.  The result is that OVMF
rebooting on such a configuration takes a full minute to LZMA
decompress the firmware volume, a process that is nearly instant on
the initial boot.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 9db2efd95e13330075bff027cd682a063d725332)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target-i386/cpu.c