[PATCH] virtio-iommu: depend on PCI

Paolo Bonzini posted 1 patch 4 years, 1 month ago
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test checkpatch passed
Test FreeBSD passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200320104147.643941-1-pbonzini@redhat.com
hw/virtio/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] virtio-iommu: depend on PCI
Posted by Paolo Bonzini 4 years, 1 month ago
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.

Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/virtio/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/Kconfig b/hw/virtio/Kconfig
index d29525b36f..83122424fa 100644
--- a/hw/virtio/Kconfig
+++ b/hw/virtio/Kconfig
@@ -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.24.1


Re: [PATCH] virtio-iommu: depend on PCI
Posted by Auger Eric 4 years, 1 month ago
Hi Paolo

On 3/20/20 11:41 AM, Paolo Bonzini wrote:
> 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 (?)

Acked-by: Eric Auger <eric.auger@redhat.com>

Thanks


Eric

> 
> Reported-by: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/virtio/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/Kconfig b/hw/virtio/Kconfig
> index d29525b36f..83122424fa 100644
> --- a/hw/virtio/Kconfig
> +++ b/hw/virtio/Kconfig
> @@ -12,7 +12,7 @@ config VIRTIO_RNG
>  config VIRTIO_IOMMU
>      bool
>      default y
> -    depends on VIRTIO
> +    depends on PCI && VIRTIO
>  
>  config VIRTIO_PCI
>      bool
> 


Re: [PATCH] virtio-iommu: depend on PCI
Posted by Paolo Bonzini 4 years, 1 month ago
On 20/03/20 11:54, Auger Eric wrote:
>> 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

> Acked-by: Eric Auger <eric.auger@redhat.com>
> 
> Thanks


Re: [PATCH] virtio-iommu: depend on PCI
Posted by Philippe Mathieu-Daudé 4 years, 1 month ago
On 3/20/20 11:41 AM, Paolo Bonzini wrote:
> 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.
> 
> Reported-by: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   hw/virtio/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/Kconfig b/hw/virtio/Kconfig
> index d29525b36f..83122424fa 100644
> --- a/hw/virtio/Kconfig
> +++ b/hw/virtio/Kconfig
> @@ -12,7 +12,7 @@ config VIRTIO_RNG
>   config VIRTIO_IOMMU
>       bool
>       default y
> -    depends on VIRTIO
> +    depends on PCI && VIRTIO
>   
>   config VIRTIO_PCI
>       bool
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

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


Re: [PATCH] virtio-iommu: depend on PCI
Posted by Auger Eric 4 years, 1 month ago
Hi Philippe,

On 3/20/20 12:26 PM, Philippe Mathieu-Daudé wrote:
> On 3/20/20 11:41 AM, Paolo Bonzini wrote:
>> 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.
>>
>> Reported-by: Gerd Hoffmann <kraxel@redhat.com>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>   hw/virtio/Kconfig | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/virtio/Kconfig b/hw/virtio/Kconfig
>> index d29525b36f..83122424fa 100644
>> --- a/hw/virtio/Kconfig
>> +++ b/hw/virtio/Kconfig
>> @@ -12,7 +12,7 @@ config VIRTIO_RNG
>>   config VIRTIO_IOMMU
>>       bool
>>       default y
>> -    depends on VIRTIO
>> +    depends on PCI && VIRTIO
>>     config VIRTIO_PCI
>>       bool
>>
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 
> 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

>