| From: |
| Marc Zyngier <maz-AT-kernel.org> |
| To: |
| kvmarm-AT-lists.linux.dev, kvm-AT-vger.kernel.org, linux-arm-kernel-AT-lists.infradead.org |
| Subject: |
| [PATCH 0/5] KVM: arm64: Add support for FEAT_IDST |
| Date: |
| Thu, 20 Nov 2025 13:31:57 +0000 |
| Message-ID: |
| <20251120133202.2037803-1-maz@kernel.org> |
| Cc: |
| Joey Gouly <joey.gouly-AT-arm.com>, Suzuki K Poulose <suzuki.poulose-AT-arm.com>, Oliver Upton <oupton-AT-kernel.org>, Zenghui Yu <yuzenghui-AT-huawei.com> |
| Archive-link: |
| Article |
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.
Marc Zyngier (5):
KVM: arm64: Add routing/handling for GMID_EL1
KVM: arm64: Force trap of GMID_EL1 when the guest doesn't have MTE
KVM: arm64: Add a generic synchronous exception injection primitive
KVM: arm64: 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 | 8 ++
arch/arm64/kvm/inject_fault.c | 10 +-
arch/arm64/kvm/sys_regs.c | 17 ++-
tools/testing/selftests/kvm/Makefile.kvm | 1 +
.../testing/selftests/kvm/arm64/idreg-idst.c | 117 ++++++++++++++++++
6 files changed, 149 insertions(+), 5 deletions(-)
create mode 100644 tools/testing/selftests/kvm/arm64/idreg-idst.c
--
2.47.3