All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] KVM: arm64: Don't claim MTE_ASYNC if not supported
@ 2025-04-14 12:40 Ben Horgan
  2025-04-14 12:40 ` [RFC PATCH 1/3] arm64/sysreg: Expose MTE_frac so that it is visible to KVM Ben Horgan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ben Horgan @ 2025-04-14 12:40 UTC (permalink / raw)
  To: linux-arm-kernel, kvmarm, linux-kselftest
  Cc: maz, oliver.upton, joey.gouly, suzuki.poulose, yuzenghui, shuah,
	Ben Horgan

The ID_AA64PFR1_EL1.MTE_frac field is currently hidden from KVM.
However, when ID_AA64PFR1_EL1.MTE==2, ID_AA64PFR1_EL1.MTE_frac==0
indicates that MTE_ASYNC is supported. On a host with
ID_AA64PFR1_EL1.MTE==2 but without MTE_ASYNC support a guest with the
MTE capability enabled will incorrectly see MTE_ASYNC advertised as
supported. This series fixes that.

This was found by inspection and the current behaviour is not known to
break anything. Linux doesn't check MTE_frac, and wrongly, assumes
MTE async faults can be generated whenever MTE is supported. This is
a separate problem and not addressed here.

I am looking for feedback on whether this change is valuable or
otherwise.

Ben Horgan (3):
  arm64/sysreg: Expose MTE_frac so that it is visible to KVM
  KVM: arm64: Make MTE_frac masking conditional on MTE capability
  KVM: selftests: Confirm exposing MTE_frac does not break migration

 arch/arm64/kernel/cpufeature.c                |  1 +
 arch/arm64/kvm/sys_regs.c                     | 26 ++++++-
 .../testing/selftests/kvm/arm64/set_id_regs.c | 77 ++++++++++++++++++-
 3 files changed, 101 insertions(+), 3 deletions(-)


base-commit: 8ffd015db85fea3e15a77027fda6c02ced4d2444
-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-04-28 11:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-14 12:40 [RFC PATCH 0/3] KVM: arm64: Don't claim MTE_ASYNC if not supported Ben Horgan
2025-04-14 12:40 ` [RFC PATCH 1/3] arm64/sysreg: Expose MTE_frac so that it is visible to KVM Ben Horgan
2025-04-14 12:40 ` [RFC PATCH 2/3] KVM: arm64: Make MTE_frac masking conditional on MTE capability Ben Horgan
2025-04-27 17:24   ` Marc Zyngier
2025-04-28 11:26     ` Ben Horgan
2025-04-14 12:40 ` [RFC PATCH 3/3] KVM: selftests: Confirm exposing MTE_frac does not break migration Ben Horgan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.