KVM: MMU: make spte_is_locklessly_modifiable() more clear
authorGleb Natapov <gleb@redhat.com>
Wed, 30 Jan 2013 14:45:00 +0000 (16:45 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Tue, 5 Feb 2013 01:24:28 +0000 (23:24 -0200)
spte_is_locklessly_modifiable() checks that both SPTE_HOST_WRITEABLE and
SPTE_MMU_WRITEABLE are present on spte. Make it more explicit.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/mmu.c

index 9f628f7..2fa82b0 100644 (file)
@@ -448,7 +448,8 @@ static bool __check_direct_spte_mmio_pf(u64 spte)
 
 static bool spte_is_locklessly_modifiable(u64 spte)
 {
-       return !(~spte & (SPTE_HOST_WRITEABLE | SPTE_MMU_WRITEABLE));
+       return (spte & (SPTE_HOST_WRITEABLE | SPTE_MMU_WRITEABLE)) ==
+               (SPTE_HOST_WRITEABLE | SPTE_MMU_WRITEABLE);
 }
 
 static bool spte_has_volatile_bits(u64 spte)