From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
linux-kernel@vger.kernel.org,
Tom Lendacky <thomas.lendacky@amd.com>,
Joerg Roedel <joro@8bytes.org>,
x86@kernel.org
Subject: Re: [PATCH] KVM: x86: svm: report MSR_IA32_MCG_EXT_CTL as unsupported
Date: Fri, 21 Dec 2018 11:06:52 +0100 [thread overview]
Message-ID: <8736qrw5vn.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20181220200630.GC25497@flask>
Radim Krčmář <rkrcmar@redhat.com> writes:
> 2018-12-19 12:06+0100, Vitaly Kuznetsov:
>> AMD doesn't seem to implement MSR_IA32_MCG_EXT_CTL and svm code in kvm
>> knows nothing about it, however, this MSR is among emulated_msrs and
>> thus returned with KVM_GET_MSR_INDEX_LIST. The consequent KVM_GET_MSRS,
>> of course, fails.
>>
>> Report the MSR as unsupported to not confuse userspace.
>>
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> ---
>> arch/x86/kvm/svm.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
>> index 2acb42b74a51..dfdf7d0b7f88 100644
>> --- a/arch/x86/kvm/svm.c
>> +++ b/arch/x86/kvm/svm.c
>> @@ -5845,6 +5845,13 @@ static bool svm_cpu_has_accelerated_tpr(void)
>>
>> static bool svm_has_emulated_msr(int index)
>> {
>> + switch (index) {
>> + case MSR_IA32_MCG_EXT_CTL:
>> + return false;
>> + default:
>> + break;
>
> Queued, thanks.
>
> Btw, I would prefer this without the
>
> default: break;
>
> as I don't think we'll ever add something there.
"640K ought to be enough for anybody" :-)
But in case you commit it as
return index != MSR_IA32_MCG_EXT_CTL;
I won't object. Thanks,
--
Vitaly
next prev parent reply other threads:[~2018-12-21 10:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-19 11:06 [PATCH] KVM: x86: svm: report MSR_IA32_MCG_EXT_CTL as unsupported Vitaly Kuznetsov
2018-12-20 20:06 ` Radim Krčmář
2018-12-21 10:06 ` Vitaly Kuznetsov [this message]
2018-12-21 11:18 ` Paolo Bonzini
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=8736qrw5vn.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--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