]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: arm64: selftests: Cope with arch silliness in EL2 selftest
authorOliver Upton <oliver.upton@linux.dev>
Tue, 23 Sep 2025 17:30:06 +0000 (10:30 -0700)
committerMarc Zyngier <maz@kernel.org>
Wed, 24 Sep 2025 18:24:02 +0000 (19:24 +0100)
commit75b2fdc1a82195997cab4836f9e511cbe8c8eb52
tree7aeb5185ab83eeca5d3fc1b8e5ebce68fef88e69
parentf677b0efa93ce0afb127ccffb8aaf708045fcf10
KVM: arm64: selftests: Cope with arch silliness in EL2 selftest

Implementations without FEAT_FGT aren't required to trap the entire ID
register space when HCR_EL2.TID3 is set. This is a terrible idea, as the
hypervisor may need to advertise the absence of a feature to the VM
using a negative value in a signed field, FEAT_E2H0 being a great
example of this.

Cope with uncooperative implementations in the EL2 selftest by accepting
a zero value when FEAT_FGT is absent and otherwise only tolerating the
expected nonzero value.

Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
tools/testing/selftests/kvm/arm64/hello_el2.c