From: Avi Kivity Subject: [PATCH 1/3] KVM: MMU: Fix is_dirty_pte() Date: Wed, 10 Jun 2009 14:28:20 +0300 Message-ID: <1244633302-27545-2-git-send-email-avi@redhat.com> References: <1244633302-27545-1-git-send-email-avi@redhat.com> Cc: kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:58663 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753170AbZFJL2W (ORCPT ); Wed, 10 Jun 2009 07:28:22 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5ABSPpY022811 for ; Wed, 10 Jun 2009 07:28:25 -0400 In-Reply-To: <1244633302-27545-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: is_dirty_pte() is used on guest ptes, not shadow ptes, so it needs to avoid shadow_dirty_mask and use PT_DIRTY_MASK instead. Misdetecting dirty pages could lead to unnecessarily setting the dirty bit under EPT. Signed-off-by: Avi Kivity --- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 809cce0..8e5003c 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -242,7 +242,7 @@ static int is_writeble_pte(unsigned long pte) static int is_dirty_pte(unsigned long pte) { - return pte & shadow_dirty_mask; + return pte & PT_DIRTY_MASK; } static int is_rmap_pte(u64 pte) -- 1.6.0.6