arch/powerpc/Kconfig.debug | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
The GUEST_STATE_BUFFER_TEST config option should default
to KUNIT_ALL_TESTS so that if all tests are enabled then
it is included, but currently the 'default KUNIT_ALL_TESTS'
statement is shadowed by 'def_tristate n',
meaning that this second default statement is currently dead code.
It looks to me like the commit
6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffers")
intended to set the default to KUNIT_ALL_TESTS, but mistakenly
missed the def_tristate.
This dead code was found by kconfirm, a static analysis tool for Kconfig.
Fixes: 6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffers")
Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
arch/powerpc/Kconfig.debug | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index f15e5920080b..e8718bc13eeb 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -83,11 +83,10 @@ config MSI_BITMAP_SELFTEST
depends on DEBUG_KERNEL
config GUEST_STATE_BUFFER_TEST
- def_tristate n
+ def_tristate KUNIT_ALL_TESTS
prompt "Enable Guest State Buffer unit tests"
depends on KUNIT
depends on KVM_BOOK3S_HV_POSSIBLE
- default KUNIT_ALL_TESTS
help
The Guest State Buffer is a data format specified in the PAPR.
It is by hcalls to communicate the state of L2 guests between
--
2.53.0
On Sun, 05 Apr 2026 17:15:45 +0100, Julian Braha wrote:
> The GUEST_STATE_BUFFER_TEST config option should default
> to KUNIT_ALL_TESTS so that if all tests are enabled then
> it is included, but currently the 'default KUNIT_ALL_TESTS'
> statement is shadowed by 'def_tristate n',
> meaning that this second default statement is currently dead code.
>
> It looks to me like the commit
> 6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffers")
> intended to set the default to KUNIT_ALL_TESTS, but mistakenly
> missed the def_tristate.
>
> [...]
Applied to powerpc/fixes.
[1/1] powerpc: fix dead default for GUEST_STATE_BUFFER_TEST
https://git.kernel.org/powerpc/c/aef656a0e6c01796190bb5bd2bdba1c644ed7811
cheers
On Sun, Apr 05, 2026 at 05:15:45PM +0100, Julian Braha wrote:
> The GUEST_STATE_BUFFER_TEST config option should default
> to KUNIT_ALL_TESTS so that if all tests are enabled then
> it is included, but currently the 'default KUNIT_ALL_TESTS'
> statement is shadowed by 'def_tristate n',
> meaning that this second default statement is currently dead code.
>
> It looks to me like the commit
> 6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffers")
> intended to set the default to KUNIT_ALL_TESTS, but mistakenly
> missed the def_tristate.
>
> This dead code was found by kconfirm, a static analysis tool for Kconfig.
>
> Fixes: 6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffers")
> Signed-off-by: Julian Braha <julianbraha@gmail.com>
> ---
> arch/powerpc/Kconfig.debug | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
> index f15e5920080b..e8718bc13eeb 100644
> --- a/arch/powerpc/Kconfig.debug
> +++ b/arch/powerpc/Kconfig.debug
> @@ -83,11 +83,10 @@ config MSI_BITMAP_SELFTEST
> depends on DEBUG_KERNEL
>
> config GUEST_STATE_BUFFER_TEST
> - def_tristate n
> + def_tristate KUNIT_ALL_TESTS
> prompt "Enable Guest State Buffer unit tests"
> depends on KUNIT
> depends on KVM_BOOK3S_HV_POSSIBLE
> - default KUNIT_ALL_TESTS
> help
> The Guest State Buffer is a data format specified in the PAPR.
> It is by hcalls to communicate the state of L2 guests between
> --
Tested-by: Gautam Menghani <gautam@linux.ibm.com>
Hi Julian,
Thanks for the patch.
On 2026/04/05 05:15 PM, Julian Braha wrote:
> The GUEST_STATE_BUFFER_TEST config option should default
> to KUNIT_ALL_TESTS so that if all tests are enabled then
> it is included, but currently the 'default KUNIT_ALL_TESTS'
> statement is shadowed by 'def_tristate n',
> meaning that this second default statement is currently dead code.
>
> It looks to me like the commit
> 6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffers")
> intended to set the default to KUNIT_ALL_TESTS, but mistakenly
> missed the def_tristate.
>
> This dead code was found by kconfirm, a static analysis tool for Kconfig.
>
> Fixes: 6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffers")
> Signed-off-by: Julian Braha <julianbraha@gmail.com>
> ---
> arch/powerpc/Kconfig.debug | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
This test is specific to KVM nested API v2 and is currently opt-in only.
This patch enables it by default when KUNIT_ALL_TESTS=y.
Since PPC kernels in general are built for both PowerNV and pSeries
platforms, and the API v2 code is always compiled in. Also, the tests
operate on guest state buffer in memory and no hcalls are involved,
enabling the test by default makes sense. Hence:
Reviewed-by: Amit Machhiwal <amachhiw@linux.ibm.com>
Thanks,
Amit
>
> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
> index f15e5920080b..e8718bc13eeb 100644
> --- a/arch/powerpc/Kconfig.debug
> +++ b/arch/powerpc/Kconfig.debug
> @@ -83,11 +83,10 @@ config MSI_BITMAP_SELFTEST
> depends on DEBUG_KERNEL
>
> config GUEST_STATE_BUFFER_TEST
> - def_tristate n
> + def_tristate KUNIT_ALL_TESTS
> prompt "Enable Guest State Buffer unit tests"
> depends on KUNIT
> depends on KVM_BOOK3S_HV_POSSIBLE
> - default KUNIT_ALL_TESTS
> help
> The Guest State Buffer is a data format specified in the PAPR.
> It is by hcalls to communicate the state of L2 guests between
> --
> 2.53.0
>
On 05/04/26 9:45 pm, Julian Braha wrote:
> The GUEST_STATE_BUFFER_TEST config option should default
> to KUNIT_ALL_TESTS so that if all tests are enabled then
> it is included, but currently the 'default KUNIT_ALL_TESTS'
> statement is shadowed by 'def_tristate n',
> meaning that this second default statement is currently dead code.
>
> It looks to me like the commit
> 6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffers")
> intended to set the default to KUNIT_ALL_TESTS, but mistakenly
> missed the def_tristate.
>
> This dead code was found by kconfirm, a static analysis tool for Kconfig.
>
> Fixes: 6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffers")
> Signed-off-by: Julian Braha <julianbraha@gmail.com>
Keeping the commit title as "powerpc: correctly enable KUNIT_ALL_TESTS
as default for GUEST_STATE_BUFFER_TEST" might look better. Anyways,
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
> ---
> arch/powerpc/Kconfig.debug | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
> index f15e5920080b..e8718bc13eeb 100644
> --- a/arch/powerpc/Kconfig.debug
> +++ b/arch/powerpc/Kconfig.debug
> @@ -83,11 +83,10 @@ config MSI_BITMAP_SELFTEST
> depends on DEBUG_KERNEL
>
> config GUEST_STATE_BUFFER_TEST
> - def_tristate n
> + def_tristate KUNIT_ALL_TESTS
> prompt "Enable Guest State Buffer unit tests"
> depends on KUNIT
> depends on KVM_BOOK3S_HV_POSSIBLE
> - default KUNIT_ALL_TESTS
> help
> The Guest State Buffer is a data format specified in the PAPR.
> It is by hcalls to communicate the state of L2 guests between
© 2016 - 2026 Red Hat, Inc.