From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4qvL-0001Hk-ER for qemu-devel@nongnu.org; Mon, 23 May 2016 10:33:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4qvF-0004Ak-MQ for qemu-devel@nongnu.org; Mon, 23 May 2016 10:33:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4qvF-0004Ae-GP for qemu-devel@nongnu.org; Mon, 23 May 2016 10:33:33 -0400 References: <1464012090-6477-1-git-send-email-marcel@redhat.com> <1464012090-6477-2-git-send-email-marcel@redhat.com> <7f013bce-0831-df33-77b2-7d37a2e920fe@redhat.com> <5743120A.703@gmail.com> From: Paolo Bonzini Message-ID: Date: Mon, 23 May 2016 16:33:23 +0200 MIME-Version: 1.0 In-Reply-To: <5743120A.703@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC 1/2] hw/pci: delay bus_master_enable_region initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcel@redhat.com, qemu-devel@nongnu.org Cc: davidkiarie4@gmail.com, bd.aviv@gmail.com, ehabkost@redhat.com, peterx@redhat.com, mst@redhat.com On 23/05/2016 16:22, Marcel Apfelbaum wrote: > On 05/23/2016 05:08 PM, Paolo Bonzini wrote: >> >> >> On 23/05/2016 16:01, Marcel Apfelbaum wrote: >>> Skip bus_master_enable region creation on PCI devices init >>> in order to be sure the IOMMU device (if present) would >>> be created in advance. Add this memory region at machine_done time. >>> >>> Signed-off-by: Marcel Apfelbaum >>> --- >>> hw/i386/pc.c | 17 +++++++++++++++++ >>> hw/pci/pci.c | 22 ++++++++++++---------- >>> include/hw/pci/pci.h | 2 ++ >>> 3 files changed, 31 insertions(+), 10 deletions(-) >> >> Does hotplug still work? > > Hotplug does work, but the device can't be bus_master since I am adding > the bus_master_region only at machine_done... > > Thank you for pointing that out, this can be easily solved by checking > the qdev_hotplug flag and enabling the bus_master region if we passed > machine creation. > > Other than that, does it seems to a you a feasible approach? Yes, I guess it's okay. Thanks, Paolo