From: Gleb Natapov Subject: [PATCH 1/6] KVM: MMU: make spte_is_locklessly_modifiable() more clear Date: Wed, 30 Jan 2013 16:45:00 +0200 Message-ID: <1359557105-30821-2-git-send-email-gleb@redhat.com> References: <1359557105-30821-1-git-send-email-gleb@redhat.com> Cc: mtosatti@redhat.com, xiaoguangrong@linux.vnet.ibm.com, yoshikawa_takuya_b1@lab.ntt.co.jp To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:19097 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754892Ab3A3OpU (ORCPT ); Wed, 30 Jan 2013 09:45:20 -0500 In-Reply-To: <1359557105-30821-1-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- arch/x86/kvm/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 1.7.10.4