From patchwork Wed Jun 10 16:23:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Izik Eidus X-Patchwork-Id: 29323 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 n5AGOdBR015274 for ; Wed, 10 Jun 2009 16:24:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752822AbZFJQYc (ORCPT ); Wed, 10 Jun 2009 12:24:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752757AbZFJQYc (ORCPT ); Wed, 10 Jun 2009 12:24:32 -0400 Received: from mx2.redhat.com ([66.187.237.31]:44704 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751798AbZFJQYc (ORCPT ); Wed, 10 Jun 2009 12:24:32 -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 n5AGOYWW031955 for ; Wed, 10 Jun 2009 12:24:34 -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 n5AGOXuu009806; Wed, 10 Jun 2009 12:24:34 -0400 Received: from localhost.localdomain (dhcp-0-239.tlv.redhat.com [10.35.0.239]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5AGOTqF028933; Wed, 10 Jun 2009 12:24:31 -0400 From: Izik Eidus To: kvm@vger.kernel.org Cc: avi@redhat.com, Izik Eidus Subject: [PATCH 1/2] kvm: fix dirty bit tracking for slots with large pages Date: Wed, 10 Jun 2009 19:23:24 +0300 Message-Id: <1244651005-18322-2-git-send-email-ieidus@redhat.com> In-Reply-To: <1244651005-18322-1-git-send-email-ieidus@redhat.com> References: <1244651005-18322-1-git-send-email-ieidus@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 When slot is already allocted and being asked to be tracked we need to break the large pages. This code flush the mmu when someone ask a slot to start dirty bit tracking. Signed-off-by: Izik Eidus --- virt/kvm/kvm_main.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 669eb4a..3046e9c 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1194,6 +1194,8 @@ int __kvm_set_memory_region(struct kvm *kvm, if (!new.dirty_bitmap) goto out_free; memset(new.dirty_bitmap, 0, dirty_bytes); + if (old.npages) + kvm_arch_flush_shadow(kvm); } #endif /* not defined CONFIG_S390 */