]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: selftests: Confirm exposing MTE_frac does not break migration
authorBen Horgan <ben.horgan@arm.com>
Mon, 12 May 2025 11:41:12 +0000 (12:41 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 16 May 2025 12:01:18 +0000 (13:01 +0100)
commit69018866d2baa014413e340744bfb342ec0cdbcd
treebf89c5a1a4bdbc9bdb068d73892336b5b21e4b46
parentfe21ff5d4b46c06c4e43a310fdb781d1e6b5173e
KVM: selftests: Confirm exposing MTE_frac does not break migration

When MTE is supported but MTE_ASYMM is not (ID_AA64PFR1_EL1.MTE == 2)
ID_AA64PFR1_EL1.MTE_frac == 0xF indicates MTE_ASYNC is unsupported
and MTE_frac == 0 indicates it is supported.

As MTE_frac was previously unconditionally read as 0 from the guest
and user-space, check that using SET_ONE_REG to set it to 0 succeeds
but does not change MTE_frac from unsupported (0xF) to supported (0).
This is required as values originating from KVM from user-space must
be accepted to avoid breaking migration.

Also, to allow this MTE field to be tested, enable KVM_ARM_CAP_MTE
for the set_id_regs test. No effect on existing tests is expected.

Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Link: https://lore.kernel.org/r/20250512114112.359087-4-ben.horgan@arm.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
tools/testing/selftests/kvm/arm64/set_id_regs.c