From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Joel Schopp <joel.schopp@amd.com>
Cc: Gleb Natapov <gleb@kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>,
kvm@vger.kernel.org, Joerg Roedel <joro@8bytes.org>,
Borislav Petkov <bp@alien8.de>,
linux-kernel@vger.kernel.org, David Kaplan <david.kaplan@amd.com>
Subject: Re: [PATCH] x86: svm: don't intercept CR0 TS or MP bit write
Date: Wed, 25 Feb 2015 21:26:01 +0100 [thread overview]
Message-ID: <20150225202600.GA11660@potion.brq.redhat.com> (raw)
In-Reply-To: <54ECEC2F.1090700@amd.com>
2015-02-24 15:25-0600, Joel Schopp:
>
> >> - clr_cr_intercept(svm, INTERCEPT_CR0_WRITE);
> >> } else {
> >> set_cr_intercept(svm, INTERCEPT_CR0_READ);
> > (There is no point in checking fpu_active if cr0s are equal.)
> >
> >> - set_cr_intercept(svm, INTERCEPT_CR0_WRITE);
> > KVM uses lazy FPU and the state is undefined before the first access.
> > We set cr0.ts when !svm->vcpu.fpu_active to detect the first access, but
> > if we allow the guest to clear cr0.ts without exiting, it can access FPU
> > with undefined state.
> Thanks for the valuable feedback. It's apparent I hadn't thought
> through the interaction with lazy FPU and will need to go back and
> rethink my approach here.
I don't think we can gain much without sacrificing some laziness, like:
when a guest with lazy FPU clears CR0.TS, it is going to use that FPU,
so we could pre-load FPU in this case and drop the write intercept too;
guests that unconditionally clear CR0.TS would perform worse though.
It's going to take a lot of time, but two hunks in your patch, that made
selective intercept benefit from decode assists, look useful even now.
Would you post them separately?
Thanks.
next prev parent reply other threads:[~2015-02-25 20:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-20 22:44 [PATCH] x86: svm: don't intercept CR0 TS or MP bit write Joel Schopp
2015-02-23 19:17 ` Radim Krčmář
2015-02-24 21:25 ` Joel Schopp
2015-02-25 20:26 ` Radim Krčmář [this message]
2015-02-25 22:39 ` Joel Schopp
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=20150225202600.GA11660@potion.brq.redhat.com \
--to=rkrcmar@redhat.com \
--cc=bp@alien8.de \
--cc=david.kaplan@amd.com \
--cc=gleb@kernel.org \
--cc=joel.schopp@amd.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.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