From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaCsw-0005wR-Vv for qemu-devel@nongnu.org; Sun, 28 Feb 2016 20:44:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaCss-0003dI-Q3 for qemu-devel@nongnu.org; Sun, 28 Feb 2016 20:44:30 -0500 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]:33649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaCss-0003d3-Ev for qemu-devel@nongnu.org; Sun, 28 Feb 2016 20:44:26 -0500 Received: by mail-pa0-x242.google.com with SMTP id y7so7795515paa.0 for ; Sun, 28 Feb 2016 17:44:26 -0800 (PST) References: <1456486323-8047-1-git-send-email-david@gibson.dropbear.id.au> <1456486323-8047-10-git-send-email-david@gibson.dropbear.id.au> From: Alexey Kardashevskiy Message-ID: <56D3A274.2040804@ozlabs.ru> Date: Mon, 29 Feb 2016 12:44:20 +1100 MIME-Version: 1.0 In-Reply-To: <1456486323-8047-10-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 09/12] spapr_pci: Allow EEH on spapr-pci-host-bridge List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , benh@kernel.crashing.org Cc: agraf@suse.de, qemu-devel@nongnu.org, gwshan@au1.ibm.com, mdroth@linux.vnet.ibm.com, alex.williamson@redhat.com, qemu-ppc@nongnu.org On 02/26/2016 10:32 PM, David Gibson wrote: > Now that the EEH code is independent of the special > spapr-vfio-pci-host-bridge device, we can allow it on all spapr PCI > host bridges instead. We do this by changing spapr_phb_eeh_available() > to be based on the vfio_eeh_as_ok() call instead of the host bridge class. > > Because the value of vfio_eeh_as_ok() can change with devices being > hotplugged or unplugged, this can potentially lead to some strange edge > cases where the guest starts using EEH, then it starts failing because > of a change in status. > > However, it's not really any worse than the current situation. Cases that > would have worked previously will still work (i.e. VFIO devices from at > most one VFIO IOMMU group per vPHB), it's just that it's no longer > necessary to use spapr-vfio-pci-host-bridge with the groupid pre-specified. > > Signed-off-by: David Gibson Reviewed-by: Alexey Kardashevskiy > --- > hw/ppc/spapr_pci.c | 5 +---- > hw/ppc/spapr_pci_vfio.c | 1 - > include/hw/pci-host/spapr.h | 1 - > 3 files changed, 1 insertion(+), 6 deletions(-) > > diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c > index be18bf6..336ffd2 100644 > --- a/hw/ppc/spapr_pci.c > +++ b/hw/ppc/spapr_pci.c > @@ -97,9 +97,7 @@ PCIDevice *spapr_pci_find_dev(sPAPRMachineState *spapr, uint64_t buid, > > static bool spapr_phb_eeh_available(sPAPRPHBState *sphb) > { > - sPAPRPHBClass *spc = SPAPR_PCI_HOST_BRIDGE_GET_CLASS(sphb); > - > - return spc->eeh_available; > + return vfio_eeh_as_ok(&sphb->iommu_as); > } > > static uint32_t rtas_pci_cfgaddr(uint32_t arg) > @@ -1680,7 +1678,6 @@ static void spapr_phb_class_init(ObjectClass *klass, void *data) > set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); > dc->cannot_instantiate_with_device_add_yet = false; > spc->finish_realize = spapr_phb_finish_realize; > - spc->eeh_available = false; > hp->plug = spapr_phb_hot_plug_child; > hp->unplug = spapr_phb_hot_unplug_child; > } > diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c > index 0a0f31a..ecbcc5c 100644 > --- a/hw/ppc/spapr_pci_vfio.c > +++ b/hw/ppc/spapr_pci_vfio.c > @@ -80,7 +80,6 @@ static void spapr_phb_vfio_class_init(ObjectClass *klass, void *data) > > dc->props = spapr_phb_vfio_properties; > spc->finish_realize = spapr_phb_vfio_finish_realize; > - spc->eeh_available = true; > } > > static const TypeInfo spapr_phb_vfio_info = { > diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h > index d32750e..9313209 100644 > --- a/include/hw/pci-host/spapr.h > +++ b/include/hw/pci-host/spapr.h > @@ -49,7 +49,6 @@ struct sPAPRPHBClass { > PCIHostBridgeClass parent_class; > > void (*finish_realize)(sPAPRPHBState *sphb, Error **errp); > - bool eeh_available; > }; > > typedef struct spapr_pci_msi { > -- Alexey