]> 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)
commitc496249fc768d52d8e8faf1947a65fa8b8ae6cd1
tree62ffda16edba07ab21f4a7b486a00472ac174869
parent0cf4a244aea37511ac300530cd61119be2bc77f6
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: 178dfac7f2d6306f0e500222eefe98be4a9d1393
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