From patchwork Wed Jun 10 11:51:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Izik Eidus X-Patchwork-Id: 29258 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 n5ABqvxj024191 for ; Wed, 10 Jun 2009 11:52:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755968AbZFJLwi (ORCPT ); Wed, 10 Jun 2009 07:52:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755957AbZFJLwi (ORCPT ); Wed, 10 Jun 2009 07:52:38 -0400 Received: from mx2.redhat.com ([66.187.237.31]:42968 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755408AbZFJLwh (ORCPT ); Wed, 10 Jun 2009 07:52:37 -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 n5ABqee9027941 for ; Wed, 10 Jun 2009 07:52:40 -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 n5ABqdiQ021363; Wed, 10 Jun 2009 07:52:39 -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 n5ABqZJb009830; Wed, 10 Jun 2009 07:52:37 -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 14:51:30 +0300 Message-Id: <1244634691-9765-2-git-send-email-ieidus@redhat.com> In-Reply-To: <1244634691-9765-1-git-send-email-ieidus@redhat.com> References: <1244634691-9765-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..4a60c72 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1160,6 +1160,8 @@ int __kvm_set_memory_region(struct kvm *kvm, new.userspace_addr = mem->userspace_addr; else new.userspace_addr = 0; + + kvm_arch_flush_shadow(kvm); } if (npages && !new.lpage_info) { largepages = 1 + (base_gfn + npages - 1) / KVM_PAGES_PER_HPAGE;