]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MTRR: observe maxphyaddr from guest CPUID, not host
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 14 Dec 2015 15:57:31 +0000 (16:57 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Dec 2015 14:28:56 +0000 (15:28 +0100)
commit31c71a4dcf9e8c5b97c8ec06a3389dc56ce3d9e0
tree62ffda16edba07ab21f4a7b486a00472ac174869
parenta1cd5df44945c27d62b76e7e1ee504d26c074958
KVM: MTRR: observe maxphyaddr from guest CPUID, not host

Conversion of MTRRs to ranges used the maxphyaddr from the boot CPU.
This is wrong, because var_mtrr_range's mask variable then is discontiguous
(like FF00FFFF000, where the first run of 0s corresponds to the bits
between host and guest maxphyaddr).  Instead always set up the masks
to be full 64-bit values---we know that the reserved bits at the top
are zero, and we can restore them when reading the MSR.  This way
var_mtrr_range gets a mask that just works.

Fixes: fe4ae4def8ea251406e6421ac3894e95e86587ba
Cc: qemu-stable@nongnu.org
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107561
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mtrr.c