* [PATCH] [v2] virtio: always enter drivers/virtio/
@ 2021-12-06 8:50 Arnd Bergmann
2021-12-07 3:01 ` Jason Wang
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2021-12-06 8:50 UTC (permalink / raw)
To: Michael S. Tsirkin, Jason Wang, Wu Zongyong
Cc: Arnd Bergmann, Jens Axboe, Hans de Goede, Michael Kelley,
Dan Williams, Andy Shevchenko, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
When neither VIRTIO_PCI_LIB nor VIRTIO are enabled, but the alibaba
vdpa driver is, the kernel runs into a link error because the legacy
virtio module never gets built:
x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function `eni_vdpa_set_features':
eni_vdpa.c:(.text+0x23f): undefined reference to `vp_legacy_set_features'
x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function `eni_vdpa_set_vq_state':
eni_vdpa.c:(.text+0x2fe): undefined reference to `vp_legacy_get_queue_enable'
x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function `eni_vdpa_set_vq_address':
eni_vdpa.c:(.text+0x376): undefined reference to `vp_legacy_set_queue_address'
x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function `eni_vdpa_set_vq_ready':
eni_vdpa.c:(.text+0x3b4): undefined reference to `vp_legacy_set_queue_address'
x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function `eni_vdpa_free_irq':
eni_vdpa.c:(.text+0x460): undefined reference to `vp_legacy_queue_vector'
x86_64-linux-ld: eni_vdpa.c:(.text+0x4b7): undefined reference to `vp_legacy_config_vector'
x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function `eni_vdpa_reset':
When VIRTIO_PCI_LIB was added, it was correctly added to drivers/Makefile
as well, but for the legacy module, this is missing. Solve this by always
entering drivers/virtio during the build and letting its Makefile take
care of the individual options, rather than having a separate line for
each sub-option.
Fixes: 64b9f64f80a6 ("vdpa: introduce virtio pci driver")
Fixes: e85087beedca ("eni_vdpa: add vDPA driver for Alibaba ENI")
Fixes: d89c8169bd70 ("virtio-pci: introduce legacy device module")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/Makefile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/Makefile b/drivers/Makefile
index be5d40ae1488..a110338c860c 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -41,8 +41,7 @@ obj-$(CONFIG_DMADEVICES) += dma/
# SOC specific infrastructure drivers.
obj-y += soc/
-obj-$(CONFIG_VIRTIO) += virtio/
-obj-$(CONFIG_VIRTIO_PCI_LIB) += virtio/
+obj-y += virtio/
obj-$(CONFIG_VDPA) += vdpa/
obj-$(CONFIG_XEN) += xen/
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] [v2] virtio: always enter drivers/virtio/
2021-12-06 8:50 [PATCH] [v2] virtio: always enter drivers/virtio/ Arnd Bergmann
@ 2021-12-07 3:01 ` Jason Wang
0 siblings, 0 replies; 2+ messages in thread
From: Jason Wang @ 2021-12-07 3:01 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Michael S. Tsirkin, Wu Zongyong, Arnd Bergmann, Jens Axboe,
Hans de Goede, Michael Kelley, Dan Williams, Andy Shevchenko,
linux-kernel
On Mon, Dec 6, 2021 at 4:50 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> When neither VIRTIO_PCI_LIB nor VIRTIO are enabled, but the alibaba
> vdpa driver is, the kernel runs into a link error because the legacy
> virtio module never gets built:
>
> x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function `eni_vdpa_set_features':
> eni_vdpa.c:(.text+0x23f): undefined reference to `vp_legacy_set_features'
> x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function `eni_vdpa_set_vq_state':
> eni_vdpa.c:(.text+0x2fe): undefined reference to `vp_legacy_get_queue_enable'
> x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function `eni_vdpa_set_vq_address':
> eni_vdpa.c:(.text+0x376): undefined reference to `vp_legacy_set_queue_address'
> x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function `eni_vdpa_set_vq_ready':
> eni_vdpa.c:(.text+0x3b4): undefined reference to `vp_legacy_set_queue_address'
> x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function `eni_vdpa_free_irq':
> eni_vdpa.c:(.text+0x460): undefined reference to `vp_legacy_queue_vector'
> x86_64-linux-ld: eni_vdpa.c:(.text+0x4b7): undefined reference to `vp_legacy_config_vector'
> x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function `eni_vdpa_reset':
>
> When VIRTIO_PCI_LIB was added, it was correctly added to drivers/Makefile
> as well, but for the legacy module, this is missing. Solve this by always
> entering drivers/virtio during the build and letting its Makefile take
> care of the individual options, rather than having a separate line for
> each sub-option.
>
> Fixes: 64b9f64f80a6 ("vdpa: introduce virtio pci driver")
I think this is not true. we had:
obj-$(CONFIG_VIRTIO_PCI_LIB) += virtio/
since then.
The patch looks good to me.
Thanks
> Fixes: e85087beedca ("eni_vdpa: add vDPA driver for Alibaba ENI")
> Fixes: d89c8169bd70 ("virtio-pci: introduce legacy device module")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/Makefile | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/Makefile b/drivers/Makefile
> index be5d40ae1488..a110338c860c 100644
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -41,8 +41,7 @@ obj-$(CONFIG_DMADEVICES) += dma/
> # SOC specific infrastructure drivers.
> obj-y += soc/
>
> -obj-$(CONFIG_VIRTIO) += virtio/
> -obj-$(CONFIG_VIRTIO_PCI_LIB) += virtio/
> +obj-y += virtio/
> obj-$(CONFIG_VDPA) += vdpa/
> obj-$(CONFIG_XEN) += xen/
>
> --
> 2.29.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-07 3:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 8:50 [PATCH] [v2] virtio: always enter drivers/virtio/ Arnd Bergmann
2021-12-07 3:01 ` Jason Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).