Skip to content

FPSIMD restore bypass and protecting

Andrew Scull kvmarm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10KVM: arm64: Leave KVM_ARM64_DEBUG_DIRTY updates to the hostarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/debug.c arch/arm64/kvm/hyp/include/hyp/debug-sr.h+3 -30 replies
2/10KVM: arm64: Synchronize vcpu FPSIMD in the hostarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/arm.c arch/arm64/kvm/fpsimd.c +3 more+32 -260 replies
3/10KVM: arm64: Unmap host task thread flags from hyparch/arm64/include/asm/kvm_host.h arch/arm64/kvm/fpsimd.c+1 -120 replies
4/10KVM: arm64: Support smp_processor_id() in nVHE hyparch/arm64/kvm/arm.c arch/arm64/kvm/hyp/nvhe/hyp-smp.c+4 -03 replies
5/10KVM: arm64: Track where vcpu FP state was last loadedarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/arm.c arch/arm64/kvm/hyp/include/hyp/switch.h+5 -02 replies
6/10KVM: arm64: Avoid needlessly reloading guest FP statearch/arm64/include/asm/fpsimd.h arch/arm64/kernel/fpsimd.c arch/arm64/kvm/fpsimd.c+26 -40 replies
7/10KVM: arm64: Separate host and hyp vcpu FP flagsarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/fpsimd.c arch/arm64/kvm/hyp/include/hyp/switch.h +2 more+44 -270 replies
8/10KVM: arm64: Pass the arch run struct explicitlyarch/arm64/kvm/hyp/include/hyp/switch.h arch/arm64/kvm/hyp/nvhe/switch.c arch/arm64/kvm/hyp/vhe/switch.c+14 -110 replies
9/10KVM: arm64: Use hyp-private run struct in protected modearch/arm64/kvm/hyp/nvhe/switch.c+30 -30 replies
10/10RFC: KVM: arm64: Manage FPSIMD state at EL2 for protected vCPUsarch/arm64/include/asm/kvm_host.h arch/arm64/include/asm/kvm_hyp.h arch/arm64/kvm/hyp/include/hyp/switch.h +3 more+105 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/10] FPSIMD restore bypass and protecting

This series build towards protecting of FPSIMD state in protected KVM. Most of the series is refactoring to create separation between host and hyp for when that is needed.

There was the need to track where a vcpu last loaded its FPSIMD state so I've also made use of this to avoid needless reloading of vcpu FPSIMD state when that's possible. I don't know if this makes any performance difference and don't know what a meaningful benchmark would be to measure against so help and advice on this front would be appreciated.

The last patch in the series is concerned with the protecting of a protected VM's FPSIMD state. It will depend on knowing which vcpus are protected and having a stage 2 over the host but demonstrates the trapping and lazy switching that I had in mind.

The series has, so far, only been lightly tested on qemu with paranoia running on the host and in the vcpu.

It applies atop 5.12-rc.

This is similar, but much evolved, version of a series sent out last year:
https://lore.kernel.org/r/[email protected]/

Andrew Scull (10):
KVM: arm64: Leave KVM_ARM64_DEBUG_DIRTY updates to the host
KVM: arm64: Synchronize vcpu FPSIMD in the host
KVM: arm64: Unmap host task thread flags from hyp
KVM: arm64: Support smp_processor_id() in nVHE hyp
KVM: arm64: Track where vcpu FP state was last loaded
KVM: arm64: Avoid needlessly reloading guest FP state
KVM: arm64: Separate host and hyp vcpu FP flags
KVM: arm64: Pass the arch run struct explicitly
KVM: arm64: Use hyp-private run struct in protected mode
RFC: KVM: arm64: Manage FPSIMD state at EL2 for protected vCPUs

 arch/arm64/include/asm/fpsimd.h           |   1 +
 arch/arm64/include/asm/kvm_host.h         |  46 +++++++---
 arch/arm64/include/asm/kvm_hyp.h          |   1 +
 arch/arm64/kernel/fpsimd.c                |  11 ++-
 arch/arm64/kvm/arm.c                      |   8 +-
 arch/arm64/kvm/debug.c                    |   2 +
 arch/arm64/kvm/fpsimd.c                   |  69 +++++++++++----
 arch/arm64/kvm/hyp/include/hyp/debug-sr.h |   2 -
 arch/arm64/kvm/hyp/include/hyp/switch.h   |  57 ++++++------
 arch/arm64/kvm/hyp/nvhe/hyp-main.c        |  24 ++++++
 arch/arm64/kvm/hyp/nvhe/hyp-smp.c         |   2 +
 arch/arm64/kvm/hyp/nvhe/switch.c          | 100 ++++++++++++++++++----
 arch/arm64/kvm/hyp/vhe/switch.c           |   8 +-
 13 files changed, 249 insertions(+), 82 deletions(-)
Signature · 6 lines
2.30.1.766.gb4fecdf3b7-goog

_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm