[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/11] vfio: move re-enabling INTX out of the common helper
From: |
Alex Williamson |
Subject: |
[PULL 02/11] vfio: move re-enabling INTX out of the common helper |
Date: |
Fri, 06 May 2022 14:46:56 -0600 |
User-agent: |
StGit/1.0-8-g6af9-dirty |
From: Longpeng(Mike) <longpeng2@huawei.com>
Move re-enabling INTX out, and the callers should decide to
re-enable it or not.
Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
Link: https://lore.kernel.org/r/20220326060226.1892-3-longpeng2@huawei.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
hw/vfio/pci.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index cab1a6ef57f1..b3c27c22aaeb 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -693,7 +693,6 @@ retry:
static void vfio_msi_disable_common(VFIOPCIDevice *vdev)
{
- Error *err = NULL;
int i;
for (i = 0; i < vdev->nr_vectors; i++) {
@@ -712,15 +711,11 @@ static void vfio_msi_disable_common(VFIOPCIDevice *vdev)
vdev->msi_vectors = NULL;
vdev->nr_vectors = 0;
vdev->interrupt = VFIO_INT_NONE;
-
- vfio_intx_enable(vdev, &err);
- if (err) {
- error_reportf_err(err, VFIO_MSG_PREFIX, vdev->vbasedev.name);
- }
}
static void vfio_msix_disable(VFIOPCIDevice *vdev)
{
+ Error *err = NULL;
int i;
msix_unset_vector_notifiers(&vdev->pdev);
@@ -741,6 +736,10 @@ static void vfio_msix_disable(VFIOPCIDevice *vdev)
}
vfio_msi_disable_common(vdev);
+ vfio_intx_enable(vdev, &err);
+ if (err) {
+ error_reportf_err(err, VFIO_MSG_PREFIX, vdev->vbasedev.name);
+ }
memset(vdev->msix->pending, 0,
BITS_TO_LONGS(vdev->msix->entries) * sizeof(unsigned long));
@@ -750,8 +749,14 @@ static void vfio_msix_disable(VFIOPCIDevice *vdev)
static void vfio_msi_disable(VFIOPCIDevice *vdev)
{
+ Error *err = NULL;
+
vfio_disable_irqindex(&vdev->vbasedev, VFIO_PCI_MSI_IRQ_INDEX);
vfio_msi_disable_common(vdev);
+ vfio_intx_enable(vdev, &err);
+ if (err) {
+ error_reportf_err(err, VFIO_MSG_PREFIX, vdev->vbasedev.name);
+ }
trace_vfio_msi_disable(vdev->vbasedev.name);
}
- [PULL 00/11] Series short description, Alex Williamson, 2022/05/06
- [PULL 01/11] vfio: simplify the conditional statements in vfio_msi_enable, Alex Williamson, 2022/05/06
- [PULL 02/11] vfio: move re-enabling INTX out of the common helper,
Alex Williamson <=
- [PULL 03/11] vfio: simplify the failure path in vfio_msi_enable, Alex Williamson, 2022/05/06
- [PULL 04/11] Revert "vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration", Alex Williamson, 2022/05/06
- [PULL 05/11] vfio: defer to commit kvm irq routing when enable msi/msix, Alex Williamson, 2022/05/06
- [PULL 06/11] vfio/common: Fix a small boundary issue of a trace, Alex Williamson, 2022/05/06
- [PULL 07/11] sysemu: tpm: Add a stub function for TPM_IS_CRB, Alex Williamson, 2022/05/06
- [PULL 08/11] vfio/common: remove spurious tpm-crb-cmd misalignment warning, Alex Williamson, 2022/05/06
- [PULL 09/11] hw/vfio/pci: fix vfio_pci_hot_reset_result trace point, Alex Williamson, 2022/05/06