[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v13 07/13] vfio: add aer support for vfio device
From: |
Alex Williamson |
Subject: |
Re: [Qemu-devel] [PATCH v13 07/13] vfio: add aer support for vfio device |
Date: |
Wed, 11 Nov 2015 13:49:36 -0700 |
On Wed, 2015-11-11 at 18:34 +0800, Cao jin wrote:
> From: Chen Fan <address@hidden>
>
> Calling pcie_aer_init to initilize aer related registers for
> vfio device, then reload physical related registers to expose
> device capability.
>
> Signed-off-by: Chen Fan <address@hidden>
> ---
What if VFIO_FEATURE_ENABLE_AER is enabled for a device that doesn't
posses an AER capability or isn't attached to a PCIe bus? It appears
that we silently ignore it, which would lead to unregistering a hotplug
notifier that was never registered in 09/13 and needing to test both
VFIO_FEATURE_ENABLE_AER and exp.aer_cap in 12/13 as well as the
inconsistency that we often only test for VFIO_FEATURE_ENABLE_AER when
really we expect that to imply that AER is setup and enabled for the
device. It seems like we need to error either within
vfio_add_capabilities() or after calling it if VFIO_FEATURE_ENABLE_AER
is specified but not configured. If a user expects AER to be enabled
for a device by specifying aer=on, we need to fail if that's not
possible.
> hw/vfio/pci.c | 82
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
> hw/vfio/pci.h | 3 +++
> 2 files changed, 82 insertions(+), 3 deletions(-)
>
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index 4bc2b51..2d34edf 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -1806,6 +1806,68 @@ static int vfio_add_std_cap(VFIOPCIDevice *vdev,
> uint8_t pos)
...
> +
> + pcie_cap_deverr_init(pdev);
> + ret = pcie_aer_init(pdev, pos, size);
> + if (ret) {
> + return ret;
> + }
This branch is unnecessary, we can simply:
return pcie_aer_init(pdev, pos, size);
if we get this far. Thanks,
Alex
- [Qemu-devel] [PATCH v13 00/13] vfio-pci: pass the aer error to guest, Cao jin, 2015/11/11
- [Qemu-devel] [PATCH v13 02/13] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset, Cao jin, 2015/11/11
- [Qemu-devel] [PATCH v13 01/13] vfio: extract vfio_get_hot_reset_info as a single function, Cao jin, 2015/11/11
- [Qemu-devel] [PATCH v13 03/13] pcie: modify the capability size assert, Cao jin, 2015/11/11
- [Qemu-devel] [PATCH v13 04/13] vfio: make the 4 bytes aligned for capability size, Cao jin, 2015/11/11
- [Qemu-devel] [PATCH v13 06/13] aer: impove pcie_aer_init to support vfio device, Cao jin, 2015/11/11
- [Qemu-devel] [PATCH v13 07/13] vfio: add aer support for vfio device, Cao jin, 2015/11/11
- Re: [Qemu-devel] [PATCH v13 07/13] vfio: add aer support for vfio device,
Alex Williamson <=
- [Qemu-devel] [PATCH v13 05/13] vfio: add pcie extanded capability support, Cao jin, 2015/11/11
- [Qemu-devel] [PATCH v13 10/13] pci: add pci device pre-post reset callbacks for host bus reset, Cao jin, 2015/11/11
- [Qemu-devel] [PATCH v13 09/13] add check reset mechanism when hotplug vfio device, Cao jin, 2015/11/11