linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Jim Mattson <jmattson@google.com>
Cc: kvm list <kvm@vger.kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <sean.j.christopherson@intel.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Like Xu <like.xu@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] KVM: SVM: drop MSR_IA32_PERF_CAPABILITIES from emulated MSRs
Date: Tue, 16 Jun 2020 18:45:34 +0200	[thread overview]
Message-ID: <87366vhscx.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <CALMp9eSWXGQkOOzSrALfZDMj5JHSH=CsK1wKfdj2x2jtV4XJsw@mail.gmail.com>

Jim Mattson <jmattson@google.com> writes:

> On Tue, Jun 16, 2020 at 9:14 AM Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
>>
>> state_test/smm_test selftests are failing on AMD with:
>> "Unexpected result from KVM_GET_MSRS, r: 51 (failed MSR was 0x345)"
>>
>> MSR_IA32_PERF_CAPABILITIES is an emulated MSR indeed but only on Intel,
>> make svm_has_emulated_msr() skip it so it is not returned by
>> KVM_GET_MSR_INDEX_LIST.
>
> Do we need to support this MSR under SVM for cross-vendor migration?
> Or, have we given up on that?

To be honest I'm not sure about the status of cross-vendor migration in
general and PMU implications in particular, hope Paolo/Sean can shed
some light. In this particular case my shallow understanding is that
MSR_IA32_PERF_CAPABILITIES has only one known feature bit which unlocks
an MSR range with additional counters. If the feature bit is not set
this, I guess, can easily be migrated (basically, let's allow writing
'0' there on AMD and return '0' on read). But what if the feature was
enabled? We'll have to support the new MSR range and do something with
it after migration (run intel_pmu in fully emulated mode?).

Anyway, the immediate issue I'm trying to fix here is: whatever is
returned by KVM_GET_MSR_INDEX_LIST can be successfully queried with
KVM_GET_MSRS as some userspaces count on that.

-- 
Vitaly


  reply	other threads:[~2020-06-16 16:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 16:14 [PATCH] KVM: SVM: drop MSR_IA32_PERF_CAPABILITIES from emulated MSRs Vitaly Kuznetsov
2020-06-16 16:24 ` Jim Mattson
2020-06-16 16:45   ` Vitaly Kuznetsov [this message]
2020-06-16 16:52     ` Jim Mattson
2020-06-17 11:38       ` Vitaly Kuznetsov
2020-06-17 16:47         ` Jim Mattson
2020-06-17 17:17         ` Paolo Bonzini
2020-06-18 11:08           ` Vitaly Kuznetsov

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=87366vhscx.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=like.xu@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=wanpengli@tencent.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;
as well as URLs for NNTP newsgroup(s).