* Re: [PATCH RESEND v2] kunit: Enable PCI on UML without triggering WARN()
2025-09-08 7:03 [PATCH RESEND v2] kunit: Enable PCI on UML without triggering WARN() Thomas Weißschuh
@ 2025-09-08 16:53 ` Geert Uytterhoeven
2025-09-09 5:53 ` Thomas Weißschuh
2025-09-13 6:14 ` David Gow
2025-09-15 16:29 ` Shuah Khan
2 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2025-09-08 16:53 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Brendan Higgins, David Gow, Rae Moar, Richard Weinberger,
Anton Ivanov, Johannes Berg, linux-kselftest, kunit-dev,
linux-kernel, linux-um
Hi Thomas,
On Mon, 8 Sept 2025 at 09:04, Thomas Weißschuh
<thomas.weissschuh@linutronix.de> wrote:
> Various KUnit tests require PCI infrastructure to work. All normal
> platforms enable PCI by default, but UML does not. Enabling PCI from
> .kunitconfig files is problematic as it would not be portable. So in
> commit 6fc3a8636a7b ("kunit: tool: Enable virtio/PCI by default on UML")
> PCI was enabled by way of CONFIG_UML_PCI_OVER_VIRTIO=y. However
> CONFIG_UML_PCI_OVER_VIRTIO requires additional configuration of
> CONFIG_UML_PCI_OVER_VIRTIO_DEVICE_ID or will otherwise trigger a WARN() in
> virtio_pcidev_init(). However there is no one correct value for
> UML_PCI_OVER_VIRTIO_DEVICE_ID which could be used by default.
>
> This warning is confusing when debugging test failures.
>
> On the other hand, the functionality of CONFIG_UML_PCI_OVER_VIRTIO is not
> used at all, given that it is completely non-functional as indicated by
> the WARN() in question. Instead it is only used as a way to enable
> CONFIG_UML_PCI which itself is not directly configurable.
>
> Instead of going through CONFIG_UML_PCI_OVER_VIRTIO, introduce a custom
> configuration option which enables CONFIG_UML_PCI without triggering
> warnings or building dead code.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Thanks for your patch!
> --- a/lib/kunit/Kconfig
> +++ b/lib/kunit/Kconfig
> @@ -106,4 +106,11 @@ config KUNIT_DEFAULT_TIMEOUT
> If unsure, the default timeout of 300 seconds is suitable for most
> cases.
>
> +config KUNIT_UML_PCI
Where is the consumer of this symbol?
> + bool "KUnit UML PCI Support"
> + depends on UML
> + select UML_PCI
> + help
> + Enables the PCI subsystem on UML for use by KUnit tests.
> +
> endif # KUNIT
> diff --git a/tools/testing/kunit/configs/arch_uml.config b/tools/testing/kunit/configs/arch_uml.config
> index 54ad8972681a2cc724e6122b19407188910b9025..28edf816aa70e6f408d9486efff8898df79ee090 100644
> --- a/tools/testing/kunit/configs/arch_uml.config
> +++ b/tools/testing/kunit/configs/arch_uml.config
> @@ -1,8 +1,7 @@
> # Config options which are added to UML builds by default
>
> -# Enable virtio/pci, as a lot of tests require it.
> -CONFIG_VIRTIO_UML=y
> -CONFIG_UML_PCI_OVER_VIRTIO=y
> +# Enable pci, as a lot of tests require it.
> +CONFIG_KUNIT_UML_PCI=y
>
> # Enable FORTIFY_SOURCE for wider checking.
> CONFIG_FORTIFY_SOURCE=y
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH RESEND v2] kunit: Enable PCI on UML without triggering WARN()
2025-09-08 16:53 ` Geert Uytterhoeven
@ 2025-09-09 5:53 ` Thomas Weißschuh
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Weißschuh @ 2025-09-09 5:53 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Brendan Higgins, David Gow, Rae Moar, Richard Weinberger,
Anton Ivanov, Johannes Berg, linux-kselftest, kunit-dev,
linux-kernel, linux-um
Hi Geert,
On Mon, Sep 08, 2025 at 06:53:30PM +0200, Geert Uytterhoeven wrote:
> On Mon, 8 Sept 2025 at 09:04, Thomas Weißschuh
> <thomas.weissschuh@linutronix.de> wrote:
> > Various KUnit tests require PCI infrastructure to work. All normal
> > platforms enable PCI by default, but UML does not. Enabling PCI from
> > .kunitconfig files is problematic as it would not be portable. So in
> > commit 6fc3a8636a7b ("kunit: tool: Enable virtio/PCI by default on UML")
> > PCI was enabled by way of CONFIG_UML_PCI_OVER_VIRTIO=y. However
> > CONFIG_UML_PCI_OVER_VIRTIO requires additional configuration of
> > CONFIG_UML_PCI_OVER_VIRTIO_DEVICE_ID or will otherwise trigger a WARN() in
> > virtio_pcidev_init(). However there is no one correct value for
> > UML_PCI_OVER_VIRTIO_DEVICE_ID which could be used by default.
> >
> > This warning is confusing when debugging test failures.
> >
> > On the other hand, the functionality of CONFIG_UML_PCI_OVER_VIRTIO is not
> > used at all, given that it is completely non-functional as indicated by
> > the WARN() in question. Instead it is only used as a way to enable
> > CONFIG_UML_PCI which itself is not directly configurable.
> >
> > Instead of going through CONFIG_UML_PCI_OVER_VIRTIO, introduce a custom
> > configuration option which enables CONFIG_UML_PCI without triggering
> > warnings or building dead code.
> >
> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> > Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
>
> Thanks for your patch!
>
> > --- a/lib/kunit/Kconfig
> > +++ b/lib/kunit/Kconfig
> > @@ -106,4 +106,11 @@ config KUNIT_DEFAULT_TIMEOUT
> > If unsure, the default timeout of 300 seconds is suitable for most
> > cases.
> >
> > +config KUNIT_UML_PCI
>
> Where is the consumer of this symbol?
There is none. The relevant part is that it selects UML_PCI which on its own is
not user-visible. Directly enabling UML_PCI wihtout any drivers only makes
sense in the context of KUnit.
> > + bool "KUnit UML PCI Support"
> > + depends on UML
> > + select UML_PCI
> > + help
> > + Enables the PCI subsystem on UML for use by KUnit tests.
> > +
> > endif # KUNIT
> > diff --git a/tools/testing/kunit/configs/arch_uml.config b/tools/testing/kunit/configs/arch_uml.config
> > index 54ad8972681a2cc724e6122b19407188910b9025..28edf816aa70e6f408d9486efff8898df79ee090 100644
> > --- a/tools/testing/kunit/configs/arch_uml.config
> > +++ b/tools/testing/kunit/configs/arch_uml.config
> > @@ -1,8 +1,7 @@
> > # Config options which are added to UML builds by default
> >
> > -# Enable virtio/pci, as a lot of tests require it.
> > -CONFIG_VIRTIO_UML=y
> > -CONFIG_UML_PCI_OVER_VIRTIO=y
> > +# Enable pci, as a lot of tests require it.
> > +CONFIG_KUNIT_UML_PCI=y
> >
> > # Enable FORTIFY_SOURCE for wider checking.
> > CONFIG_FORTIFY_SOURCE=y
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND v2] kunit: Enable PCI on UML without triggering WARN()
2025-09-08 7:03 [PATCH RESEND v2] kunit: Enable PCI on UML without triggering WARN() Thomas Weißschuh
2025-09-08 16:53 ` Geert Uytterhoeven
@ 2025-09-13 6:14 ` David Gow
2025-09-15 16:29 ` Shuah Khan
2 siblings, 0 replies; 5+ messages in thread
From: David Gow @ 2025-09-13 6:14 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Brendan Higgins, Rae Moar, Richard Weinberger, Anton Ivanov,
Johannes Berg, linux-kselftest, kunit-dev, linux-kernel, linux-um
On Mon, 8 Sept 2025 at 15:03, Thomas Weißschuh
<thomas.weissschuh@linutronix.de> wrote:
>
> Various KUnit tests require PCI infrastructure to work. All normal
> platforms enable PCI by default, but UML does not. Enabling PCI from
> .kunitconfig files is problematic as it would not be portable. So in
> commit 6fc3a8636a7b ("kunit: tool: Enable virtio/PCI by default on UML")
> PCI was enabled by way of CONFIG_UML_PCI_OVER_VIRTIO=y. However
> CONFIG_UML_PCI_OVER_VIRTIO requires additional configuration of
> CONFIG_UML_PCI_OVER_VIRTIO_DEVICE_ID or will otherwise trigger a WARN() in
> virtio_pcidev_init(). However there is no one correct value for
> UML_PCI_OVER_VIRTIO_DEVICE_ID which could be used by default.
>
> This warning is confusing when debugging test failures.
>
> On the other hand, the functionality of CONFIG_UML_PCI_OVER_VIRTIO is not
> used at all, given that it is completely non-functional as indicated by
> the WARN() in question. Instead it is only used as a way to enable
> CONFIG_UML_PCI which itself is not directly configurable.
>
> Instead of going through CONFIG_UML_PCI_OVER_VIRTIO, introduce a custom
> configuration option which enables CONFIG_UML_PCI without triggering
> warnings or building dead code.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
> ---
Reviewed-by: David Gow <davidgow@google.com>
Cheers,
-- David
> Changes in v2:
> - Rebase onto v6.17-rc1
> - Pick up review from Johannes
> - Link to v1: https://lore.kernel.org/r/20250627-kunit-uml-pci-v1-1-a622fa445e58@linutronix.de
> ---
> lib/kunit/Kconfig | 7 +++++++
> tools/testing/kunit/configs/arch_uml.config | 5 ++---
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/lib/kunit/Kconfig b/lib/kunit/Kconfig
> index c10ede4b1d2201d5f8cddeb71cc5096e21be9b6a..1823539e96da30e165fa8d395ccbd3f6754c836e 100644
> --- a/lib/kunit/Kconfig
> +++ b/lib/kunit/Kconfig
> @@ -106,4 +106,11 @@ config KUNIT_DEFAULT_TIMEOUT
> If unsure, the default timeout of 300 seconds is suitable for most
> cases.
>
> +config KUNIT_UML_PCI
> + bool "KUnit UML PCI Support"
> + depends on UML
> + select UML_PCI
> + help
> + Enables the PCI subsystem on UML for use by KUnit tests.
> +
> endif # KUNIT
> diff --git a/tools/testing/kunit/configs/arch_uml.config b/tools/testing/kunit/configs/arch_uml.config
> index 54ad8972681a2cc724e6122b19407188910b9025..28edf816aa70e6f408d9486efff8898df79ee090 100644
> --- a/tools/testing/kunit/configs/arch_uml.config
> +++ b/tools/testing/kunit/configs/arch_uml.config
> @@ -1,8 +1,7 @@
> # Config options which are added to UML builds by default
>
> -# Enable virtio/pci, as a lot of tests require it.
> -CONFIG_VIRTIO_UML=y
> -CONFIG_UML_PCI_OVER_VIRTIO=y
> +# Enable pci, as a lot of tests require it.
> +CONFIG_KUNIT_UML_PCI=y
>
> # Enable FORTIFY_SOURCE for wider checking.
> CONFIG_FORTIFY_SOURCE=y
>
> ---
> base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
> change-id: 20250626-kunit-uml-pci-a2b687553746
>
> Best regards,
> --
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH RESEND v2] kunit: Enable PCI on UML without triggering WARN()
2025-09-08 7:03 [PATCH RESEND v2] kunit: Enable PCI on UML without triggering WARN() Thomas Weißschuh
2025-09-08 16:53 ` Geert Uytterhoeven
2025-09-13 6:14 ` David Gow
@ 2025-09-15 16:29 ` Shuah Khan
2 siblings, 0 replies; 5+ messages in thread
From: Shuah Khan @ 2025-09-15 16:29 UTC (permalink / raw)
To: Thomas Weißschuh, Brendan Higgins, David Gow, Rae Moar,
Richard Weinberger, Anton Ivanov, Johannes Berg, Shuah Khan
Cc: linux-kselftest, kunit-dev, linux-kernel, linux-um
On 9/8/25 01:03, Thomas Weißschuh wrote:
> Various KUnit tests require PCI infrastructure to work. All normal
> platforms enable PCI by default, but UML does not. Enabling PCI from
> .kunitconfig files is problematic as it would not be portable. So in
> commit 6fc3a8636a7b ("kunit: tool: Enable virtio/PCI by default on UML")
> PCI was enabled by way of CONFIG_UML_PCI_OVER_VIRTIO=y. However
> CONFIG_UML_PCI_OVER_VIRTIO requires additional configuration of
> CONFIG_UML_PCI_OVER_VIRTIO_DEVICE_ID or will otherwise trigger a WARN() in
> virtio_pcidev_init(). However there is no one correct value for
> UML_PCI_OVER_VIRTIO_DEVICE_ID which could be used by default.
>
> This warning is confusing when debugging test failures.
>
> On the other hand, the functionality of CONFIG_UML_PCI_OVER_VIRTIO is not
> used at all, given that it is completely non-functional as indicated by
> the WARN() in question. Instead it is only used as a way to enable
> CONFIG_UML_PCI which itself is not directly configurable.
>
> Instead of going through CONFIG_UML_PCI_OVER_VIRTIO, introduce a custom
> configuration option which enables CONFIG_UML_PCI without triggering
> warnings or building dead code.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> Changes in v2:
> - Rebase onto v6.17-rc1
> - Pick up review from Johannes
> - Link to v1: https://lore.kernel.org/r/20250627-kunit-uml-pci-v1-1-a622fa445e58@linutronix.de
> ---
> lib/kunit/Kconfig | 7 +++++++
> tools/testing/kunit/configs/arch_uml.config | 5 ++---
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/lib/kunit/Kconfig b/lib/kunit/Kconfig
> index c10ede4b1d2201d5f8cddeb71cc5096e21be9b6a..1823539e96da30e165fa8d395ccbd3f6754c836e 100644
> --- a/lib/kunit/Kconfig
> +++ b/lib/kunit/Kconfig
> @@ -106,4 +106,11 @@ config KUNIT_DEFAULT_TIMEOUT
> If unsure, the default timeout of 300 seconds is suitable for most
> cases.
>
> +config KUNIT_UML_PCI
> + bool "KUnit UML PCI Support"
> + depends on UML
> + select UML_PCI
> + help
> + Enables the PCI subsystem on UML for use by KUnit tests.
I am applying this patch for 6.18-rc1.
Please send a patch to fix the following warning on top of this one based
on
https://web.git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/log/?h=kunit
WARNING: please write a help paragraph that fully describes the config symbol with at least 4 lines
#136: FILE: lib/kunit/Kconfig:109:
+config KUNIT_UML_PCI
+ bool "KUnit UML PCI Support"
+ depends on UML
+ select UML_PCI
+ help
+ Enables the PCI subsystem on UML for use by KUnit tests.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 5+ messages in thread