]> git.karo-electronics.de Git - linux-beck.git/commitdiff
kvm: mmu: extend the is_present check to 32 bits
authorBandan Das <bsd@redhat.com>
Tue, 12 Jul 2016 22:18:48 +0000 (18:18 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 14 Jul 2016 07:02:46 +0000 (09:02 +0200)
This is safe because this function is called
on host controlled page table and non-present/non-MMIO
sptes never use bits 1..31. For the EPT case, this
ensures that cases where only the execute bit is set
is marked valid.

Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.c

index 837bf23c5b067c02a9ca532408495c67012b073d..55a20c0524feafba41a9fb8907cb33cf17e12dd8 100644 (file)
@@ -304,7 +304,7 @@ static int is_nx(struct kvm_vcpu *vcpu)
 
 static int is_shadow_present_pte(u64 pte)
 {
-       return pte & PT_PRESENT_MASK && !is_mmio_spte(pte);
+       return (pte & 0xFFFFFFFFull) && !is_mmio_spte(pte);
 }
 
 static int is_large_pte(u64 pte)