From: Paolo Bonzini <pbonzini@redhat.com>
To: Tom Lendacky <thomas.lendacky@amd.com>,
x86@kernel.org, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org
Cc: "Joerg Roedel" <joro@8bytes.org>,
"Borislav Petkov" <bp@alien8.de>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [RFC PATCH 2/2] KVM: SVM: Add MSR feature support for serializing LFENCE
Date: Wed, 14 Feb 2018 11:08:33 +0100 [thread overview]
Message-ID: <1e3e64dc-00e4-adbd-2dd7-c44f8886ea52@redhat.com> (raw)
In-Reply-To: <ee66fc2c-ba57-29da-0a03-498bc45a40fb@amd.com>
On 14/02/2018 05:39, Tom Lendacky wrote:
> On 2/13/2018 10:22 AM, Paolo Bonzini wrote:
>> On 08/02/2018 23:58, Tom Lendacky wrote:
>>> Create an entry in the new MSR as a feature framework to allow a guest to
>>> recognize LFENCE as a serializing instruction on AMD processors. The MSR
>>> can only be set by the host, any write by the guest will be ignored. A
>>> read by the guest will return the value as set by the host. In this way,
>>> the support to expose the feature to the guest is controlled by the
>>> hypervisor.
>>>
>>> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
>>> ---
>>> arch/x86/kvm/svm.c | 16 ++++++++++++++++
>>> arch/x86/kvm/x86.c | 6 ++++++
>>> 2 files changed, 22 insertions(+)
>>>
>>> @@ -4047,6 +4052,17 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
>>> case MSR_VM_IGNNE:
>>> vcpu_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data);
>>> break;
>>> + case MSR_F10H_DECFG:
>>> + /* Only the host can set this MSR, silently ignore */
>>> + if (!msr->host_initiated)
>>> + break;
>>
>> Just one thing I'm wondering, should we #GP if the guest attempts to
>> clear MSR_F10H_DECFG_LFENCE_SERIALIZE?
>
> It would be more consistent with other entries to do "return 1" here
> instead. The current kernel code that writes this bit is using
> msr_set_bit(), so a #GP is caught and handled.
That's also okay. We don't know about Windows though...
Paolo
next prev parent reply other threads:[~2018-02-14 10:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-08 22:58 [RFC PATCH 0/2] KVM: MSR-based features Tom Lendacky
2018-02-08 22:58 ` [RFC PATCH 1/2] KVM: x86: Add a framework for supporting " Tom Lendacky
2018-02-13 16:21 ` Paolo Bonzini
2018-02-14 4:23 ` Tom Lendacky
2018-02-13 16:25 ` Paolo Bonzini
2018-02-14 4:42 ` Tom Lendacky
2018-02-14 16:41 ` Paolo Bonzini
2018-02-14 16:44 ` Borislav Petkov
2018-02-14 16:58 ` Paolo Bonzini
2018-02-08 22:58 ` [RFC PATCH 2/2] KVM: SVM: Add MSR feature support for serializing LFENCE Tom Lendacky
2018-02-13 16:22 ` Paolo Bonzini
2018-02-14 4:39 ` Tom Lendacky
2018-02-14 10:08 ` Paolo Bonzini [this message]
2018-02-08 23:03 ` [RFC PATCH 0/2] KVM: MSR-based features Tom Lendacky
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=1e3e64dc-00e4-adbd-2dd7-c44f8886ea52@redhat.com \
--to=pbonzini@redhat.com \
--cc=bp@alien8.de \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkrcmar@redhat.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