From: Bandan Das Date: Tue, 12 Jul 2016 22:18:48 +0000 (-0400) Subject: kvm: mmu: extend the is_present check to 32 bits X-Git-Tag: v4.8-rc1~60^2~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d5cf1610da526c3c1286bd7b3ac9f35f96ed43d;p=platform%2Fkernel%2Flinux-exynos.git kvm: mmu: extend the is_present check to 32 bits 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 Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 837bf23..55a20c0 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -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)