From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCRY0-0005In-Fz for qemu-devel@nongnu.org; Mon, 13 Jun 2016 09:04:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCRXw-0007Ep-4X for qemu-devel@nongnu.org; Mon, 13 Jun 2016 09:04:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCRXv-0007Ed-VA for qemu-devel@nongnu.org; Mon, 13 Jun 2016 09:04:52 -0400 Date: Mon, 13 Jun 2016 21:04:43 +0800 From: Peter Xu Message-ID: <20160613130443.GP1039@pxdev.xzpeter.org> References: <1464898555-14914-1-git-send-email-marcel@redhat.com> <1464898555-14914-3-git-send-email-marcel@redhat.com> <20160612042754.GN1039@pxdev.xzpeter.org> <575E88DB.2020603@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <575E88DB.2020603@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 2/3] hw/iommu: enable iommu with -device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: qemu-devel@nongnu.org, mst@redhat.com, pbonzini@redhat.com, ehabkost@redhat.com, davidkiarie4@gmail.com, jan.kiszka@web.de, bd.aviv@gmail.com, alex.williamson@redhat.com On Mon, Jun 13, 2016 at 01:20:11PM +0300, Marcel Apfelbaum wrote: > On 06/12/2016 07:27 AM, Peter Xu wrote: > >On Thu, Jun 02, 2016 at 11:15:54PM +0300, Marcel Apfelbaum wrote: > > > >[...] > > > >> static void vtd_realize(DeviceState *dev, Error **errp) > >> { > >>+ PCIBus *bus = PC_MACHINE(qdev_get_machine())->bus; > >> IntelIOMMUState *s = INTEL_IOMMU_DEVICE(dev); > >> > >> VTD_DPRINTF(GENERAL, ""); > >>@@ -2029,6 +2043,9 @@ static void vtd_realize(DeviceState *dev, Error **errp) > >> s->vtd_as_by_busptr = g_hash_table_new_full(vtd_uint64_hash, vtd_uint64_equal, > >> g_free, g_free); > >> vtd_init(s); > >>+ sysbus_mmio_map(SYS_BUS_DEVICE(s), 0, Q35_HOST_BRIDGE_IOMMU_ADDR); > >>+ bus->iommu_fn = vtd_host_dma_iommu; > >>+ bus->iommu_opaque = dev; > > > >Here, shall we still use pci_setup_iommu() to keep the two fields > >private for pci framework? > > > > I've already spotted it and took care of it, thanks :) ! Cool. :) Btw, have we removed MachineState.iommu variable as well? > > >Btw, I am rebasing Intel IR work onto this patchset, but encountered > >issues (guest hang, or errornous interrupts) when guest specify more > >than 1 vcpus (everything is cool as long as vcpu=1). Maybe there is > >something wrong during the rebase, still investigating. Please shoot > >if there is any clue. > > > > I am running with 2 vcpus and I didn't see any problem, I'll let you > know if can reproduce. My fault during rebase. It's very easy to lost lines of codes during rebase, especially where there is function move from one place to another, while in which function I did some changes... It's all good now. Thanks! -- peterx