kvmarm.lists.cs.columbia.edu archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: kernel-team@android.com, Will Deacon <will@kernel.org>,
	broonie@kernel.org
Subject: [PATCH v3 0/6] KVM: arm64: Rework FPSIMD/SVE tracking
Date: Wed,  1 Dec 2021 12:04:30 +0000	[thread overview]
Message-ID: <20211201120436.389756-1-maz@kernel.org> (raw)

This is v3 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).

I plan to take this series for a spin in -next immediately.

* From v2 [2]:
  - Removed obsolete comments
  - Removed __sve_save_state which is now unused

* 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
[2] https://lore.kernel.org/r/20211028111640.3663631-1-maz@kernel.org

Marc Zyngier (6):
  KVM: arm64: Reorder vcpu flag definitions
  KVM: arm64: Get rid of host SVE tracking/saving
  KVM: arm64: Remove unused __sve_save_state
  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/include/asm/kvm_hyp.h        |  1 -
 arch/arm64/kernel/fpsimd.c              |  6 +++-
 arch/arm64/kvm/arm.c                    |  1 +
 arch/arm64/kvm/fpsimd.c                 | 40 +++++++++----------------
 arch/arm64/kvm/hyp/fpsimd.S             |  6 ----
 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 -
 9 files changed, 38 insertions(+), 77 deletions(-)

-- 
2.30.2

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

             reply	other threads:[~2021-12-01 12:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 12:04 Marc Zyngier [this message]
2021-12-01 12:04 ` [PATCH v3 1/6] KVM: arm64: Reorder vcpu flag definitions Marc Zyngier
2021-12-01 12:04 ` [PATCH v3 2/6] KVM: arm64: Get rid of host SVE tracking/saving Marc Zyngier
2021-12-01 12:04 ` [PATCH v3 3/6] KVM: arm64: Remove unused __sve_save_state Marc Zyngier
2021-12-01 12:56   ` Mark Brown
2021-12-01 12:04 ` [PATCH v3 4/6] KVM: arm64: Introduce flag shadowing TIF_FOREIGN_FPSTATE Marc Zyngier
2021-12-01 12:04 ` [PATCH v3 5/6] KVM: arm64: Stop mapping current thread_info at EL2 Marc Zyngier
2021-12-01 13:29   ` Mark Brown
2021-12-01 12:04 ` [PATCH v3 6/6] arm64/fpsimd: Document the use of TIF_FOREIGN_FPSTATE by KVM Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211201120436.389756-1-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=broonie@kernel.org \
    --cc=kernel-team@android.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).