浏览代码

ARM: KVM: Fix size check in __coherent_cache_guest_page

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>
Jan Kiszka 10 年之前
父节点
当前提交
a050dfb21c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/arm/include/asm/kvm_mmu.h

+ 1 - 1
arch/arm/include/asm/kvm_mmu.h

@@ -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;