From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMbQf-0006Ws-Bg for qemu-devel@nongnu.org; Wed, 27 Aug 2014 07:30:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMbQX-00041v-Td for qemu-devel@nongnu.org; Wed, 27 Aug 2014 07:30:17 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:65195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMbQX-0003vy-Oc for qemu-devel@nongnu.org; Wed, 27 Aug 2014 07:30:09 -0400 Received: by mail-pa0-f41.google.com with SMTP id rd3so91972pab.28 for ; Wed, 27 Aug 2014 04:30:03 -0700 (PDT) Message-ID: <53FDC133.10402@ozlabs.ru> Date: Wed, 27 Aug 2014 21:29:55 +1000 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <20140826164024.30771.55532.stgit@bahia.lab.toulouse-stg.fr.ibm.com> <53FDB993.8060907@suse.de> In-Reply-To: <53FDB993.8060907@suse.de> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] spapr_pci: turn IOMMU root into an I/O region List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , Greg Kurz Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 08/27/2014 08:57 PM, Alexander Graf wrote: > > > On 26.08.14 18:40, Greg Kurz wrote: >> On sPAPR, virtio devices are connected to the PCI bus and use MSI-X. >> Commit cc943c36faa192cd4b32af8fe5edb31894017d35 has modified MSI-X >> so that writes are made using the bus master address space. >> Unfortunately, the MSI-X notification hits unassigned_mem_write and >> never reaches the guest... The most visible effect is that all >> virtio devices are non-fonctionnal on sPAPR. :( >> >> This patch plugs the MSI memory ops to the root IOMMU region, and >> virtio devices work again. I am not sure this is the right way to >> fix: please comment and enlight ! >> >> Signed-off-by: Greg Kurz >> --- >> hw/ppc/spapr_pci.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c >> index 9ed39a9..b638a3c 100644 >> --- a/hw/ppc/spapr_pci.c >> +++ b/hw/ppc/spapr_pci.c >> @@ -599,8 +599,9 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp) >> */ >> sprintf(namebuf, "%s.iommu-root", sphb->dtbusname); >> >> - memory_region_init(&sphb->iommu_root, OBJECT(sphb), >> - namebuf, UINT64_MAX); >> + memory_region_init_io(&sphb->iommu_root, OBJECT(sphb), >> + &spapr_msi_ops, spapr, >> + namebuf, UINT64_MAX); > > This will turn all unallocated accesses in iommu_root into calls to > spapr_msi_ops, no? It should not, the window is small. > Can't we instead just populate the iommu_root memory region with the MSI > subregion? Makes sense to me. Having one global MSI window sounds like my bug, I just did not any good reason for having it per PHB :) -- Alexey