From: Marc Zyngier <maz@kernel.org>
To: kvmarm@lists.linux.dev, kvm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: Joey Gouly <joey.gouly@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Oliver Upton <oupton@kernel.org>,
Zenghui Yu <yuzenghui@huawei.com>,
Ben Horgan <ben.horgan@arm.com>,
Yao Yuan <yaoyuan@linux.alibaba.com>
Subject: [PATCH v4 0/9] KVM: arm64: Add support for FEAT_IDST
Date: Thu, 8 Jan 2026 17:32:24 +0000 [thread overview]
Message-ID: <20260108173233.2911955-1-maz@kernel.org> (raw)
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 v3: [3]
- Added ID_AA64MMFR2_EL1.IDS == EL3 (Ben)
- Introduced in_feat_id_space() helper (Yao)
- Collected RBs, with thanks
* 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
[3] https://lore.kernel.org/r/20251204094806.3846619-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 | 21 ++++
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/kvm/sys_regs.h | 10 ++
arch/arm64/tools/sysreg | 7 +-
tools/testing/selftests/kvm/Makefile.kvm | 1 +
.../testing/selftests/kvm/arm64/idreg-idst.c | 117 ++++++++++++++++++
9 files changed, 194 insertions(+), 16 deletions(-)
create mode 100644 tools/testing/selftests/kvm/arm64/idreg-idst.c
--
2.47.3
next reply other threads:[~2026-01-08 17:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-08 17:32 Marc Zyngier [this message]
2026-01-08 17:32 ` [PATCH v4 1/9] arm64: Repaint ID_AA64MMFR2_EL1.IDS description Marc Zyngier
2026-01-08 17:32 ` [PATCH v4 2/9] KVM: arm64: Add trap routing for GMID_EL1 Marc Zyngier
2026-01-08 17:32 ` [PATCH v4 3/9] KVM: arm64: Add a generic synchronous exception injection primitive Marc Zyngier
2026-01-08 17:32 ` [PATCH v4 4/9] KVM: arm64: Handle FEAT_IDST for sysregs without specific handlers Marc Zyngier
2026-01-08 17:32 ` [PATCH v4 5/9] KVM: arm64: Handle CSSIDR2_EL1 and SMIDR_EL1 in a generic way Marc Zyngier
2026-01-08 17:32 ` [PATCH v4 6/9] KVM: arm64: Force trap of GMID_EL1 when the guest doesn't have MTE Marc Zyngier
2026-01-08 17:32 ` [PATCH v4 7/9] KVM: arm64: pkvm: Add a generic synchronous exception injection primitive Marc Zyngier
2026-01-08 17:32 ` [PATCH v4 8/9] KVM: arm64: pkvm: Report optional ID register traps with a 0x18 syndrome Marc Zyngier
2026-01-08 17:32 ` [PATCH v4 9/9] KVM: arm64: selftests: Add a test for FEAT_IDST Marc Zyngier
2026-01-15 12:07 ` [PATCH v4 0/9] KVM: arm64: Add support " Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260108173233.2911955-1-maz@kernel.org \
--to=maz@kernel.org \
--cc=ben.horgan@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=oupton@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=yaoyuan@linux.alibaba.com \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox