linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/14] KVM: arm64: NV userspace ABI
@ 2025-02-20 13:48 Marc Zyngier
  2025-02-20 13:48 ` [PATCH v2 01/14] arm64: cpufeature: Handle NV_frac as a synonym of NV2 Marc Zyngier
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Marc Zyngier @ 2025-02-20 13:48 UTC (permalink / raw)
  To: kvmarm, kvm, linux-arm-kernel
  Cc: Joey Gouly, Suzuki K Poulose, Oliver Upton, Zenghui Yu,
	Eric Auger, gankulkarni

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/20250215173816.3767330-1-maz@kernel.org

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(-)

-- 
2.39.2



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

end of thread, other threads:[~2025-02-24 19:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20 13:48 [PATCH v2 00/14] KVM: arm64: NV userspace ABI Marc Zyngier
2025-02-20 13:48 ` [PATCH v2 01/14] arm64: cpufeature: Handle NV_frac as a synonym of NV2 Marc Zyngier
2025-02-20 14:03   ` Joey Gouly
2025-02-20 13:48 ` [PATCH v2 02/14] KVM: arm64: Hide ID_AA64MMFR2_EL1.NV from guest and userspace Marc Zyngier
2025-02-20 17:36   ` Sebastian Ott
2025-02-20 19:46     ` Marc Zyngier
2025-02-21  7:52       ` Sebastian Ott
2025-02-20 13:48 ` [PATCH v2 05/14] KVM: arm64: Advertise NV2 in the boot messages Marc Zyngier
2025-02-20 13:48 ` [PATCH v2 06/14] KVM: arm64: Consolidate idreg callbacks Marc Zyngier
2025-02-20 15:43   ` Ganapatrao Kulkarni
2025-02-20 13:49 ` [PATCH v2 08/14] KVM: arm64: Enforce NV limits on a per-idregs basis Marc Zyngier
2025-02-20 13:49 ` [PATCH v2 11/14] KVM: arm64: Make ID_AA64MMFR4_EL1.NV_frac writable Marc Zyngier
2025-02-20 13:49 ` [PATCH v2 14/14] KVM: arm64: Document NV caps and vcpu flags Marc Zyngier
2025-02-20 14:04 ` [PATCH v2 00/14] KVM: arm64: NV userspace ABI Joey Gouly
     [not found] ` <20250220134907.554085-11-maz@kernel.org>
2025-02-24  9:44   ` [PATCH v2 10/14] KVM: arm64: Allow userspace to limit NV support to nVHE Aneesh Kumar K.V
2025-02-24 19:52 ` (subset) [PATCH v2 00/14] KVM: arm64: NV userspace ABI Oliver Upton

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).