linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] KVM: arm64: Fix underallocation of storage for SVE state
@ 2024-06-06 15:21 Mark Brown
  2024-06-06 15:21 ` [PATCH v2 1/4] arm64/fpsimd: Introduce __bit_to_vl() helper Mark Brown
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Mark Brown @ 2024-06-06 15:21 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Marc Zyngier, Oliver Upton,
	James Morse, Suzuki K Poulose, Fuad Tabba
  Cc: linux-arm-kernel, linux-kernel, kvmarm, Mark Brown

As observed during review the pKVM support for saving host SVE state is
broken if an asymmetric system has VLs larger than the maximum shared
VL, fix this by discovering then using the maximum VL for allocations
and using RDVL during the save/restore process.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
Changes in v2:
- Downgrade check for a late CPU increasing maximum VL to a warning only
  but do it unconditionally since pKVM prevents late CPUs anyway.
- Commit log tweaks.
- Link to v1: https://lore.kernel.org/r/20240605-kvm-arm64-fix-pkvm-sve-vl-v1-0-680d6b43b4c1@kernel.org

---
Mark Brown (4):
      arm64/fpsimd: Introduce __bit_to_vl() helper
      arm64/fpsimd: Discover maximum vector length implemented by any CPU
      KVM: arm64: Fix FFR offset calculation for pKVM host state save and restore
      KVM: arm64: Avoid underallocating storage for host SVE state

 arch/arm64/include/asm/fpsimd.h         | 17 +++++++++++++++
 arch/arm64/include/asm/kvm_host.h       |  2 +-
 arch/arm64/include/asm/kvm_hyp.h        |  3 ++-
 arch/arm64/include/asm/kvm_pkvm.h       |  2 +-
 arch/arm64/kernel/fpsimd.c              | 38 +++++++++++++++++++++++++++------
 arch/arm64/kvm/hyp/fpsimd.S             |  5 +++++
 arch/arm64/kvm/hyp/include/hyp/switch.h |  2 +-
 arch/arm64/kvm/hyp/nvhe/hyp-main.c      |  6 +++---
 arch/arm64/kvm/hyp/nvhe/pkvm.c          |  2 +-
 arch/arm64/kvm/reset.c                  |  6 +++---
 10 files changed, 65 insertions(+), 18 deletions(-)
---
base-commit: afb91f5f8ad7af172d993a34fde1947892408f53
change-id: 20240604-kvm-arm64-fix-pkvm-sve-vl-13cd71fd7db0

Best regards,
-- 
Mark Brown <broonie@kernel.org>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2024-07-04 15:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-06 15:21 [PATCH v2 0/4] KVM: arm64: Fix underallocation of storage for SVE state Mark Brown
2024-06-06 15:21 ` [PATCH v2 1/4] arm64/fpsimd: Introduce __bit_to_vl() helper Mark Brown
2024-07-04 14:17   ` Catalin Marinas
2024-06-06 15:21 ` [PATCH v2 2/4] arm64/fpsimd: Discover maximum vector length implemented by any CPU Mark Brown
2024-06-07  7:33   ` Fuad Tabba
2024-07-04 14:18   ` Catalin Marinas
2024-07-04 15:12     ` Mark Brown
2024-06-06 15:21 ` [PATCH v2 3/4] KVM: arm64: Fix FFR offset calculation for pKVM host state save and restore Mark Brown
2024-06-06 15:21 ` [PATCH v2 4/4] KVM: arm64: Avoid underallocating storage for host SVE state Mark Brown
2024-07-04 14:20 ` [PATCH v2 0/4] KVM: arm64: Fix underallocation of storage for " Catalin Marinas

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