lkml.org 
[lkml]   [2020]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] KVM: VMX: Always treat MSR_IA32_PERF_CAPABILITIES as a valid PMU MSR
From
Date
On 04/06/20 17:16, Sean Christopherson wrote:
> On Thu, Jun 04, 2020 at 09:37:59AM +0800, Xu, Like wrote:
>> On 2020/6/4 4:33, Sean Christopherson wrote:
>>> Unconditionally return true when querying the validity of
>>> MSR_IA32_PERF_CAPABILITIES so as to defer the validity check to
>>> intel_pmu_{get,set}_msr(), which can properly give the MSR a pass when
>>> the access is initiated from host userspace.
>> Regardless of  the MSR is emulated or not, is it a really good assumption that
>> the guest cpuids are not properly ready when we do initialization from host
>> userspace
>> ?
>
> I don't know if I would call it a "good assumption" so much as a "necessary
> assumption". KVM_{GET,SET}_MSRS are allowed, and must function correctly,
> if they're called prior to KVM_SET_CPUID{2}.

Generally speaking this is not the case for the PMU; get_gp_pmc for
example depends on pmu->nr_arch_gp_counters which is initialized based
on CPUID leaf 0xA.

The assumption that this patch fixes is that you can blindly take the
output of KVM_GET_MSR_INDEX_LIST and pass it to KVM_{GET,SET}_MSRS.

Paolo

\
 
 \ /
  Last update: 2020-06-04 18:21    [W:1.051 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site