qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: lvivier@redhat.com, thuth@redhat.com, mdroth@linux.vnet.ibm.com,
	aik@ozlabs.ru, qemu-devel@nongnu.org, gwshan@linux.vnet.ibm.com,
	qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH 09/14] vfio: Expose a VFIO PCI device's group for EEH
Date: Wed, 23 Sep 2015 11:28:43 -0600	[thread overview]
Message-ID: <1443029323.23936.484.camel@redhat.com> (raw)
In-Reply-To: <1442647117-2726-10-git-send-email-david@gibson.dropbear.id.au>

On Sat, 2015-09-19 at 17:18 +1000, David Gibson wrote:
> The Enhanced Error Handling (EEH) interface in PAPR operates on units of a
> Partitionable Endpoint (PE).  For VFIO devices, the PE boundaries the guest
> sees must match the PE (i.e. IOMMU group) boundaries on the host.  To
> implement this VFIO needs to expose to EEH the IOMMU group each VFIO device
> belongs to.
> 
> Add a vfio_pci_device_group() function to the VFIO/EEH interface for this
> purpose.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
>  hw/vfio/pci.c              | 13 +++++++++++++
>  include/hw/vfio/vfio-eeh.h |  1 +
>  2 files changed, 14 insertions(+)
> 
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index 73d34b9..29f9467 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -41,6 +41,7 @@
>  #include "trace.h"
>  #include "hw/vfio/vfio.h"
>  #include "hw/vfio/vfio-common.h"
> +#include "hw/vfio/vfio-eeh.h"


Why?  EEH may be the consumer, but it's not EEH specific, it should not
have the prototype in an EEH specific header.

>  
>  struct VFIOPCIDevice;
>  
> @@ -3351,6 +3352,18 @@ static void vfio_unregister_req_notifier(VFIOPCIDevice *vdev)
>      vdev->req_enabled = false;
>  }
>  
> +VFIOGroup *vfio_pci_device_group(PCIDevice *pdev)
> +{
> +    VFIOPCIDevice *vdev;
> +
> +    if (!object_dynamic_cast(OBJECT(pdev), "vfio-pci")) {
> +        return NULL;
> +    }
> +
> +    vdev = DO_UPCAST(VFIOPCIDevice, pdev, pdev);
> +    return vdev->vbasedev.group;
> +}
> +
>  /*
>   * AMD Radeon PCI config reset, based on Linux:
>   *   drivers/gpu/drm/radeon/ci_smc.c:ci_is_smc_running()
> diff --git a/include/hw/vfio/vfio-eeh.h b/include/hw/vfio/vfio-eeh.h
> index d7356f2..0ea87e1 100644
> --- a/include/hw/vfio/vfio-eeh.h
> +++ b/include/hw/vfio/vfio-eeh.h
> @@ -38,5 +38,6 @@
>  typedef struct VFIOGroup VFIOGroup;
>  
>  int vfio_eeh_op(VFIOGroup *group, uint32_t op);
> +VFIOGroup *vfio_pci_device_group(PCIDevice *pdev);
>  
>  #endif /* VFIO_EEH_H */

  reply	other threads:[~2015-09-23 17:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-19  7:18 [Qemu-devel] [RFC PATCH 00/14] Allow EEH on "normal" sPAPR PCI host bridge David Gibson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 01/14] vfio: Start adding VFIO/EEH interface David Gibson
2015-09-23 17:28   ` Alex Williamson
2015-09-24  1:11     ` David Gibson
2015-09-24  2:12       ` Alex Williamson
2015-09-24  4:09         ` David Gibson
2015-09-24  5:45           ` Thomas Huth
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 02/14] spapr_pci: Switch EEH to vfio_eeh_op() interface David Gibson
2015-09-23 17:28   ` Alex Williamson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 03/14] spapr_pci: Expose and generalize spapr_phb_check_vfio_group() David Gibson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 04/14] spapr_pci: Fold spapr_phb_vfio_eeh_configure() into spapr_pci code David Gibson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 05/14] spapr_pci: Fold spapr_phb_vfio_eeh_reset() " David Gibson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 06/14] spapr_pci: Fold spapr_phb_vfio_eeh_get_state() " David Gibson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 07/14] spapr_pci: Fold spapr_phb_vfio_eeh_set_option() " David Gibson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 08/14] spapr_pci: Fold spapr_phb_vfio_eeh_configure() " David Gibson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 09/14] vfio: Expose a VFIO PCI device's group for EEH David Gibson
2015-09-23 17:28   ` Alex Williamson [this message]
2015-09-24  1:16     ` David Gibson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 10/14] spapr_pci: Track guest Partitionable Endpoints David Gibson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 11/14] spapr_pci: Allow EEH on spapr-pci-host-bridge David Gibson
2015-09-23 17:28   ` Alex Williamson
2015-09-24  1:49     ` David Gibson
2015-09-24  2:19       ` Alex Williamson
2015-09-24  4:11         ` David Gibson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 12/14] spapr_pci: (Mostly) remove spapr-pci-vfio-host-bridge David Gibson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 13/14] spapr_pci: Remove finish_realize hook David Gibson
2015-09-19  7:18 ` [Qemu-devel] [RFC PATCH 14/14] vfio: Eliminate vfio_container_ioctl() 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=1443029323.23936.484.camel@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=lvivier@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).