linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/9] KVM: arm64: Add support for FEAT_IDST
@ 2025-12-04  9:47 Marc Zyngier
  2025-12-04  9:47 ` [PATCH v3 1/9] arm64: Repaint ID_AA64MMFR2_EL1.IDS description Marc Zyngier
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Marc Zyngier @ 2025-12-04  9:47 UTC (permalink / raw)
  To: kvmarm, kvm, linux-arm-kernel
  Cc: Joey Gouly, Suzuki K Poulose, Oliver Upton, Zenghui Yu,
	Ben Horgan, Yao Yuan

FEAT_IDST appeared in ARMv8.4, and allows ID registers to be trapped
if they are not implemented. This only concerns 3 registers (GMID_EL1,
CCSIDR2_EL1 and SMIDR_EL1), which are part of features that may not be
exposed to the guest even if present on the host.

For these registers, the HW should report them with EC=0x18, even if
the feature isn't implemented.

Add support for this feature by handling these registers in a specific
way and implementing GMID_EL1 support in the process. A very basic
selftest checks that these registers behave as expected.

* From v2: [2]

  - Repainted ID_AA64MMFR2_EL1.IDS description (Oliver)

  - Made the IDST handling more generic in the core KVM code, which
    resulted in the series being restructured a bit

  - Added handling to pKVM (in a slightly different way, as pKVM
    insist on seeing a full enumeration of the trapped registers)

  - Some cleanups

  - Collected RBs, with thanks

* From v1: [1]

  - Fixed commit message in patch #4 (Ben)

  - Collected RB, with thanks (Joey)

[1] https://lore.kernel.org/r/20251120133202.2037803-1-maz@kernel.org
[2] https://lore.kernel.org/r/20251126155951.1146317-1-maz@kernel.org

Marc Zyngier (9):
  arm64: Repaint ID_AA64MMFR2_EL1.IDS description
  KVM: arm64: Add trap routing for GMID_EL1
  KVM: arm64: Add a generic synchronous exception injection primitive
  KVM: arm64: Handle FEAT_IDST for sysregs without specific handlers
  KVM: arm64: Handle CSSIDR2_EL1 and SMIDR_EL1 in a generic way
  KVM: arm64: Force trap of GMID_EL1 when the guest doesn't have MTE
  KVM: arm64: pkvm: Add a generic synchronous exception injection
    primitive
  KVM: arm64: pkvm: Report optional ID register traps with a 0x18
    syndrome
  KVM: arm64: selftests: Add a test for FEAT_IDST

 arch/arm64/include/asm/kvm_emulate.h          |   1 +
 arch/arm64/kvm/emulate-nested.c               |  28 +++++
 arch/arm64/kvm/hyp/nvhe/sys_regs.c            |  39 ++++--
 arch/arm64/kvm/inject_fault.c                 |  10 +-
 arch/arm64/kvm/sys_regs.c                     |   4 +-
 arch/arm64/tools/sysreg                       |   4 +-
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../testing/selftests/kvm/arm64/idreg-idst.c  | 117 ++++++++++++++++++
 8 files changed, 189 insertions(+), 15 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/arm64/idreg-idst.c

-- 
2.47.3



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

end of thread, other threads:[~2025-12-05  6:25 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-04  9:47 [PATCH v3 0/9] KVM: arm64: Add support for FEAT_IDST Marc Zyngier
2025-12-04  9:47 ` [PATCH v3 1/9] arm64: Repaint ID_AA64MMFR2_EL1.IDS description Marc Zyngier
2025-12-04 10:32   ` Joey Gouly
2025-12-04 10:36   ` Ben Horgan
2025-12-04 10:48     ` Marc Zyngier
2025-12-04 11:13       ` Ben Horgan
2025-12-04 12:02         ` Marc Zyngier
2025-12-04  9:47 ` [PATCH v3 2/9] KVM: arm64: Add trap routing for GMID_EL1 Marc Zyngier
2025-12-04  9:48 ` [PATCH v3 3/9] KVM: arm64: Add a generic synchronous exception injection primitive Marc Zyngier
2025-12-04  9:48 ` [PATCH v3 4/9] KVM: arm64: Handle FEAT_IDST for sysregs without specific handlers Marc Zyngier
2025-12-04 10:52   ` Joey Gouly
2025-12-05  6:10   ` Yao Yuan
2025-12-04  9:48 ` [PATCH v3 5/9] KVM: arm64: Handle CSSIDR2_EL1 and SMIDR_EL1 in a generic way Marc Zyngier
2025-12-05  6:25   ` Yao Yuan
2025-12-04  9:48 ` [PATCH v3 6/9] KVM: arm64: Force trap of GMID_EL1 when the guest doesn't have MTE Marc Zyngier
2025-12-05  6:02   ` Yao Yuan
2025-12-04  9:48 ` [PATCH v3 7/9] KVM: arm64: pkvm: Add a generic synchronous exception injection primitive Marc Zyngier
2025-12-04  9:48 ` [PATCH v3 8/9] KVM: arm64: pkvm: Report optional ID register traps with a 0x18 syndrome Marc Zyngier
2025-12-04 10:51   ` Ben Horgan
2025-12-04 12:06     ` Marc Zyngier
2025-12-04  9:48 ` [PATCH v3 9/9] KVM: arm64: selftests: Add a test for FEAT_IDST Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).