All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] KVM: arm64: nv: Implement FEAT_XNX and FEAT_HAF
@ 2025-11-12 18:33 Oliver Upton
  2025-11-12 18:33 ` [PATCH 01/12] arm64: Detect FEAT_XNX Oliver Upton
                   ` (12 more replies)
  0 siblings, 13 replies; 19+ messages in thread
From: Oliver Upton @ 2025-11-12 18:33 UTC (permalink / raw)
  To: kvmarm; +Cc: Marc Zyngier, Joey Gouly, Suzuki K Poulose, Zenghui Yu,
	Oliver Upton

This series closes a couple of gaps between our shadow stage-2
implementation and the architecture:

FEAT_XNX - KVM doesn't make use of the feature for itself but this is
a rather low hanging fruit which entails expressing privileged and
unprivileged execute permissions in our pseudo-TLB

FEAT_HAF - This one is a bit more involved, requiring the PTW
implementations to atomically update descriptors in user memory to set
the Access Flag. I've made the implementation choice that AT
instructions also update the AF which was done to avoid evaluating the
access type in the PTW.

There's more work to be done for FEAT_HAFDBS (dirty state updates),
since updates to DBM are conditional based on the walk context. Lastly,
this is all horribly untested since I don't have an NV-capable machine
with FEAT_HAF that is easy to hack on. Although I do plan on adding some
selftests coverage soon.

Oliver Upton (12):
  arm64: Detect FEAT_XNX
  KVM: arm64: Add support for FEAT_XNX stage-2 permissions
  KVM: arm64: nv: Forward FEAT_XNX permissions to the shadow stage-2
  KVM: arm64: Teach ptdump about FEAT_XNX permissions
  KVM: arm64: nv: Advertise support for FEAT_XNX
  KVM: arm64: Call helper for reading descriptors directly
  KVM: arm64: Handle endianness in read helper for emulated PTW
  KVM: arm64: nv: Use pgtable definitions in stage-2 walk
  KVM: arm64: Add helper for swapping guest descriptor
  KVM: arm64: Implement HW access flag management in stage-1 SW PTW
  KVM: arm64: nv: Implement HW access flag management in stage-2 SW PTW
  KVM: arm64: nv: Expose hardware access flag management to NV guests

 arch/arm64/include/asm/kvm_asm.h     |   6 +-
 arch/arm64/include/asm/kvm_nested.h  |  40 +++++-
 arch/arm64/include/asm/kvm_pgtable.h |  17 ++-
 arch/arm64/kernel/cpufeature.c       |   7 +
 arch/arm64/kvm/at.c                  | 185 ++++++++++++++++++++++++---
 arch/arm64/kvm/hyp/pgtable.c         |  54 +++++++-
 arch/arm64/kvm/mmu.c                 |  26 +++-
 arch/arm64/kvm/nested.c              | 121 ++++++++++++------
 arch/arm64/kvm/ptdump.c              |  35 +++--
 arch/arm64/kvm/sys_regs.c            |   9 +-
 arch/arm64/tools/cpucaps             |   1 +
 11 files changed, 409 insertions(+), 92 deletions(-)


base-commit: dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa
-- 
2.47.3


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

end of thread, other threads:[~2025-11-17 18:13 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-12 18:33 [PATCH 00/12] KVM: arm64: nv: Implement FEAT_XNX and FEAT_HAF Oliver Upton
2025-11-12 18:33 ` [PATCH 01/12] arm64: Detect FEAT_XNX Oliver Upton
2025-11-12 18:33 ` [PATCH 02/12] KVM: arm64: Add support for FEAT_XNX stage-2 permissions Oliver Upton
2025-11-12 18:33 ` [PATCH 03/12] KVM: arm64: nv: Forward FEAT_XNX permissions to the shadow stage-2 Oliver Upton
2025-11-12 18:33 ` [PATCH 04/12] KVM: arm64: Teach ptdump about FEAT_XNX permissions Oliver Upton
2025-11-12 18:33 ` [PATCH 05/12] KVM: arm64: nv: Advertise support for FEAT_XNX Oliver Upton
2025-11-12 18:34 ` [PATCH 06/12] KVM: arm64: Call helper for reading descriptors directly Oliver Upton
2025-11-12 18:34 ` [PATCH 07/12] KVM: arm64: Handle endianness in read helper for emulated PTW Oliver Upton
2025-11-12 18:34 ` [PATCH 08/12] KVM: arm64: nv: Use pgtable definitions in stage-2 walk Oliver Upton
2025-11-12 18:34 ` [PATCH 09/12] KVM: arm64: Add helper for swapping guest descriptor Oliver Upton
2025-11-17 14:14   ` Marc Zyngier
2025-11-17 18:13     ` Oliver Upton
2025-11-12 18:34 ` [PATCH 10/12] KVM: arm64: Implement HW access flag management in stage-1 SW PTW Oliver Upton
2025-11-17 14:49   ` Marc Zyngier
2025-11-17 17:53     ` Oliver Upton
2025-11-12 18:34 ` [PATCH 11/12] KVM: arm64: nv: Implement HW access flag management in stage-2 " Oliver Upton
2025-11-17 14:51   ` Marc Zyngier
2025-11-12 18:34 ` [PATCH 12/12] KVM: arm64: nv: Expose hardware access flag management to NV guests Oliver Upton
2025-11-17 15:21 ` [PATCH 00/12] KVM: arm64: nv: Implement FEAT_XNX and FEAT_HAF Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.