From 6b182403ee45ed579db544d074d2acf344025f71 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 10 Jan 2023 10:10:06 +0100 Subject: vfio-mdev: allow building the samples into the kernel There is nothing in the vfio-mdev sample drivers that requires building them as modules, so remove that restriction. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Tony Krowiak Link: https://lore.kernel.org/r/20230110091009.474427-2-hch@lst.de Signed-off-by: Alex Williamson --- samples/Kconfig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'samples/Kconfig') diff --git a/samples/Kconfig b/samples/Kconfig index 0d81c00289ee..f1b8d4ff1230 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -184,23 +184,23 @@ config SAMPLE_UHID Build UHID sample program. config SAMPLE_VFIO_MDEV_MTTY - tristate "Build VFIO mtty example mediated device sample code -- loadable modules only" - depends on VFIO_MDEV && m + tristate "Build VFIO mtty example mediated device sample code" + depends on VFIO_MDEV help Build a virtual tty sample driver for use as a VFIO mediated device config SAMPLE_VFIO_MDEV_MDPY - tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" - depends on VFIO_MDEV && m + tristate "Build VFIO mdpy example mediated device sample code" + depends on VFIO_MDEV help Build a virtual display sample driver for use as a VFIO mediated device. It is a simple framebuffer and supports the region display interface (VFIO_GFX_PLANE_TYPE_REGION). config SAMPLE_VFIO_MDEV_MDPY_FB - tristate "Build VFIO mdpy example guest fbdev driver -- loadable module only" - depends on FB && m + tristate "Build VFIO mdpy example guest fbdev driver" + depends on FB select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT @@ -208,8 +208,8 @@ config SAMPLE_VFIO_MDEV_MDPY_FB Guest fbdev driver for the virtual display sample driver. config SAMPLE_VFIO_MDEV_MBOCHS - tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" - depends on VFIO_MDEV && m + tristate "Build VFIO mdpy example mediated device sample code" + depends on VFIO_MDEV select DMA_SHARED_BUFFER help Build a virtual display sample driver for use as a VFIO -- cgit From 8bf8c5ee1f3863d944c1d8c29335f0c790b4f851 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 10 Jan 2023 10:10:07 +0100 Subject: vfio-mdev: turn VFIO_MDEV into a selectable symbol VFIO_MDEV is just a library with helpers for the drivers. Stop making it a user choice and just select it by the drivers that use the helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Tony Krowiak Link: https://lore.kernel.org/r/20230110091009.474427-3-hch@lst.de Signed-off-by: Alex Williamson --- samples/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'samples/Kconfig') diff --git a/samples/Kconfig b/samples/Kconfig index f1b8d4ff1230..56b191d128d8 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -185,14 +185,14 @@ config SAMPLE_UHID config SAMPLE_VFIO_MDEV_MTTY tristate "Build VFIO mtty example mediated device sample code" - depends on VFIO_MDEV + select VFIO_MDEV help Build a virtual tty sample driver for use as a VFIO mediated device config SAMPLE_VFIO_MDEV_MDPY tristate "Build VFIO mdpy example mediated device sample code" - depends on VFIO_MDEV + select VFIO_MDEV help Build a virtual display sample driver for use as a VFIO mediated device. It is a simple framebuffer and supports @@ -209,7 +209,7 @@ config SAMPLE_VFIO_MDEV_MDPY_FB config SAMPLE_VFIO_MDEV_MBOCHS tristate "Build VFIO mdpy example mediated device sample code" - depends on VFIO_MDEV + select VFIO_MDEV select DMA_SHARED_BUFFER help Build a virtual display sample driver for use as a VFIO -- cgit From de858a05c9d8cecfb294d3cb89e491a36b8688fd Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Thu, 26 Jan 2023 22:08:31 +0100 Subject: vfio-mdev: add back CONFIG_VFIO dependency CONFIG_VFIO_MDEV cannot be selected when VFIO itself is disabled, otherwise we get a link failure: WARNING: unmet direct dependencies detected for VFIO_MDEV Depends on [n]: VFIO [=n] Selected by [y]: - SAMPLE_VFIO_MDEV_MTTY [=y] && SAMPLES [=y] - SAMPLE_VFIO_MDEV_MDPY [=y] && SAMPLES [=y] - SAMPLE_VFIO_MDEV_MBOCHS [=y] && SAMPLES [=y] /home/arnd/cross/arm64/gcc-13.0.1-nolibc/x86_64-linux/bin/x86_64-linux-ld: samples/vfio-mdev/mdpy.o: in function `mdpy_remove': mdpy.c:(.text+0x1e1): undefined reference to `vfio_unregister_group_dev' /home/arnd/cross/arm64/gcc-13.0.1-nolibc/x86_64-linux/bin/x86_64-linux-ld: samples/vfio-mdev/mdpy.o: in function `mdpy_probe': mdpy.c:(.text+0x149e): undefined reference to `_vfio_alloc_device' Fixes: 8bf8c5ee1f38 ("vfio-mdev: turn VFIO_MDEV into a selectable symbol") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230126211211.1762319-1-arnd@kernel.org Signed-off-by: Alex Williamson --- samples/Kconfig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'samples/Kconfig') diff --git a/samples/Kconfig b/samples/Kconfig index 56b191d128d8..44a09dfa8a0b 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -185,6 +185,7 @@ config SAMPLE_UHID config SAMPLE_VFIO_MDEV_MTTY tristate "Build VFIO mtty example mediated device sample code" + depends on VFIO select VFIO_MDEV help Build a virtual tty sample driver for use as a VFIO @@ -192,6 +193,7 @@ config SAMPLE_VFIO_MDEV_MTTY config SAMPLE_VFIO_MDEV_MDPY tristate "Build VFIO mdpy example mediated device sample code" + depends on VFIO select VFIO_MDEV help Build a virtual display sample driver for use as a VFIO @@ -209,6 +211,7 @@ config SAMPLE_VFIO_MDEV_MDPY_FB config SAMPLE_VFIO_MDEV_MBOCHS tristate "Build VFIO mdpy example mediated device sample code" + depends on VFIO select VFIO_MDEV select DMA_SHARED_BUFFER help -- cgit From e951eaaf839921165b0622bc5338c7bf24131812 Mon Sep 17 00:00:00 2001 From: ye xingchen Date: Mon, 30 Jan 2023 10:13:51 +0800 Subject: samples: fix the prompt about SAMPLE_VFIO_MDEV_MBOCHS Change the prompt about SAMPLE_VFIO_MDEV_MBOCHS as 'Build VFIO mbochs example mediated device sample code'. Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/202301301013518438986@zte.com.cn Signed-off-by: Alex Williamson --- samples/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'samples/Kconfig') diff --git a/samples/Kconfig b/samples/Kconfig index 44a09dfa8a0b..2cdbf9b70d67 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -210,7 +210,7 @@ config SAMPLE_VFIO_MDEV_MDPY_FB Guest fbdev driver for the virtual display sample driver. config SAMPLE_VFIO_MDEV_MBOCHS - tristate "Build VFIO mdpy example mediated device sample code" + tristate "Build VFIO mbochs example mediated device sample code" depends on VFIO select VFIO_MDEV select DMA_SHARED_BUFFER -- cgit