From: Gleb Natapov Date: Wed, 30 Jan 2013 14:45:00 +0000 (+0200) Subject: KVM: MMU: make spte_is_locklessly_modifiable() more clear X-Git-Tag: v3.9-rc1~97^2~7^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=feb3eb704a86d97edb296502e95da42d622dac61;p=platform%2Fkernel%2Flinux-exynos.git KVM: MMU: make spte_is_locklessly_modifiable() more clear 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 Signed-off-by: Marcelo Tosatti --- diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 9f628f7..2fa82b0 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -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)