[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <663c7595-1c18-043e-5f12-b0ce880b84bf@linux.ibm.com>
Date: Mon, 15 Aug 2022 11:43:15 +0200
From: Pierre Morel <pmorel@...ux.ibm.com>
To: Randy Dunlap <rdunlap@...radead.org>, linux-kernel@...r.kernel.org
Cc: kernel test robot <lkp@...el.com>,
Matthew Rosato <mjrosato@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Eric Farman <farman@...ux.ibm.com>, linux-s390@...r.kernel.org,
kvm@...r.kernel.org
Subject: Re: [PATCH] vfio-pci/zdev: require KVM to be built-in
Thank you Randy for this good catch.
However forcing KVM to be include statically in the kernel when using
VFIO_PCI extensions is not a good solution for us I think.
I suggest we better do something like:
----
diff --git a/arch/s390/include/asm/kvm_host.h
b/arch/s390/include/asm/kvm_host.h
index 6287a843e8bc..1733339cc4eb 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -1038,7 +1038,7 @@ static inline void kvm_arch_vcpu_unblocking(struct
kvm_vcpu *vcpu) {}
#define __KVM_HAVE_ARCH_VM_FREE
void kvm_arch_free_vm(struct kvm *kvm);
-#ifdef CONFIG_VFIO_PCI_ZDEV_KVM
+#if defined(CONFIG_VFIO_PCI_ZDEV_KVM) ||
defined(CONFIG_VFIO_PCI_ZDEV_KVM_MODULE)
int kvm_s390_pci_register_kvm(struct zpci_dev *zdev, struct kvm *kvm);
void kvm_s390_pci_unregister_kvm(struct zpci_dev *zdev);
#else
diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig
index f9d0c908e738..bbc375b028ef 100644
--- a/drivers/vfio/pci/Kconfig
+++ b/drivers/vfio/pci/Kconfig
@@ -45,9 +45,9 @@ config VFIO_PCI_IGD
endif
config VFIO_PCI_ZDEV_KVM
- bool "VFIO PCI extensions for s390x KVM passthrough"
+ def_tristate y
+ prompt "VFIO PCI extensions for s390x KVM passthrough"
depends on S390 && KVM
- default y
help
Support s390x-specific extensions to enable support for
enhancements
to KVM passthrough capabilities, such as interpretive
execution of
----
What do you think? It seems to me it solves the problem, what do you think?
Regards,
Pierre
On 8/14/22 23:51, Randy Dunlap wrote:
> Fix build errors when CONFIG_KVM=m:
>
> s390-linux-ld: drivers/vfio/pci/vfio_pci_zdev.o: in function `vfio_pci_zdev_open_device':
> vfio_pci_zdev.c:(.text+0x242): undefined reference to `kvm_s390_pci_register_kvm'
> s390-linux-ld: drivers/vfio/pci/vfio_pci_zdev.o: in function `vfio_pci_zdev_close_device':
> vfio_pci_zdev.c:(.text+0x296): undefined reference to `kvm_s390_pci_unregister_kvm'
>
> Having a bool Kconfig symbol depend on a tristate symbol can often
> lead to problems like this.
>
> Fixes: 8061d1c31f1a ("vfio-pci/zdev: add open/close device hooks")
> Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
> Reported-by: kernel test robot <lkp@...el.com>
> Cc: Matthew Rosato <mjrosato@...ux.ibm.com>
> Cc: Christian Borntraeger <borntraeger@...ux.ibm.com>
> Cc: Pierre Morel <pmorel@...ux.ibm.com>
> Cc: Eric Farman <farman@...ux.ibm.com>
> Cc: linux-s390@...r.kernel.org
> Cc: kvm@...r.kernel.org
> ---
> drivers/vfio/pci/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/drivers/vfio/pci/Kconfig
> +++ b/drivers/vfio/pci/Kconfig
> @@ -46,7 +46,7 @@ endif
>
> config VFIO_PCI_ZDEV_KVM
> bool "VFIO PCI extensions for s390x KVM passthrough"
> - depends on S390 && KVM
> + depends on S390 && KVM=y
> default y
> help
> Support s390x-specific extensions to enable support for enhancements
>
--
Pierre Morel
IBM Lab Boeblingen
Powered by blists - more mailing lists