[PATCH kvmtool v2 12/12] virtio/pci: Remove VIRTIO_PCI_F_SIGNAL_MSI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



VIRTIO_PCI_F_SIGNAL_MSI is not a virtio feature but an internal flag.
Change it to bool to avoid confusion.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@xxxxxxx>
---
 include/kvm/virtio-pci.h | 4 +---
 virtio/pci.c             | 8 ++++----
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/include/kvm/virtio-pci.h b/include/kvm/virtio-pci.h
index 4590d1b3..143028b1 100644
--- a/include/kvm/virtio-pci.h
+++ b/include/kvm/virtio-pci.h
@@ -20,8 +20,6 @@ struct virtio_pci_ioevent_param {
 	u32			vq;
 };
 
-#define VIRTIO_PCI_F_SIGNAL_MSI (1 << 0)
-
 #define ALIGN_UP(x, s)		ALIGN((x) + (s) - 1, (s))
 #define VIRTIO_NR_MSIX		(VIRTIO_PCI_MAX_VQ + VIRTIO_PCI_MAX_CONFIG)
 #define VIRTIO_MSIX_TABLE_SIZE	(VIRTIO_NR_MSIX * 16)
@@ -36,11 +34,11 @@ struct virtio_pci {
 	struct kvm		*kvm;
 
 	u32			doorbell_offset;
+	bool			signal_msi;
 	u8			status;
 	u8			isr;
 	u32			device_features_sel;
 	u32			driver_features_sel;
-	u32			features;
 
 	/*
 	 * We cannot rely on the INTERRUPT_LINE byte in the config space once
diff --git a/virtio/pci.c b/virtio/pci.c
index cffabc76..701f4566 100644
--- a/virtio/pci.c
+++ b/virtio/pci.c
@@ -28,7 +28,7 @@ int virtio_pci__add_msix_route(struct virtio_pci *vpci, u32 vec)
 	 * We don't need IRQ routing if we can use
 	 * MSI injection via the KVM_SIGNAL_MSI ioctl.
 	 */
-	if (gsi == -ENXIO && vpci->features & VIRTIO_PCI_F_SIGNAL_MSI)
+	if (gsi == -ENXIO && vpci->signal_msi)
 		return gsi;
 
 	if (gsi < 0)
@@ -234,7 +234,7 @@ int virtio_pci__signal_vq(struct kvm *kvm, struct virtio_device *vdev, u32 vq)
 			return 0;
 		}
 
-		if (vpci->features & VIRTIO_PCI_F_SIGNAL_MSI)
+		if (vpci->signal_msi)
 			virtio_pci__signal_msi(kvm, vpci, vpci->vq_vector[vq]);
 		else
 			kvm__irq_trigger(kvm, vpci->gsis[vq]);
@@ -258,7 +258,7 @@ int virtio_pci__signal_config(struct kvm *kvm, struct virtio_device *vdev)
 			return 0;
 		}
 
-		if (vpci->features & VIRTIO_PCI_F_SIGNAL_MSI)
+		if (vpci->signal_msi)
 			virtio_pci__signal_msi(kvm, vpci, tbl);
 		else
 			kvm__irq_trigger(kvm, vpci->config_gsi);
@@ -409,7 +409,7 @@ int virtio_pci__init(struct kvm *kvm, void *dev, struct virtio_device *vdev,
 	memset(vpci->vq_vector, 0xff, sizeof(vpci->vq_vector));
 
 	if (irq__can_signal_msi(kvm))
-		vpci->features |= VIRTIO_PCI_F_SIGNAL_MSI;
+		vpci->signal_msi = true;
 
 	vpci->legacy_irq_line = pci__assign_irq(&vpci->pci_hdr);
 
-- 
2.36.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux