From: Vaibhav Jain <vaibhav@linux.ibm.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org
Subject: Re: ppc64le kunit test failure: guest_state_buffer_test
Date: Wed, 03 Jun 2026 16:55:01 +0530 [thread overview]
Message-ID: <87a4tbzx0y.fsf@vajain21.in.ibm.com> (raw)
In-Reply-To: <20260603074035.GA1148188@sol>
Hi Eric,
I just successfully tested this kunit test on kernel tag next-20260602
and qemu master HEAD == 405c32d2b18a("Merge tag 'pull-tpm-2026-06-01-1'
of https://github.com/stefanberger/qemu-tpm into staging") [1]
If you are using Qemu >= v10.0.0 then the kunit test failure you
reported is due to Qemu not enabling 'cap-nested-papr' capability which
is needed to enable KVM-HV Apiv2 support in Qemu.
Without 'cap-nested-papr' Qemu doesnt register the H_GUEST_GET_STATE
Hcall which this kunit test relies on. Hence it returns -2 (H_FUNCTION)
for this unsupported HCall. The failure of kunit 'test_gs_hostwide_msg'
is expected as the underlying hypervisor doesnt have support nested-papr
APIv2 capability.
To fix this please enable qemu-system-ppc64 machine's capability
cap-nested-papr to enable nested-papr APIv2 support.
Below is the test log showing successful 'guest_state_buffer_test' kunit
test passing :
$ ./qemu-system-ppc64 --version
QEMU emulator version 11.0.50 (v11.0.0-1621-g405c32d2b1)
Copyright (c) 2003-2026 Fabrice Bellard and the QEMU Project developers
# kunit test is specific to nested-papr APIv2 so qemu cap-nested-papr needs to be enabled
$ ./qemu-system-ppc64 -display none -nographic -kernel ~/linux/vmlinux
-machine pseries,cap-nested-papr=true
<snip>
Booting from memory...
OF stdout device is: /vdevice/vty@71000000
Preparing to boot Linux version 7.1.0-rc6-next-20260602 (vaibhav@*********) (gcc (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2), GNU ld version 2.46-3.fc44) #2 SMP PREEMPT Wed Jun 3 04:11:38 CDT 2026
Detected machine type: 0000000000000101
<snip>
[ 4.335850][ T1] KTAP version 1
[ 4.335896][ T1] # Subtest: guest_state_buffer_test
[ 4.335946][ T1] # module: test_guest_state_buffer
[ 4.335970][ T1] 1..7
[ 4.337296][ T1] ok 1 test_creating_buffer
[ 4.338998][ T1] ok 2 test_adding_element
[ 4.341996][ T1] ok 3 test_gs_bitmap
[ 4.343406][ T1] ok 4 test_gs_parsing
[ 4.345607][ T1] ok 5 test_gs_msg
[ 4.347247][ T1] ok 6 test_gs_hostwide_msg
[ 4.348012][ T131] # test_gs_hostwide_counters: Guest Heap Size=0 bytes
[ 4.348183][ T131] # test_gs_hostwide_counters: Guest Heap Size Max=0 bytes
[ 4.348350][ T131] # test_gs_hostwide_counters: Guest Page-table Size=0 bytes
[ 4.348653][ T131] # test_gs_hostwide_counters: Guest Page-table Size Max=0 bytes
[ 4.348813][ T131] # test_gs_hostwide_counters: Guest Page-table Reclaim Size=0 bytes
[ 4.349354][ T1] ok 7 test_gs_hostwide_counters
[ 4.349569][ T1] # guest_state_buffer_test: pass:7 fail:0 skip:0 total:7
[ 4.349635][ T1] # Totals: pass:7 fail:0 skip:0 total:7
[ 4.349708][ T1] ok 4 guest_state_buffer_test
Can you try adding 'cap-nested-papr=true' to the Qemu machine you are
using and see if the problem resolves for you. If it persists can you
please share the Qemu command line you are using.
[1] https://gitlab.com/qemu-project/qemu/-/commit/405c32d2b18a683ba36301351af75125d9afda08
Eric Biggers <ebiggers@kernel.org> writes:
> On Wed, Jun 03, 2026 at 01:03:09PM +0530, Vaibhav Jain wrote:
>> Hi Eric,
>>
>> Thanks for trying and reporting this. This kunit test depends on
>> availablility of Qemu commit 5f7d861e("spapr: nested: Add support for
>> reporting Hostwide state counter ") [1] that was merged in v10.0.0.
>>
>> Since you havent mentioned the qemu version used I assume its a version
>> < v10.0.0 . With the qemu patch available you should see this test
>> passing with results similar to as originally described in original
>> cover letter of the patch series at [2] that introduced this kunit test.
>>
>> [1] https://gitlab.com/qemu-project/qemu/-/commit/5f7d861e65d90e0446b8f22a0bc859a5d8058ea6
>>
>> [2] https://lore.kernel.org/all/20250416162740.93143-1-vaibhav@linux.ibm.com/
>
> Nope, it fails even on the master branch of QEMU.
>
> - Eric
--
Cheers
~ Vaibhav
prev parent reply other threads:[~2026-06-03 11:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 6:42 ppc64le kunit test failure: guest_state_buffer_test Eric Biggers
2026-06-03 7:33 ` Vaibhav Jain
2026-06-03 7:40 ` Eric Biggers
2026-06-03 11:25 ` Vaibhav Jain [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a4tbzx0y.fsf@vajain21.in.ibm.com \
--to=vaibhav@linux.ibm.com \
--cc=ebiggers@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox