[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 15/15] hw/nvme: Update the initalization place for the AER que
From: |
Lukasz Maniak |
Subject: |
[PATCH v4 15/15] hw/nvme: Update the initalization place for the AER queue |
Date: |
Wed, 26 Jan 2022 18:11:20 +0100 |
From: Łukasz Gieryk <lukasz.gieryk@linux.intel.com>
This patch updates the initialization place for the AER queue, so it’s
initialized once, at controller initialization, and not every time
controller is enabled.
While the original version works for a non-SR-IOV device, as it’s hard
to interact with the controller if it’s not enabled, the multiple
reinitialization is not necessarily correct.
With the SR/IOV feature enabled a segfault can happen: a VF can have its
controller disabled, while a namespace can still be attached to the
controller through the parent PF. An event generated in such case ends
up on an uninitialized queue.
While it’s an interesting question whether a VF should support AER in
the first place, I don’t think it must be answered today.
Signed-off-by: Łukasz Gieryk <lukasz.gieryk@linux.intel.com>
---
hw/nvme/ctrl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 624db2f9c6..b2228e960f 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -6029,8 +6029,6 @@ static int nvme_start_ctrl(NvmeCtrl *n)
nvme_set_timestamp(n, 0ULL);
- QTAILQ_INIT(&n->aer_queue);
-
nvme_select_iocs(n);
return 0;
@@ -7007,6 +7005,8 @@ static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice
*pci_dev)
id->cmic |= NVME_CMIC_MULTI_CTRL;
}
+ QTAILQ_INIT(&n->aer_queue);
+
NVME_CAP_SET_MQES(cap, 0x7ff);
NVME_CAP_SET_CQR(cap, 1);
NVME_CAP_SET_TO(cap, 0xf);
--
2.25.1
- [PATCH v4 06/15] hw/nvme: Add support for Primary Controller Capabilities, (continued)
- [PATCH v4 06/15] hw/nvme: Add support for Primary Controller Capabilities, Lukasz Maniak, 2022/01/26
- [PATCH v4 04/15] pcie: Add 1.2 version token for the Power Management Capability, Lukasz Maniak, 2022/01/26
- [PATCH v4 05/15] hw/nvme: Add support for SR-IOV, Lukasz Maniak, 2022/01/26
- [PATCH v4 08/15] hw/nvme: Implement the Function Level Reset, Lukasz Maniak, 2022/01/26
- [PATCH v4 07/15] hw/nvme: Add support for Secondary Controller List, Lukasz Maniak, 2022/01/26
- [PATCH v4 11/15] hw/nvme: Calculate BAR attributes in a function, Lukasz Maniak, 2022/01/26
- [PATCH v4 12/15] hw/nvme: Initialize capability structures for primary/secondary controllers, Lukasz Maniak, 2022/01/26
- [PATCH v4 09/15] hw/nvme: Make max_ioqpairs and msix_qsize configurable in runtime, Lukasz Maniak, 2022/01/26
- [PATCH v4 10/15] hw/nvme: Remove reg_size variable and update BAR0 size calculation, Lukasz Maniak, 2022/01/26
- [PATCH v4 14/15] docs: Add documentation for SR-IOV and Virtualization Enhancements, Lukasz Maniak, 2022/01/26
- [PATCH v4 15/15] hw/nvme: Update the initalization place for the AER queue,
Lukasz Maniak <=
- [PATCH v4 13/15] hw/nvme: Add support for the Virtualization Management command, Lukasz Maniak, 2022/01/26