ARM: KVM: Fix size check in __coherent_cache_guest_page
authorJan Kiszka <jan.kiszka@siemens.com>
Sat, 7 Feb 2015 21:21:20 +0000 (22:21 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 23 Feb 2015 21:28:47 +0000 (22:28 +0100)
The check is supposed to catch page-unaligned sizes, not the inverse.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm/include/asm/kvm_mmu.h

index 37ca2a4c6f0944598cacb0fbdab33c716258ea4e..bf0fe99e8ca927e8b3894dabaf1e1fca9f079c3d 100644 (file)
@@ -207,7 +207,7 @@ static inline void __coherent_cache_guest_page(struct kvm_vcpu *vcpu, pfn_t pfn,
 
        bool need_flush = !vcpu_has_cache_enabled(vcpu) || ipa_uncached;
 
-       VM_BUG_ON(size & PAGE_MASK);
+       VM_BUG_ON(size & ~PAGE_MASK);
 
        if (!need_flush && !icache_is_pipt())
                goto vipt_cache;