From: Paolo Bonzini <pbonzini@redhat.com>
To: Like Xu <like.xu.linux@gmail.com>,
Sean Christopherson <seanjc@google.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 1/2] KVM: vmx, pmu: accept 0 for absent MSRs when host-initiated
Date: Wed, 1 Jun 2022 10:50:57 +0200 [thread overview]
Message-ID: <42261964-df72-879b-0166-8bbb8b0fc3df@redhat.com> (raw)
In-Reply-To: <ce2b4fed-3d9e-a179-a907-5b8e09511b7d@gmail.com>
On 6/1/22 04:46, Like Xu wrote:
> On 1/6/2022 2:37 am, Sean Christopherson wrote:
>> On Tue, May 31, 2022, Paolo Bonzini wrote:
>>> Whenever an MSR is part of KVM_GET_MSR_INDEX_LIST, as is the case for
>>> MSR_IA32_DS_AREA, MSR_ARCH_LBR_DEPTH or MSR_ARCH_LBR_CTL, it has to be
>>> always settable with KVM_SET_MSR. Accept a zero value for these MSRs
>>> to obey the contract.
>
> Do we have a rule to decide whether to put MSRs into
> KVM_GET_MSR_INDEX_LIST,
> for example a large number of LBR MSRs do not appear in it ?
In general I think it's much better to include them. The only reason
not to include them should be if the number of MSRs is variable and the
actual number is accessible via KVM_GET_SUPPORTED_CPUID, a feature MSR,
or KVM_CHECK_EXTENSION.
>> This is wrong, it will allow an unchecked wrmsrl() to
>> MSR_ARCH_LBR_DEPTH if
>> X86_FEATURE_ARCH_LBR is not supported by hardware but userspace forces
>> it in
>> guest CPUID.
>
> What should we expect if the userspace forces guest to use features not
> supported by KVM,
> especially the emulation of this feature depends on the functionality of
> host and guest vcpu model ?
Certainly not a WARN or invalid vmwrite.
Paolo
next prev parent reply other threads:[~2022-06-01 8:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-31 17:54 [PATCH 0/2] KVM: vmx, pmu: respect KVM_GET_MSR_INDEX_LIST/KVM_SET_MSR contracts Paolo Bonzini
2022-05-31 17:54 ` [PATCH 1/2] KVM: vmx, pmu: accept 0 for absent MSRs when host-initiated Paolo Bonzini
2022-05-31 18:37 ` Sean Christopherson
2022-06-01 2:46 ` Like Xu
2022-06-01 8:50 ` Paolo Bonzini [this message]
2022-06-01 16:39 ` Sean Christopherson
2022-06-02 2:12 ` Like Xu
2022-06-15 18:52 ` Sean Christopherson
2022-06-16 10:37 ` Paolo Bonzini
2022-06-16 15:30 ` Sean Christopherson
2022-06-01 8:54 ` Paolo Bonzini
2022-06-01 9:12 ` Yang, Weijiang
2022-06-01 10:15 ` Paolo Bonzini
2022-06-01 10:42 ` Yang, Weijiang
2022-05-31 17:54 ` [PATCH 2/2] KVM: x86: always allow host-initiated writes to PMU MSRs Paolo Bonzini
2022-06-01 1:12 ` Like Xu
2022-06-08 22:22 ` Sean Christopherson
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=42261964-df72-879b-0166-8bbb8b0fc3df@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=like.xu.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=seanjc@google.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
Powered by JetHome