All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: aik@ozlabs.ru, 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, David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PATCH 09/12] spapr_pci: Allow EEH on spapr-pci-host-bridge
Date: Fri, 26 Feb 2016 22:32:00 +1100	[thread overview]
Message-ID: <1456486323-8047-10-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1456486323-8047-1-git-send-email-david@gibson.dropbear.id.au>

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 <david@gibson.dropbear.id.au>
---
 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 {
-- 
2.5.0

  parent reply	other threads:[~2016-02-26 11:31 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 11:31 [Qemu-devel] [PATCH 00/12] Allow EEH on spapr-pci-host-bridge devices David Gibson
2016-02-26 11:31 ` [Qemu-devel] [PATCH 01/12] vfio: Start improving VFIO/EEH interface David Gibson
2016-02-29  0:58   ` Alexey Kardashevskiy
2016-02-29  3:13     ` David Gibson
2016-02-26 11:31 ` [Qemu-devel] [PATCH 02/12] spapr_pci: Switch to vfio_eeh_as_op() interface David Gibson
2016-02-29  1:43   ` Alexey Kardashevskiy
2016-02-29  3:00     ` David Gibson
2016-02-26 11:31 ` [Qemu-devel] [PATCH 03/12] spapr_pci: Eliminate class callbacks David Gibson
2016-02-29  1:43   ` Alexey Kardashevskiy
2016-02-29  3:42     ` Alexey Kardashevskiy
2016-02-26 11:31 ` [Qemu-devel] [PATCH 04/12] spapr_pci: Fold spapr_phb_vfio_eeh_configure() into spapr_pci code David Gibson
2016-02-29  1:43   ` Alexey Kardashevskiy
2016-02-29  3:45     ` Alexey Kardashevskiy
2016-02-29  4:25       ` Alexey Kardashevskiy
2016-02-29  6:20         ` David Gibson
2016-02-26 11:31 ` [Qemu-devel] [PATCH 05/12] spapr_pci: Fold spapr_phb_vfio_eeh_reset() " David Gibson
2016-02-29  1:43   ` Alexey Kardashevskiy
2016-02-26 11:31 ` [Qemu-devel] [PATCH 06/12] spapr_pci: Fold spapr_phb_vfio_eeh_get_state() " David Gibson
2016-02-29  1:43   ` Alexey Kardashevskiy
2016-02-26 11:31 ` [Qemu-devel] [PATCH 07/12] spapr_pci: Fold spapr_phb_vfio_eeh_set_option() " David Gibson
2016-02-29  1:44   ` Alexey Kardashevskiy
2016-02-26 11:31 ` [Qemu-devel] [PATCH 08/12] spapr_pci: Fold spapr_phb_vfio_reset() " David Gibson
2016-02-29  1:44   ` Alexey Kardashevskiy
2016-02-26 11:32 ` David Gibson [this message]
2016-02-29  1:44   ` [Qemu-devel] [PATCH 09/12] spapr_pci: Allow EEH on spapr-pci-host-bridge Alexey Kardashevskiy
2016-02-26 11:32 ` [Qemu-devel] [PATCH 10/12] spapr_pci: (Mostly) remove spapr-pci-vfio-host-bridge David Gibson
2016-02-29  1:42   ` Alexey Kardashevskiy
2016-02-29  3:06     ` David Gibson
2016-02-26 11:32 ` [Qemu-devel] [PATCH 11/12] spapr_pci: Remove finish_realize hook David Gibson
2016-02-29  1:44   ` Alexey Kardashevskiy
2016-02-26 11:32 ` [Qemu-devel] [PATCH 12/12] vfio: Eliminate vfio_container_ioctl() David Gibson
2016-02-29  1:44   ` Alexey Kardashevskiy
2016-02-26 11:33 ` [Qemu-devel] [PATCH 00/12] Allow EEH on spapr-pci-host-bridge devices David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456486323-8047-10-git-send-email-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=alex.williamson@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=gwshan@au1.ibm.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.