All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] KVM: arm64: Stop mapping current thread_info at EL2
@ 2021-10-21 15:11 ` Marc Zyngier
  0 siblings, 0 replies; 24+ messages in thread
From: Marc Zyngier @ 2021-10-21 15:11 UTC (permalink / raw)
  To: kvmarm, kvm, linux-arm-kernel
  Cc: James Morse, Suzuki K Poulose, Alexandru Elisei, Quentin Perret,
	Will Deacon, broonie, kernel-team

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.

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.

Marc Zyngier (4):
  KVM: arm64: Reorder vcpu flag definitions
  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       | 28 ++++++++++++-------------
 arch/arm64/kernel/fpsimd.c              |  5 ++++-
 arch/arm64/kvm/arm.c                    |  1 +
 arch/arm64/kvm/fpsimd.c                 | 20 ++++++++----------
 arch/arm64/kvm/hyp/include/hyp/switch.h |  3 +--
 arch/arm64/kvm/hyp/nvhe/switch.c        |  1 -
 arch/arm64/kvm/hyp/vhe/switch.c         |  1 -
 7 files changed, 29 insertions(+), 30 deletions(-)

-- 
2.30.2


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

end of thread, other threads:[~2021-10-27 11:28 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 15:11 [PATCH 0/4] KVM: arm64: Stop mapping current thread_info at EL2 Marc Zyngier
2021-10-21 15:11 ` Marc Zyngier
2021-10-21 15:11 ` Marc Zyngier
2021-10-21 15:11 ` [PATCH 1/4] KVM: arm64: Reorder vcpu flag definitions Marc Zyngier
2021-10-21 15:11   ` Marc Zyngier
2021-10-21 15:11   ` Marc Zyngier
2021-10-21 15:11 ` [PATCH 2/4] KVM: arm64: Introduce flag shadowing TIF_FOREIGN_FPSTATE Marc Zyngier
2021-10-21 15:11   ` Marc Zyngier
2021-10-21 15:11   ` Marc Zyngier
2021-10-21 15:24   ` Mark Brown
2021-10-21 15:24     ` Mark Brown
2021-10-21 15:24     ` Mark Brown
2021-10-21 15:11 ` [PATCH 3/4] KVM: arm64: Stop mapping current thread_info at EL2 Marc Zyngier
2021-10-21 15:11   ` Marc Zyngier
2021-10-21 15:11   ` Marc Zyngier
2021-10-21 15:11 ` [PATCH 4/4] arm64/fpsimd: Document the use of TIF_FOREIGN_FPSTATE by KVM Marc Zyngier
2021-10-21 15:11   ` Marc Zyngier
2021-10-21 15:11   ` Marc Zyngier
2021-10-21 15:57   ` Mark Brown
2021-10-21 15:57     ` Mark Brown
2021-10-21 15:57     ` Mark Brown
2021-10-27 11:26     ` Marc Zyngier
2021-10-27 11:26       ` Marc Zyngier
2021-10-27 11:26       ` 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.