From patchwork Wed Jun 10 11:28:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 29252 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5ABST2g019910 for ; Wed, 10 Jun 2009 11:28:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754784AbZFJL2Y (ORCPT ); Wed, 10 Jun 2009 07:28:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755330AbZFJL2Y (ORCPT ); Wed, 10 Jun 2009 07:28:24 -0400 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 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5ABSOWB010787; Wed, 10 Jun 2009 07:28:24 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5ABSNfs006398; Wed, 10 Jun 2009 07:28:23 -0400 Received: from localhost.localdomain (cleopatra.tlv.redhat.com [10.35.255.11]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id E243A250AC0; Wed, 10 Jun 2009 14:28:22 +0300 (IDT) From: Avi Kivity To: Marcelo Tosatti Cc: kvm@vger.kernel.org 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> In-Reply-To: <1244633302-27545-1-git-send-email-avi@redhat.com> References: <1244633302-27545-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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)