Skip to content

KVM: arm64: NV userspace ABI

Marc Zyngier kvm kvmarm linux-arm-kernel 2 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. v2 Latest14 patches 8 repliesApplied
  2. v114 patches 8 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/14arm64: cpufeature: Handle NV_frac as a synonym of NV2arch/arm64/kernel/cpufeature.c+13 -21 reply
2/14KVM: arm64: Hide ID_AA64MMFR2_EL1.NV from guest and userspacearch/arm64/kvm/sys_regs.c+1 -03 replies
3/14KVM: arm64: Mark HCR.EL2.E2H RES0 when ID_AA64MMFR1_EL1.VH is zeroarch/arm64/kvm/nested.c+2 -00 replies
4/14KVM: arm64: Mark HCR.EL2.{NV*,AT} RES0 when ID_AA64MMFR4_EL1.NV_frac is 0arch/arm64/kvm/nested.c+5 -40 replies
5/14KVM: arm64: Advertise NV2 in the boot messagesarch/arm64/kvm/arm.c+3 -20 replies
6/14KVM: arm64: Consolidate idreg callbacksarch/arm64/kvm/sys_regs.c+10 -181 reply
7/14KVM: arm64: Make ID_REG_LIMIT_FIELD_ENUM() more widely availablearch/arm64/kvm/sys_regs.c arch/arm64/kvm/sys_regs.h+10 -100 replies
8/14KVM: arm64: Enforce NV limits on a per-idregs basisarch/arm64/kvm/nested.c+136 -1030 replies
9/14KVM: arm64: Move NV-specific capping to idreg sanitisationarch/arm64/include/asm/kvm_nested.h arch/arm64/kvm/nested.c arch/arm64/kvm/sys_regs.c+5 -440 replies
10/14KVM: arm64: Allow userspace to limit NV support to nVHEarch/arm64/include/uapi/asm/kvm.h arch/arm64/kvm/nested.c+27 -21 reply
11/14KVM: arm64: Make ID_AA64MMFR4_EL1.NV_frac writablearch/arm64/kvm/sys_regs.c+1 -10 replies
12/14KVM: arm64: Advertise FEAT_ECV when possiblearch/arm64/kvm/nested.c+5 -30 replies
13/14KVM: arm64: Allow userspace to request KVM_ARM_VCPU_EL2*arch/arm64/include/asm/kvm_host.h arch/arm64/kvm/arm.c include/uapi/linux/kvm.h+9 -10 replies
14/14KVM: arm64: Document NV caps and vcpu flagsDocumentation/virt/kvm/api.rst+13 -10 replies

Reviews trailers per patch

3 of 14 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchOliver UptonJoey GoulyGanapatrao Kulkarni
SeriesR-b
1/14
2/14
3/14
4/14
5/14
6/14R-b
7/14
8/14
9/14
10/14
11/14
12/14
13/14R-b
14/14R-b

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 v2 thread

Cover letter [PATCH v2 00/14] KVM: arm64: NV userspace ABI

Since the previous incarnation of the ABI was proved to be subtly wrong, I have reworked it to be more in line with the current way KVM operates.

No more late NV-specific adjustment nor writable ID_AA64MMFR0_EL1.VH. The NV configuration is now entirely selected from the vcpu flags. I've preserved the KVM_ARM_VCPU_EL2 flag which enables NV with VHE, and added KVM_ARM_VCPU_EL2_E2H0 which alters the NV behaviour to only allow nVHE guests without recursive NV support.

This series is actually very little new code. The bulk of it is converting the feature downgrade to be per-idreg, essentially going back to the state before 44241f34fac96 ("KVM: arm64: nv: Use accessors for modifying ID registers"), only slightly modernised. This then becomes part of the reset value computing.

The rest is simply what you'd expect in terms of being able to write the ID_AA64MMFR4_EL1.NV_frac field, making the correct bits RES0 when needed, probing for capabilities and handling the init flags.

Patches on top of -rc3, with the integration branch at the usual location.

* From v1 [1]

- Fixed mishandling of ID_UNALLOCATED(), resulting in extra consolidation and simplify the macro maze a bit

- Picked up Oliver's RBs (thanks!)

- Rebased on top of -rc3

[1] https://lore.kernel.org/r/[email protected]

Marc Zyngier (14):
arm64: cpufeature: Handle NV_frac as a synonym of NV2
KVM: arm64: Hide ID_AA64MMFR2_EL1.NV from guest and userspace
KVM: arm64: Mark HCR.EL2.E2H RES0 when ID_AA64MMFR1_EL1.VH is zero
KVM: arm64: Mark HCR.EL2.{NV*,AT} RES0 when ID_AA64MMFR4_EL1.NV_frac
is 0
KVM: arm64: Advertise NV2 in the boot messages
KVM: arm64: Consolidate idreg callbacks
KVM: arm64: Make ID_REG_LIMIT_FIELD_ENUM() more widely available
KVM: arm64: Enforce NV limits on a per-idregs basis
KVM: arm64: Move NV-specific capping to idreg sanitisation
KVM: arm64: Allow userspace to limit NV support to nVHE
KVM: arm64: Make ID_AA64MMFR4_EL1.NV_frac writable
KVM: arm64: Advertise FEAT_ECV when possible
KVM: arm64: Allow userspace to request KVM_ARM_VCPU_EL2*
KVM: arm64: Document NV caps and vcpu flags

 Documentation/virt/kvm/api.rst      |  14 +-
 arch/arm64/include/asm/kvm_host.h   |   2 +-
 arch/arm64/include/asm/kvm_nested.h |   1 +
 arch/arm64/include/uapi/asm/kvm.h   |   1 +
 arch/arm64/kernel/cpufeature.c      |  15 +-
 arch/arm64/kvm/arm.c                |  11 +-
 arch/arm64/kvm/nested.c             | 285 +++++++++++++++-------------
 arch/arm64/kvm/sys_regs.c           |  44 ++---
 arch/arm64/kvm/sys_regs.h           |  10 +
 include/uapi/linux/kvm.h            |   2 +
 10 files changed, 217 insertions(+), 168 deletions(-)
Signature · 1 line
2.39.2