mbox series

[0/7] KVM: arm64: Add support for FP8

Message ID 20240708154438.1218186-1-maz@kernel.org (mailing list archive)
Headers show
Series KVM: arm64: Add support for FP8 | expand

Message

Marc Zyngier July 8, 2024, 3:44 p.m. UTC
Although FP8 support was merged in 6.9, the KVM side was dropped, with
no sign of it being picked up again. Given that its absence is getting
in the way of NV upstreaming (HCRX_EL2 needs fleshing out), here's a
small series addressing it.

The support is following the save/restore model established for the
rest of the FP code, with FPMR being tied to it. The sole additions
are the handling of traps in a nested context, and the corresponding
ID registers being made writable. As an extra cleanup, SVCR and FPMR
are moved into the sysreg array.

Patches are on top of kvmarm/next, as this would otherwise majorly
conflict. Note that this is compile-tested only, as I have no access
to FP8 HW or model (and running NV in a model is not something I wish
to entertain ever again).

Also, this is *not* 6.11 material. 6.12 if we're lucky.

Marc Zyngier (7):
  KVM: arm64: Move SVCR into the sysreg array
  KVM: arm64: Move FPMR into the sysreg array
  KVM: arm64: Add save/restore support for FPMR
  KVM: arm64: Honor trap routing for FPMR
  KVM: arm64: Expose ID_AA64FPFR0_EL1 as a writable ID reg
  KVM: arm64: Enable FP8 support when available and configured
  KVM: arm64: Expose ID_AA64PFR2_EL1 to userspace and guests

 arch/arm64/include/asm/kvm_host.h  | 16 ++++++++++--
 arch/arm64/kvm/emulate-nested.c    |  8 ++++++
 arch/arm64/kvm/fpsimd.c            |  5 ++--
 arch/arm64/kvm/hyp/nvhe/hyp-main.c |  4 +++
 arch/arm64/kvm/hyp/nvhe/switch.c   | 10 +++++++
 arch/arm64/kvm/hyp/vhe/switch.c    |  4 +++
 arch/arm64/kvm/sys_regs.c          | 42 +++++++++++++++++++++++++++---
 7 files changed, 82 insertions(+), 7 deletions(-)

Comments

Mark Brown July 8, 2024, 5:53 p.m. UTC | #1
On Mon, Jul 08, 2024 at 04:44:31PM +0100, Marc Zyngier wrote:

> Although FP8 support was merged in 6.9, the KVM side was dropped, with
> no sign of it being picked up again. Given that its absence is getting
> in the way of NV upstreaming (HCRX_EL2 needs fleshing out), here's a
> small series addressing it.

Thanks, I've been prioritising SME since this was going to conflict with
it and some of your comments on the prior version sounded like you would
block things on a bigger refectoring of the interface with the host
kernel which definitely needs to wait for after SME (I do want to redo
the whole way the host stores FP data for threads which would be a good
time for such a refactoring).  Hopefully there'll be a version of the
SME patches suitable for ABI review this week.

Other than the issue with restoring FPMR for the guest these look good
to inspection.