Re: [PATCH v5 4/5] KVM: selftests: arm64: Skip all 32 bit IDs when set_id_regs is aarch64 only
From: Mark Brown
Date: Tue Mar 24 2026 - 13:47:26 EST
On Tue, Mar 24, 2026 at 04:47:15PM +0000, Marc Zyngier wrote:
> Mark Brown <broonie@xxxxxxxxxx> wrote:
> > On an aarch64 only system the 32 bit ID registers have UNDEFINED values.
> > As a result set_id_regs skips tests for setting fields in these registers
> > when testing an aarch64 only guest. This has the side effect of meaning
> > that we don't record an expected value for these registers, meaning that
> > when the subsequent tests for values being visible in guests and preserved
> > over reset check the value they can spuriously fail. This can be seen by
> > running on an emulated system with both NV and 32 bit enabled, NV will
> > result in the guests created by the test program being 64 bit only but
> > the 32 bit ID registers will have values.
> I don't think papering over this problem is the right thing to do.
> If the issue is that you have HW that has both NV and AArch32, then
> KVM needs to be fixed to make the 32bit IDregs RAZ when NV is present
> because that's not a configuration we support.
Yes, I'm seeing this in practice - it hits by default with qemu which is
rather more readily accessible than actual hardware with NV at this
point and I was concerned that since these registers are explicitly
UNKNOWN (sorry, a mistake in the commit log above there) rather than RAZ
if FEAT_AA32 is not implemented there might be gotchas. I do see that
there's some forcing for the case where the host doesn't support
FEAT_AA32, I figured there must be some reason why it wasn't done based
on the guest configuration.
I'll add something to kvm_finalize_sys_regs(), it'll still need updates
in set_id_regs since that'd make the 32 bit ID registers change value
when the guest is run.
Attachment:
signature.asc
Description: PGP signature