[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v4 6/9] vfio: add 'x-aer' option to disable aer capabi
From: |
Chen Fan |
Subject: |
[Qemu-devel] [RFC v4 6/9] vfio: add 'x-aer' option to disable aer capability |
Date: |
Mon, 2 Mar 2015 15:16:09 +0800 |
add 'x-aer' option to disable aer capability if user
want.
Signed-off-by: Chen Fan <address@hidden>
---
hw/vfio/pci.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index db4ba23..5471437 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -156,6 +156,8 @@ typedef struct VFIOPCIDevice {
uint32_t features;
#define VFIO_FEATURE_ENABLE_VGA_BIT 0
#define VFIO_FEATURE_ENABLE_VGA (1 << VFIO_FEATURE_ENABLE_VGA_BIT)
+#define VFIO_FEATURE_ENABLE_AER_BIT 1
+#define VFIO_FEATURE_ENABLE_AER (1 << VFIO_FEATURE_ENABLE_AER_BIT)
int32_t bootindex;
uint8_t pm_cap;
bool has_vga;
@@ -2728,6 +2730,10 @@ static int vfio_setup_aer(VFIOPCIDevice *vdev, uint8_t
cap_ver,
uint32_t severity;
int ret;
+ if (!(vdev->features & VFIO_FEATURE_ENABLE_AER)) {
+ return 0;
+ }
+
pdev->exp.aer_log.log_max = PCIE_AER_LOG_MAX_DEFAULT;
ret = pcie_aer_init(pdev, cap_ver, pos, size);
if (ret) {
@@ -3569,6 +3575,8 @@ static Property vfio_pci_dev_properties[] = {
intx.mmap_timeout, 1100),
DEFINE_PROP_BIT("x-vga", VFIOPCIDevice, features,
VFIO_FEATURE_ENABLE_VGA_BIT, false),
+ DEFINE_PROP_BIT("x-aer", VFIOPCIDevice, features,
+ VFIO_FEATURE_ENABLE_AER_BIT, true),
DEFINE_PROP_INT32("bootindex", VFIOPCIDevice, bootindex, -1),
/*
* TODO - support passed fds... is this necessary?
--
1.9.3
- [Qemu-devel] [RFC v4 0/9] pass aer error to guest for vfio device, Chen Fan, 2015/03/02
- [Qemu-devel] [RFC v4 7/9] pcie_aer: expose pcie_aer_msg() interface, Chen Fan, 2015/03/02
- [Qemu-devel] [RFC v4 5/9] vfio: add aer support for vfio device, Chen Fan, 2015/03/02
- [Qemu-devel] [RFC v4 8/9] vfio-pci: pass the aer error to guest, Chen Fan, 2015/03/02
- [Qemu-devel] [RFC v4 9/9] pcie: fix several trivial typos, Chen Fan, 2015/03/02
- Re: [Qemu-devel] [RFC v4 0/9] pass aer error to guest for vfio device, Chen Fan, 2015/03/08