From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YINPt-0000k1-RI for qemu-devel@nongnu.org; Mon, 02 Feb 2015 15:16:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YINPo-00017Z-Nj for qemu-devel@nongnu.org; Mon, 02 Feb 2015 15:16:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YINPo-00017V-Ev for qemu-devel@nongnu.org; Mon, 02 Feb 2015 15:16:12 -0500 Message-ID: <1422908165.22865.419.camel@redhat.com> From: Alex Williamson Date: Mon, 02 Feb 2015 13:16:05 -0700 In-Reply-To: <8c9d087c2a0bbcddfcb938a87ca35f461dd2613a.1422433767.git.chen.fan.fnst@cn.fujitsu.com> References: <8c9d087c2a0bbcddfcb938a87ca35f461dd2613a.1422433767.git.chen.fan.fnst@cn.fujitsu.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v2 8/8] vfio-pci: add VFIO_FEATURE_ENABLE_AER_CAP feature List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chen Fan Cc: marcel@redhat.com, izumi.taku@jp.fujitsu.com, qemu-devel@nongnu.org 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 > --- > 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 */