From: Dave Martin <Dave.Martin@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Marc Zyngier <marc.zyngier@arm.com>, kvmarm@lists.cs.columbia.edu
Subject: [RFC PATCH 0/4] Initial KVM SVE support hacks
Date: Fri, 17 Nov 2017 16:38:51 +0000 [thread overview]
Message-ID: <1510936735-6762-1-git-send-email-Dave.Martin@arm.com> (raw)
Throwing out an RFC here now that I've got something _sort of_ working.
This is based on the base SVE patches as now present in
torvalds/master [1], but not on Christoffer's SVE optimisations (for
now).
In a slightly older version of this code I have seen host user tasks
reaching task_fpsimd_save() with the wrong ZCR setup. This _might_
now be fixed, but if reviewers can pay particular attention to dodgy
looking trapping control or missing context switching that would be
much appreciated!
Notes:
Currently, I grow the vcpu slab size to be large enough to accommodate
the SVE state dangling at the end, and extend the existing FPSIMD
handling paths in KVM to deal with SVE.
Guests are allowed to use SVE whenever the system supports it, and
full SVE context is tracked unconditionally for each vcpu.
The next things to decide are
a) how broken this implementation approach is
b) how (or whether) to enable userspace to control whether SVE is
available to the guest and if so with what maximum vector length
c) what the ioctl interface should look like.
Patches 1-3 contain some relevant tweaks and fixes.
Patch 4 contains the actual implementation: this is consciously a bit
of a hack today -- more detailed notes in the commit message.
[1] c9b012e5f4a1 ("Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux")
Dave Martin (4):
arm64: fpsimd: Abstract out binding of task's fpsimd context to the
cpu.
arm64/sve: KVM: Avoid dereference of dead task during guest entry
arm64/sve: KVM: Ensure user SVE use traps after vcpu execution
arm64/sve: KVM: Basic SVE support
arch/arm64/include/asm/fpsimdmacros.h | 8 +++++
arch/arm64/include/asm/kvm_host.h | 30 ++++++++++++++++++
arch/arm64/include/asm/kvm_hyp.h | 4 +++
arch/arm64/include/asm/sysreg.h | 1 +
arch/arm64/kernel/asm-offsets.c | 8 +++++
arch/arm64/kernel/entry-fpsimd.S | 1 -
arch/arm64/kernel/fpsimd.c | 53 +++++++++++++++++++------------
arch/arm64/kvm/handle_exit.c | 2 +-
arch/arm64/kvm/hyp/entry.S | 60 ++++++++++++++++++++++++++++-------
arch/arm64/kvm/hyp/fpsimd.S | 12 +++++++
arch/arm64/kvm/hyp/hyp-entry.S | 7 ++++
arch/arm64/kvm/hyp/switch.c | 46 ++++++++++++++++++++++++++-
arch/arm64/kvm/reset.c | 18 +++++++++++
arch/arm64/kvm/sys_regs.c | 39 ++++++++++++++++-------
virt/kvm/arm/arm.c | 18 ++++++++---
15 files changed, 256 insertions(+), 51 deletions(-)
--
2.1.4
next reply other threads:[~2017-11-17 16:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-17 16:38 Dave Martin [this message]
2017-11-17 16:38 ` [RFC PATCH 1/4] arm64: fpsimd: Abstract out binding of task's fpsimd context to the cpu Dave Martin
2017-11-17 16:38 ` [RFC PATCH 2/4] arm64/sve: KVM: Avoid dereference of dead task during guest entry Dave Martin
2017-11-22 19:23 ` Christoffer Dall
2017-11-23 14:16 ` Dave Martin
2017-11-17 16:38 ` [RFC PATCH 3/4] arm64/sve: KVM: Ensure user SVE use traps after vcpu execution Dave Martin
2017-11-22 19:23 ` Christoffer Dall
2017-11-23 14:34 ` Dave Martin
2017-11-17 16:38 ` [RFC PATCH 4/4] arm64/sve: KVM: Basic SVE support Dave Martin
2017-11-22 19:23 ` Christoffer Dall
2017-11-23 18:06 ` Dave Martin
2017-11-23 18:49 ` Christoffer Dall
2017-11-25 17:48 ` Andrew Jones
2017-11-17 16:45 ` [RFC PATCH 0/4] Initial KVM SVE support hacks Dave Martin
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=1510936735-6762-1-git-send-email-Dave.Martin@arm.com \
--to=dave.martin@arm.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=marc.zyngier@arm.com \
/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