summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorNadav Amit2014-11-02 10:54:52 +0100
committerPaolo Bonzini2014-11-07 15:44:07 +0100
commit9d88fca71a99a65c37cbfe481b4aa4e91a27ff13 (patch)
tree9e698aa68ff7b8cbabcdcda3b3d1ac46d86636b3 /arch/x86/kvm/x86.c
parentKVM: x86: Emulate push sreg as done in Core (diff)
downloadkernel-qcow2-linux-9d88fca71a99a65c37cbfe481b4aa4e91a27ff13.tar.gz
kernel-qcow2-linux-9d88fca71a99a65c37cbfe481b4aa4e91a27ff13.tar.xz
kernel-qcow2-linux-9d88fca71a99a65c37cbfe481b4aa4e91a27ff13.zip
KVM: x86: MOV to CR3 can set bit 63
Although Intel SDM mentions bit 63 is reserved, MOV to CR3 can have bit 63 set. As Intel SDM states in section 4.10.4 "Invalidation of TLBs and Paging-Structure Caches": " MOV to CR3. ... If CR4.PCIDE = 1 and bit 63 of the instruction’s source operand is 0 ..." In other words, bit 63 is not reserved. KVM emulator currently consider bit 63 as reserved. Fix it. Signed-off-by: Nadav Amit <namit@cs.technion.ac.il> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 773c17ec42dd..641358865a0c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -750,6 +750,8 @@ EXPORT_SYMBOL_GPL(kvm_set_cr4);
int kvm_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
{
+ cr3 &= ~CR3_PCID_INVD;
+
if (cr3 == kvm_read_cr3(vcpu) && !pdptrs_changed(vcpu)) {
kvm_mmu_sync_roots(vcpu);
kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu);