From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kzgyz-0002Db-NF for qemu-devel@nongnu.org; Mon, 10 Nov 2008 19:19:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kzgyy-0002Cn-LN for qemu-devel@nongnu.org; Mon, 10 Nov 2008 19:19:48 -0500 Received: from [199.232.76.173] (port=41145 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kzgyy-0002Ck-BI for qemu-devel@nongnu.org; Mon, 10 Nov 2008 19:19:48 -0500 Received: from mx2.redhat.com ([66.187.237.31]:39759) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kzgyy-00087w-5r for qemu-devel@nongnu.org; Mon, 10 Nov 2008 19:19:48 -0500 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 mAB0Jl73029313 for ; Mon, 10 Nov 2008 19:19:47 -0500 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 mAB0Jk4q031711 for ; Mon, 10 Nov 2008 19:19:47 -0500 Received: from localhost.localdomain (vpn-12-7.rdu.redhat.com [10.11.12.7]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id mAB0JgV0023994 for ; Mon, 10 Nov 2008 19:19:46 -0500 From: Glauber Costa Date: Tue, 11 Nov 2008 00:16:07 -0200 Message-Id: <1226369769-5109-4-git-send-email-glommer@redhat.com> In-Reply-To: <1226369769-5109-3-git-send-email-glommer@redhat.com> References: <1226369769-5109-1-git-send-email-glommer@redhat.com> <1226369769-5109-2-git-send-email-glommer@redhat.com> <1226369769-5109-3-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH 3/5] de-register mem region for MMIO. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Besides unassigned memory, we also don't care about MMIO. So if we're giving an MMIO area that is already registered, wipe it out. Signed-off-by: Glauber Costa --- kvm-all.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 4379071..6d50609 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -317,7 +317,8 @@ void kvm_set_phys_mem(target_phys_addr_t start_addr, mem = kvm_lookup_slot(s, start_addr); if (mem) { - if (flags == IO_MEM_UNASSIGNED) { + if ((flags == IO_MEM_UNASSIGNED) || (flags >= TLB_MMIO)) { + dprintf("deleting memory %llx with flags %d\n", mem->guest_phys_addr, mem->flags); mem->memory_size = 0; mem->guest_phys_addr = start_addr; mem->userspace_addr = 0; -- 1.5.6.5