kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] KVM: arm64: Rework FPSIMD/SVE tracking
@ 2021-10-28 11:16 Marc Zyngier
  2021-10-28 11:16 ` [PATCH v2 1/5] KVM: arm64: Reorder vcpu flag definitions Marc Zyngier
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Marc Zyngier @ 2021-10-28 11:16 UTC (permalink / raw)
  To: kvmarm, kvm, linux-arm-kernel
  Cc: James Morse, Suzuki K Poulose, Alexandru Elisei, Quentin Perret,
	Will Deacon, broonie, kernel-team

This is v2 of this series aiming at simplifying the FP handling.

It recently became apparent that we are mapping each vcpu thread's
thread_info structure at EL2 for the sole purpose of checking on the
TIF_FOREIGN_FPSTATE flag.

Given that this looks like a slightly over-engineered way of sharing a
single bit of information, let's move to a slightly more obvious
implementation by maintaining a vcpu-private shadow flag that
represents the same state.

In the same vein, it appears that the code that deals with saving the
host SVE state when used by the guest can never run, and that's by
construction. This is actually a good thing, because it be guaranteed
to explode on nVHE. Let's get rid of it.

I also take this opportunity to add what looks like a missing, and
nonetheless crucial piece of information to the FPSIMD code regarding
the way KVM (ab)uses the TIF_FOREIGN_FPSTATE.

Lightly tested on an A53 box with a bunch of paranoia instances
running in both host and guests, and more heavily on a FVP to check
the SVE behaviour (using the sve-test selftest running in both host
and guest at the same time).

* From v1 [1]:
  - New patch getting rid of the host SVE save code
  - Reworded the documentation update patch

[1] https://lore.kernel.org/r/20211021151124.3098113-1-maz@kernel.org

Marc Zyngier (5):
  KVM: arm64: Reorder vcpu flag definitions
  KVM: arm64: Get rid of host SVE tracking/saving
  KVM: arm64: Introduce flag shadowing TIF_FOREIGN_FPSTATE
  KVM: arm64: Stop mapping current thread_info at EL2
  arm64/fpsimd: Document the use of TIF_FOREIGN_FPSTATE by KVM

 arch/arm64/include/asm/kvm_host.h       | 29 ++++++++++---------
 arch/arm64/kernel/fpsimd.c              |  6 +++-
 arch/arm64/kvm/arm.c                    |  1 +
 arch/arm64/kvm/fpsimd.c                 | 37 ++++++++++---------------
 arch/arm64/kvm/hyp/include/hyp/switch.h | 30 +++-----------------
 arch/arm64/kvm/hyp/nvhe/switch.c        |  1 -
 arch/arm64/kvm/hyp/vhe/switch.c         |  1 -
 7 files changed, 38 insertions(+), 67 deletions(-)

-- 
2.30.2


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

end of thread, other threads:[~2021-11-23 12:33 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 11:16 [PATCH v2 0/5] KVM: arm64: Rework FPSIMD/SVE tracking Marc Zyngier
2021-10-28 11:16 ` [PATCH v2 1/5] KVM: arm64: Reorder vcpu flag definitions Marc Zyngier
2021-10-28 11:16 ` [PATCH v2 2/5] KVM: arm64: Get rid of host SVE tracking/saving Marc Zyngier
2021-10-28 13:02   ` Mark Brown
2021-11-10 13:19   ` Zenghui Yu
2021-11-22 15:57     ` Marc Zyngier
2021-11-22 17:58       ` Mark Brown
2021-11-22 18:10         ` Marc Zyngier
2021-11-22 18:30           ` Mark Brown
2021-11-23 10:11             ` Marc Zyngier
2021-11-23 12:33               ` Mark Brown
2021-10-28 11:16 ` [PATCH v2 3/5] KVM: arm64: Introduce flag shadowing TIF_FOREIGN_FPSTATE Marc Zyngier
2021-10-28 11:16 ` [PATCH v2 4/5] KVM: arm64: Stop mapping current thread_info at EL2 Marc Zyngier
2021-10-28 11:16 ` [PATCH v2 5/5] arm64/fpsimd: Document the use of TIF_FOREIGN_FPSTATE by KVM Marc Zyngier
2021-10-28 13:14   ` Mark Brown

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