qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Cc: marcel@redhat.com, izumi.taku@jp.fujitsu.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC v2 8/8] vfio-pci: add VFIO_FEATURE_ENABLE_AER_CAP feature
Date: Mon, 02 Feb 2015 13:16:05 -0700	[thread overview]
Message-ID: <1422908165.22865.419.camel@redhat.com> (raw)
In-Reply-To: <8c9d087c2a0bbcddfcb938a87ca35f461dd2613a.1422433767.git.chen.fan.fnst@cn.fujitsu.com>

On Wed, 2015-01-28 at 16:37 +0800, Chen Fan wrote:
> for old machine types, we should disable aercap feature.
> 
> Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
> ---
>  hw/vfio/pci.c       | 13 ++++++++++---
>  include/hw/compat.h |  4 ++++
>  2 files changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index 65247ee..0d830e6 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -138,6 +138,8 @@ typedef struct VFIOMSIXInfo {
>  enum {
>  #define VFIO_FEATURE_ENABLE_VGA_BIT 0
>      VFIO_FEATURE_ENABLE_VGA = (1 << VFIO_FEATURE_ENABLE_VGA_BIT),
> +#define VFIO_FEATURE_ENABLE_AER_CAP_BIT 1
> +    VFIO_FEATURE_ENABLE_AER_CAP = (1 << VFIO_FEATURE_ENABLE_AER_CAP_BIT),
>  };
>  
>  typedef struct VFIOPCIDevice {
> @@ -2724,10 +2726,12 @@ static int vfio_add_ext_capabilities(VFIOPCIDevice *vdev)
>      while (header) {
>          switch (PCI_EXT_CAP_ID(header)) {
>          case PCI_EXT_CAP_ID_ERR:
> -             exp = &pdev->exp;
> -             exp->aer_cap = next;
> +             if (vdev->features & VFIO_FEATURE_ENABLE_AER_CAP) {
> +                 exp = &pdev->exp;
> +                 exp->aer_cap = next;
>  
> -             vfio_pci_aer_init(vdev);
> +                 vfio_pci_aer_init(vdev);
> +	     }
>               break;
>          };
>  
> @@ -3498,6 +3502,9 @@ static Property vfio_pci_dev_properties[] = {
>      DEFINE_PROP_BIT("x-vga", VFIOPCIDevice, features,
>                      VFIO_FEATURE_ENABLE_VGA_BIT, false),
>      DEFINE_PROP_INT32("bootindex", VFIOPCIDevice, bootindex, -1),
> +    DEFINE_PROP_BIT("aercap", VFIOPCIDevice, features,
> +                    VFIO_FEATURE_ENABLE_AER_CAP_BIT, true),
> +
>      /*
>       * TODO - support passed fds... is this necessary?
>       * DEFINE_PROP_STRING("vfiofd", VFIOPCIDevice, vfiofd_name),
> diff --git a/include/hw/compat.h b/include/hw/compat.h
> index 313682a..72a2cdb 100644
> --- a/include/hw/compat.h
> +++ b/include/hw/compat.h
> @@ -30,6 +30,10 @@
>              .driver   = "virtio-pci",\
>              .property = "virtio-pci-bus-master-bug-migration",\
>              .value    = "on",\
> +        },{\
> +            .driver   = "vfio-pci",\
> +            .property = "aercap",\
> +            .value    = "off",\

This will leave it enabled on both Q35 and 440FX afaict, so I'm not sure
what this fixes.  We don't care about migration compatibility with
vfio-pci.

>          }
>  
>  #endif /* HW_COMPAT_H */

      reply	other threads:[~2015-02-02 20:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28  8:37 [Qemu-devel] [RFC v2 0/8] pass aer error to guest for vfio device Chen Fan
2015-01-28  8:37 ` [Qemu-devel] [RFC v2 1/8] pcie_aer: fix typos in pcie_aer_inject_error comment Chen Fan
2015-01-28  8:37 ` [Qemu-devel] [RFC v2 2/8] vfio-pci: add aer capability support Chen Fan
2015-02-02 20:15   ` Alex Williamson
2015-02-06  7:03     ` Chen Fan
2015-02-06 13:43       ` Alex Williamson
2015-01-28  8:37 ` [Qemu-devel] [RFC v2 3/8] pcie_aer: expose pcie_aer_msg() interface Chen Fan
2015-01-28  8:37 ` [Qemu-devel] [RFC v2 4/8] vfio-pci: pass the aer error to guest Chen Fan
2015-02-02 20:16   ` Alex Williamson
2015-02-06  7:06     ` Chen Fan
2015-01-28  8:37 ` [Qemu-devel] [RFC v2 5/8] pcie_aer: fix a trivial typo in PCIEAERMsg comments Chen Fan
2015-01-28  8:37 ` [Qemu-devel] [RFC v2 6/8] vfio_pci: fix a wrong check in vfio_pci_reset Chen Fan
2015-02-02 20:16   ` Alex Williamson
2015-02-04  9:54     ` Chen Fan
2015-02-04 13:53       ` Alex Williamson
2015-01-28  8:37 ` [Qemu-devel] [RFC v2 7/8] vfio_pci: change vfio device features bit macro to enum definition Chen Fan
2015-02-02 20:15   ` Alex Williamson
2015-01-28  8:37 ` [Qemu-devel] [RFC v2 8/8] vfio-pci: add VFIO_FEATURE_ENABLE_AER_CAP feature Chen Fan
2015-02-02 20:16   ` Alex Williamson [this message]

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=1422908165.22865.419.camel@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=chen.fan.fnst@cn.fujitsu.com \
    --cc=izumi.taku@jp.fujitsu.com \
    --cc=marcel@redhat.com \
    --cc=qemu-devel@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 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).