[Qemu-devel] [PATCH 47/52] vfio: express vfio dependencies with Kconfig

Paolo Bonzini posted 52 patches 7 years ago
Maintainers: Eduardo Habkost <ehabkost@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Palmer Dabbelt <palmer@sifive.com>, Max Filippov <jcmvbkbc@gmail.com>, Alistair Francis <alistair@alistair23.me>, Guan Xuetao <gxt@mprc.pku.edu.cn>, Max Reitz <mreitz@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Igor Mammedov <imammedo@redhat.com>, Aleksandar Markovic <amarkovic@wavecomp.com>, Fam Zheng <fam@euphon.net>, Cornelia Huck <cohuck@redhat.com>, Peter Crosthwaite <crosthwaite.peter@gmail.com>, Gerd Hoffmann <kraxel@redhat.com>, Aleksandar Rikalo <arikalo@wavecomp.com>, Corey Minyard <minyard@acm.org>, Sagar Karandikar <sagark@eecs.berkeley.edu>, Alex Williamson <alex.williamson@redhat.com>, Alberto Garcia <berto@igalia.com>, Anthony Green <green@moxielogic.com>, Jason Wang <jasowang@redhat.com>, Aurelien Jarno <aurelien@aurel32.net>, Richard Henderson <rth@twiddle.net>, Greg Kurz <groug@kaod.org>, "Daniel P. Berrangé" <berrange@redhat.com>, Alistair Francis <Alistair.Francis@wdc.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Michael Clark <mjc@sifive.com>, Kevin Wolf <kwolf@redhat.com>, Chris Wulff <crwulff@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Stafford Horne <shorne@gmail.com>, Michael Walle <michael@walle.cc>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, David Hildenbrand <david@redhat.com>, Marek Vasut <marex@denx.de>, Paolo Bonzini <pbonzini@redhat.com>, David Gibson <david@gibson.dropbear.id.au>, Peter Maydell <peter.maydell@linaro.org>, Halil Pasic <pasic@linux.ibm.com>, Stefan Berger <stefanb@linux.ibm.com>, John Snow <jsnow@redhat.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Christian Borntraeger <borntraeger@de.ibm.com>, Artyom Tarasenko <atar4qemu@gmail.com>, Cleber Rosa <crosa@redhat.com>
There is a newer version of this series
[Qemu-devel] [PATCH 47/52] vfio: express vfio dependencies with Kconfig
Posted by Paolo Bonzini 7 years ago
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/vfio/Kconfig | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/hw/vfio/Kconfig b/hw/vfio/Kconfig
index f896779..ebda9fd 100644
--- a/hw/vfio/Kconfig
+++ b/hw/vfio/Kconfig
@@ -7,28 +7,30 @@ config VFIO_PCI
     select VFIO
     depends on LINUX
 
-config VFIO_SPAPR
-    bool
-    default y
-    depends on VFIO && LINUX && PSERIES
-
 config VFIO_CCW
     bool
+    default y
     select VFIO
-    depends on LINUX
+    depends on LINUX && S390_CCW_VIRTIO
 
 config VFIO_PLATFORM
     bool
+    default y
     select VFIO
-    depends on LINUX
+    depends on LINUX && PLATFORM_BUS
 
 config VFIO_XGMAC
     bool
+    default y
+    depends on VFIO_PLATFORM
 
 config VFIO_AMD_XGBE
     bool
+    default y
+    depends on VFIO_PLATFORM
 
 config VFIO_AP
     bool
+    default y
     select VFIO
-    depends on LINUX
+    depends on LINUX && S390_CCW_VIRTIO
-- 
1.8.3.1



Re: [Qemu-devel] [PATCH 47/52] vfio: express vfio dependencies with Kconfig
Posted by Alex Williamson 7 years ago
On Fri, 25 Jan 2019 11:07:06 +0100
Paolo Bonzini <pbonzini@redhat.com> wrote:

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/vfio/Kconfig | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/vfio/Kconfig b/hw/vfio/Kconfig
> index f896779..ebda9fd 100644
> --- a/hw/vfio/Kconfig
> +++ b/hw/vfio/Kconfig
> @@ -7,28 +7,30 @@ config VFIO_PCI
>      select VFIO
>      depends on LINUX
>  
> -config VFIO_SPAPR
> -    bool
> -    default y
> -    depends on VFIO && LINUX && PSERIES


I can't say I really understand what happened with this through the
course of the series.  In patch 27 spapr.o became obj-y, VFIO_SPAPR
came about in patch 32, tweaked in patch 33, then removed in 47.  I was
really hoping the Makefile was going to reflect this as a config option
so we could follow-up with some patches to stub or ifdef out the
dependencies.  The remainder here seems to set the right precedent and
we can add VFIO_SPAPR back later and wire it through the Makefile.

Unfortunately with the full series applied I'm not able to make either
allnoconfig or defconfig:

$ make allnoconfig
  GEN     x86_64-softmmu/config-devices.mak.tmp
  GEN     x86_64-softmmu/config-devices.mak
  GEN     config-all-devices.mak
	CHK version_gen.h
	CHK version_gen.h
rm */config-devices.mak config-all-devices.mak
make MINIKCONF="python -B /home/alwillia/Work/qemu.git/scripts/minikconf.py  --" config-all-devices.mak
make[1]: Entering directory '/home/alwillia/Work/qemu.git'
  GEN     x86_64-softmmu/config-devices.mak.tmp
/home/alwillia/Work/qemu.git/scripts/minikconf.py: invalid option --
	CHK version_gen.h
make[1]: *** No rule to make target 'x86_64-softmmu/config-devices.mak', needed by 'config-all-devices.mak'.  Stop.
make[1]: Leaving directory '/home/alwillia/Work/qemu.git'
make: *** [Makefile:346: allnoconfig] Error 2

Something wrong with this expansion from patch 34 I guess:

.PHONY: allnoconfig defconfig
allnoconfig defconfig:
        rm */config-devices.mak config-all-devices.mak
        $(MAKE) MINIKCONF="$(MINIKCONF) --$<" config-all-devices.mak

Thanks,
Alex

> -
>  config VFIO_CCW
>      bool
> +    default y
>      select VFIO
> -    depends on LINUX
> +    depends on LINUX && S390_CCW_VIRTIO
>  
>  config VFIO_PLATFORM
>      bool
> +    default y
>      select VFIO
> -    depends on LINUX
> +    depends on LINUX && PLATFORM_BUS
>  
>  config VFIO_XGMAC
>      bool
> +    default y
> +    depends on VFIO_PLATFORM
>  
>  config VFIO_AMD_XGBE
>      bool
> +    default y
> +    depends on VFIO_PLATFORM
>  
>  config VFIO_AP
>      bool
> +    default y
>      select VFIO
> -    depends on LINUX
> +    depends on LINUX && S390_CCW_VIRTIO


Re: [Qemu-devel] [PATCH 47/52] vfio: express vfio dependencies with Kconfig
Posted by Paolo Bonzini 7 years ago
On 25/01/19 21:00, Alex Williamson wrote:
>>  
>> -config VFIO_SPAPR
>> -    bool
>> -    default y
>> -    depends on VFIO && LINUX && PSERIES
> 
> I can't say I really understand what happened with this through the
> course of the series.  In patch 27 spapr.o became obj-y, VFIO_SPAPR
> came about in patch 32, tweaked in patch 33, then removed in 47.

Oops, that's a rebasing issue that I messed out when I finally got
ppc64-softmmu to build with the series.  I initially assumed that
spapr.o was not needed for non-pseries machines, but as you say below it
is not stubbed yet if not needed.

> .PHONY: allnoconfig defconfig
> allnoconfig defconfig:
>         rm */config-devices.mak config-all-devices.mak
>         $(MAKE) MINIKCONF="$(MINIKCONF) --$<" config-all-devices.mak

This seemed to work here (besides the fact that "rm" should have been
"rm -f").  The makefile needs some work apparently.

Paolo