From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfMCs-000502-AL for qemu-devel@nongnu.org; Sat, 18 Oct 2014 01:05:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XfMCj-0006HX-23 for qemu-devel@nongnu.org; Sat, 18 Oct 2014 01:05:34 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:42967) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfMCi-0006HE-Iv for qemu-devel@nongnu.org; Sat, 18 Oct 2014 01:05:24 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 18 Oct 2014 06:05:20 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8B0381B08023 for ; Sat, 18 Oct 2014 06:06:36 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s9I55Hmo17301760 for ; Sat, 18 Oct 2014 05:05:17 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s9I55G4I021476 for ; Fri, 17 Oct 2014 23:05:16 -0600 From: Frank Blaschka Date: Sat, 18 Oct 2014 07:04:49 +0200 Message-Id: <1413608689-62203-1-git-send-email-blaschka@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH] vfio: fix adding memory listener to the right address space List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: alex.williamson@redhat.com Cc: Frank Blaschka , qemu-devel@nongnu.org Depending on the device, container->space->as contains the valid AddressSpace. Using address_space_memory breaks devices sitting behind an iommu (and using a separate address space). Signed-off-by: Frank Blaschka --- hw/misc/vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c index d66f3d2..fcc1958 100644 --- a/hw/misc/vfio.c +++ b/hw/misc/vfio.c @@ -3703,7 +3703,7 @@ static int vfio_connect_container(VFIOGroup *group, AddressSpace *as) container->iommu_data.release = vfio_listener_release; memory_listener_register(&container->iommu_data.type1.listener, - &address_space_memory); + container->space->as); if (container->iommu_data.type1.error) { ret = container->iommu_data.type1.error; -- 1.8.5.5