Hi Mark, On Tue, Sep 29, 2026 at 05:16:51PM +0100, Mark Brown wrote: > While debugging issues related to aarch64 only systems I ran into > speedbumps due to the lack of detail in the results reported when the > guest register read and reset value preservation tests were run, they > generated an immediately fatal assert without indicating which register > was being tested. Update these tests to non-fatally report a standard > kselftest result per register, making it much easier to see what the > problem being reported is. > > A similar issue exists with the validation of the individual bitfields > in registers due to the use of immediately fatal asserts. Update those > asserts to be standard kselftest reports. > > Signed-off-by: Mark Brown <[email protected]> > --- > Changes in v8: > - Convert another assert. > - Link to v7: > https://patch.msgid.link/20260901-kvm-arm64-set-id-regs-aarch64-v7-0-7b065b0bd...@kernel.org > > Changes in v7: > - Rebase onto v7.3-rc1. > - Link to v6: > https://patch.msgid.link/20260719-kvm-arm64-set-id-regs-aarch64-v6-0-724287f5f...@kernel.org > > Changes in v6: > - Rebase onto v7.2-rc3. > - Drop changes to handling of aarch32 related registers on 64 bit only > systems, an in kernel solution is preferred for those.
I’ve reproduced the set_id_regs failure under QEMU with kvm-arm.mode=nested on a host that supports AArch32. KVM advertises the NV-capable L1 vCPU as AArch64-only, but aa32_id_visibility() still permits the inner KVM to expose ID_DFR0_EL1.CopDbg = 0xa to the selftest vCPU. The test expects zero because it skips setting expected values for AArch32 ID registers. In v6 you mentioned preferring an in-kernel solution. What did you have in mind, given that changing the value returned by GET_ONE_REG may affect the userspace ABI? Thanks, Itaru. > - Use a define to count the non-test_regs registers. > - Link to v5: > https://patch.msgid.link/20260317-kvm-arm64-set-id-regs-aarch64-v5-0-a60f2b956...@kernel.org > > Changes in v5: > - Rebase onto v7.0-rc1. > - Link to v4: > https://patch.msgid.link/20260106-kvm-arm64-set-id-regs-aarch64-v4-0-c7ef4551a...@kernel.org > > Changes in v4: > - Correct check for 32 bit ID registers. > - Link to v3: > https://patch.msgid.link/20251219-kvm-arm64-set-id-regs-aarch64-v3-0-bfa474ec3...@kernel.org > > Changes in v3: > - Rebase onto v6.19-rc1. > - Link to v2: > https://patch.msgid.link/20251114-kvm-arm64-set-id-regs-aarch64-v2-0-672f214f4...@kernel.org > > Changes in v2: > - Add a fix for spurious failures with 64 bit only guests. > - Link to v1: > https://patch.msgid.link/20251030-kvm-arm64-set-id-regs-aarch64-v1-0-96fe0d2b1...@kernel.org > > --- > Mark Brown (3): > KVM: selftests: arm64: Report set_id_reg reads of test registers as > tests > KVM: selftests: arm64: Report register reset tests individually > KVM: selftests: arm64: Make set_id_regs bitfield validity checks > non-fatal > > tools/testing/selftests/kvm/arm64/set_id_regs.c | 130 > ++++++++++++++++++------ > 1 file changed, 98 insertions(+), 32 deletions(-) > --- > base-commit: cee9395acd8043be0644b25c34bfa86623f2b935 > change-id: 20251028-kvm-arm64-set-id-regs-aarch64-ebb77969401c > > Best regards, > -- > Mark Brown <[email protected]> >

