From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzZpF-0003Zt-Ql for qemu-devel@nongnu.org; Mon, 10 Nov 2008 11:41:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzZpB-0003Yh-13 for qemu-devel@nongnu.org; Mon, 10 Nov 2008 11:41:17 -0500 Received: from [199.232.76.173] (port=54505 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzZpA-0003YV-TB for qemu-devel@nongnu.org; Mon, 10 Nov 2008 11:41:12 -0500 Received: from mx2.redhat.com ([66.187.237.31]:54719) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KzZpA-0001Sk-6A for qemu-devel@nongnu.org; Mon, 10 Nov 2008 11:41:12 -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 mAAGfAN3004053 for ; Mon, 10 Nov 2008 11:41:11 -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 mAAGfApI001052 for ; Mon, 10 Nov 2008 11:41:10 -0500 Received: from localhost.localdomain (vpn-14-56.rdu.redhat.com [10.11.14.56]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id mAAGf7Jt030654 for ; Mon, 10 Nov 2008 11:41:09 -0500 From: Glauber Costa Date: Mon, 10 Nov 2008 16:37:31 -0200 Message-Id: <1226342253-8887-3-git-send-email-glommer@redhat.com> In-Reply-To: <1226342253-8887-2-git-send-email-glommer@redhat.com> References: <1226342253-8887-1-git-send-email-glommer@redhat.com> <1226342253-8887-2-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH] 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