Skip to content

KVM: arm64: Add support for FEAT_IDST

Marc Zyngier kvm kvmarm linux-arm-kernel 4 versions – Applied

Status from this message: Applied to next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest9 patches 1 replyApplied
  2. v39 patches 11 repliesSuperseded
  3. v25 patches 11 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v15 patches4 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/9arm64: Repaint ID_AA64MMFR2_EL1.IDS descriptionarch/arm64/kvm/hyp/nvhe/sys_regs.c arch/arm64/tools/sysreg+5 -40 replies
2/9KVM: arm64: Add trap routing for GMID_EL1arch/arm64/kvm/emulate-nested.c+8 -00 replies
3/9KVM: arm64: Add a generic synchronous exception injection primitivearch/arm64/include/asm/kvm_emulate.h arch/arm64/kvm/inject_fault.c+8 -30 replies
4/9KVM: arm64: Handle FEAT_IDST for sysregs without specific handlersarch/arm64/kvm/emulate-nested.c arch/arm64/kvm/sys_regs.h+23 -00 replies
5/9KVM: arm64: Handle CSSIDR2_EL1 and SMIDR_EL1 in a generic wayarch/arm64/kvm/sys_regs.c+0 -20 replies
6/9KVM: arm64: Force trap of GMID_EL1 when the guest doesn't have MTEarch/arm64/kvm/sys_regs.c+2 -00 replies
7/9KVM: arm64: pkvm: Add a generic synchronous exception injection primitivearch/arm64/kvm/hyp/nvhe/sys_regs.c+15 -70 replies
8/9KVM: arm64: pkvm: Report optional ID register traps with a 0x18 syndromearch/arm64/kvm/hyp/nvhe/sys_regs.c+15 -00 replies
9/9KVM: arm64: selftests: Add a test for FEAT_IDSTtools/testing/selftests/kvm/Makefile.kvm tools/testing/selftests/kvm/arm64/idreg-idst.c+118 -00 replies

Reviews trailers per patch

5 of 9 patches have a Reviewed-by or Acked-by.

PatchJoey GoulyBen HorganYuan Yao
1/9R-b
2/9
3/9R-b R-b
4/9R-b R-b
5/9R-b
6/9R-b R-b
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/9] KVM: arm64: Add support for FEAT_IDST

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/[email protected]
[2] https://lore.kernel.org/r/[email protected]
[3] https://lore.kernel.org/r/[email protected]

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
Signature · 1 line
2.47.3