From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] arm64: KVM: remove fpsimd save/restore from the world switch
Date: Fri, 10 Apr 2015 10:36:40 +0100 [thread overview]
Message-ID: <552799A8.1020307@arm.com> (raw)
In-Reply-To: <20150410091215.GC6186@cbox>
On 10/04/15 10:12, Christoffer Dall wrote:
> On Thu, Apr 09, 2015 at 05:53:59PM +0100, Marc Zyngier wrote:
>> The world switch spends quite some time dealing with the FP/SIMD
>> registers, as the state is quite sizeable (32 128bit registers,
>> plus some crumbs on the side). We save/restore them on each
>> entry/exit, so that both the host and the guest always see
>> the state they expect.
>>
>> But let's face it: the host kernel doesn't care. It is the host
>> userspace that actually cares about FP. An obvious improvement is
>> to remove the save/restore from the world switch, and only perform
>> it when we're about to enter/exit the guest (by plugging it into
>> vcpu_load/vcpu_put). The effect is pretty spectacular when running
>> hackbench (which is the only benchmark worth looking at):
>>
> so the kernel never uses fp/simd registers for stuff like memcopies
> etc.?
It can, but wraps it with kernel_neon_begin/kernel_neon_end, which does
its own save-restore. And when we perform our own save/restore, we do it
with interrupts disabled so that the kernel cannot change the state
during that time.
> Can we also make a similar change for ARM on the 32-bit side?
We could, but it is worth evaluating how much better this is compared to
what we have already.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2015-04-10 9:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-09 16:53 [RFC PATCH] arm64: KVM: remove fpsimd save/restore from the world switch Marc Zyngier
2015-04-10 8:41 ` Paolo Bonzini
2015-04-10 9:11 ` Marc Zyngier
2015-04-10 9:13 ` Paolo Bonzini
2015-04-10 9:40 ` Marc Zyngier
2015-04-10 10:01 ` Peter Maydell
2015-04-10 10:08 ` Marc Zyngier
2015-04-10 10:20 ` Catalin Marinas
2015-04-10 9:12 ` Christoffer Dall
2015-04-10 9:36 ` Marc Zyngier [this message]
2015-04-13 12:57 ` Christoffer Dall
2015-04-13 14:12 ` Marc Zyngier
2015-04-13 14:26 ` Christoffer Dall
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=552799A8.1020307@arm.com \
--to=marc.zyngier@arm.com \
--cc=linux-arm-kernel@lists.infradead.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).