Skip to contentSkip to conversation

virtio-iommu: depend on PCI

PATCH In review Paolo Bonzini 3 participants 5 messages Mar 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-iommu: depend on PCI

The virtio-iommu device attaches itself to a PCI bus, so it makes no sense to include it unless PCI is supported---and in fact compilation fails without this change.

---
 hw/virtio/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/Kconfig +1 -1
index d29525b36f..83122424fa 100644
@@ -12,7 +12,7 @@ config VIRTIO_RNG
 config VIRTIO_IOMMU
     bool
     default y
-    depends on VIRTIO
+    depends on PCI && VIRTIO
 
 config VIRTIO_PCI
     bool
Signature · 1 line
2.24.1
Acked-by on v1 1/1
#1 lore raw

Hi Paolo

Quoted 3 lines · Paolo Bonzini

The virtio-iommu device attaches itself to a PCI bus, so it makes no sense to include it unless PCI is supported---and in fact compilation fails without this change.

with the --- cleanup (?)

Thanks

Eric

Quoted 21 lines
---
 hw/virtio/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/Kconfig +1 -1
index d29525b36f..83122424fa 100644
@@ -12,7 +12,7 @@ config VIRTIO_RNG
 config VIRTIO_IOMMU
     bool
     default y
-    depends on VIRTIO
+    depends on PCI && VIRTIO
 
 config VIRTIO_PCI
     bool
#2 lore raw
Quoted 4 lines · Auger Eric
Quoted 3 lines

The virtio-iommu device attaches itself to a PCI bus, so it makes no sense to include it unless PCI is supported---and in fact compilation fails without this change.

with the --- cleanup (?)

Fails if PCI is not included but virtio-iommu is.

Paolo

Quoted 3 lines

Thanks

Reviewed-by on v1 1/1
#3 lore raw
In reply to Paolo Bonzini
Quoted 16 lines · Paolo Bonzini

The virtio-iommu device attaches itself to a PCI bus, so it makes no sense to include it unless PCI is supported---and in fact compilation fails without this change.

---
  hw/virtio/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/Kconfig +0 -0
index d29525b36f..83122424fa 100644

hw/virtio/Kconfig config VIRTIO_RNG · line 18

Quoted 8 lines
hw/virtio/Kconfig +1 -1
@@ -12,7 +12,7 @@ config VIRTIO_RNG
  config VIRTIO_IOMMU
      bool
      default y
-    depends on VIRTIO
+    depends on PCI && VIRTIO
 
  config VIRTIO_PCI
      bool

I see hw/virtio/virtio-iommu-pci.c apart, what is the difference?

#4 lore raw

Hi Philippe,

Quoted 27 lines · Philippe Mathieu-Daudé
Quoted 15 lines · Paolo Bonzini

The virtio-iommu device attaches itself to a PCI bus, so it makes no sense to include it unless PCI is supported---and in fact compilation fails without this change.

---
  hw/virtio/Kconfig | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/Kconfig +0 -0
index d29525b36f..83122424fa 100644
@@ -12,7 +12,7 @@ config VIRTIO_RNG
Quoted 8 lines

  config VIRTIO_IOMMU
      bool
      default y
-    depends on VIRTIO
+    depends on PCI && VIRTIO
    config VIRTIO_PCI
      bool

Quoted 1 line

I see hw/virtio/virtio-iommu-pci.c apart, what is the difference?

That's the virtio-iommu pci proxy whereas TYPE_VIRTIO_IOMMU inherits from TYPE_VIRTIO_DEVICE.

The virtio-iommu device could also be instantiated directly as a TYPE_VIRTIO_IOMMU device but that's not the choice eventually made for machvirt.

Thanks

Eric

Quoted 1 line