From: Paolo Bonzini <pbonzini@redhat.com>
To: Borislav Petkov <bp@alien8.de>,
Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Andy Lutomirski <luto@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org, Dave Hansen <dave.hansen@intel.com>,
Chang Seok Bae <chang.seok.bae@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Sasha Levin <sashal@kernel.org>,
kvm@vger.kernel.org, Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [PATCH] x86/entry/64: Disallow RDPID in paranoid entry if KVM is enabled
Date: Fri, 21 Aug 2020 10:09:01 +0200 [thread overview]
Message-ID: <3eb94913-662d-5423-21b1-eaf75635142a@redhat.com> (raw)
In-Reply-To: <20200821074743.GB12181@zn.tnic>
On 21/08/20 09:47, Borislav Petkov wrote:
> On Thu, Aug 20, 2020 at 07:50:50PM -0700, Sean Christopherson wrote:
>> + * Disallow RDPID if KVM is enabled as it may consume a guest's TSC_AUX
>> + * if an NMI arrives in KVM's run loop. KVM loads guest's TSC_AUX on
>> + * VM-Enter and may not restore the host's value until the CPU returns
>> + * to userspace, i.e. KVM depends on the kernel not using TSC_AUX.
>> */
> And frankly, this is really unfair. The kernel should be able to use any
> MSR. IOW, KVM needs to be fixed here. I'm sure it context-switches other
> MSRs so one more MSR is not a big deal.
The only MSR that KVM needs to context-switch manually are XSS and
SPEC_CTRL. They tend to be the same on host and guest in which case
they can be optimized away.
All the other MSRs (EFER and PAT are those that come to mind) are
handled by the microcode and thus they don't have the slowness of
RDMSR/WRMSR
One more MSR *is* a big deal: KVM's vmentry+vmexit cost is around 1000
cycles, adding 100 clock cycles for 2 WRMSRs is a 10% increase.
Paolo
next prev parent reply other threads:[~2020-08-21 8:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-21 2:50 Sean Christopherson
2020-08-21 7:24 ` peterz
2020-08-21 7:44 ` Borislav Petkov
2020-08-21 7:47 ` Borislav Petkov
2020-08-21 8:09 ` Paolo Bonzini [this message]
2020-08-21 8:16 ` Borislav Petkov
2020-08-21 9:05 ` Paolo Bonzini
2020-08-21 9:22 ` Borislav Petkov
2020-08-21 9:44 ` Paolo Bonzini
2020-08-21 9:48 ` Borislav Petkov
2020-08-21 10:07 ` Paolo Bonzini
2020-08-22 16:42 ` Andy Lutomirski
2020-09-16 16:54 ` Paolo Bonzini
2020-08-21 9:28 ` Thomas Gleixner
2020-08-21 9:37 ` Paolo Bonzini
2020-08-21 19:55 ` hpa
2020-08-21 20:02 ` Peter Zijlstra
2020-08-21 8:56 ` kernel test robot
2020-08-21 10:28 ` kernel test robot
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=3eb94913-662d-5423-21b1-eaf75635142a@redhat.com \
--to=pbonzini@redhat.com \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=dave.hansen@intel.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=sashal@kernel.org \
--cc=sean.j.christopherson@intel.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=x86@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
all inboxes | Powered by JetHome®