[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ce352882-0e37-c853-91e5-b87cbeacac46@intel.com>
Date: Thu, 8 Jul 2021 16:52:41 +0800
From: "Zhu, Lingshan" <lingshan.zhu@...el.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: pbonzini@...hat.com, bp@...en8.de, seanjc@...gle.com,
vkuznets@...hat.com, wanpengli@...cent.com, jmattson@...gle.com,
joro@...tes.org, weijiang.yang@...el.com,
kan.liang@...ux.intel.com, ak@...ux.intel.com,
wei.w.wang@...el.com, eranian@...gle.com, liuxiangdong5@...wei.com,
linux-kernel@...r.kernel.org, x86@...nel.org, kvm@...r.kernel.org,
like.xu.linux@...il.com, Like Xu <like.xu@...ux.intel.com>
Subject: Re: [PATCH V7 11/18] KVM: x86/pmu: Add IA32_DS_AREA MSR emulation to
support guest DS
On 7/2/2021 7:52 PM, Peter Zijlstra wrote:
> On Tue, Jun 22, 2021 at 05:42:59PM +0800, Zhu Lingshan wrote:
>> diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
>> index 190d8d98abf0..b336bcaad626 100644
>> --- a/arch/x86/events/intel/core.c
>> +++ b/arch/x86/events/intel/core.c
>> @@ -21,6 +21,7 @@
>> #include <asm/intel_pt.h>
>> #include <asm/apic.h>
>> #include <asm/cpu_device_id.h>
>> +#include <asm/kvm_host.h>
>>
>> #include "../perf_event.h"
>>
>> @@ -3915,6 +3916,7 @@ static struct perf_guest_switch_msr *intel_guest_get_msrs(int *nr, void *data)
>> {
>> struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
>> struct perf_guest_switch_msr *arr = cpuc->guest_switch_msrs;
>> + struct kvm_pmu *pmu = (struct kvm_pmu *)data;
>> u64 intel_ctrl = hybrid(cpuc->pmu, intel_ctrl);
>> u64 pebs_mask = cpuc->pebs_enabled & x86_pmu.pebs_capable;
>>
>> @@ -3945,9 +3947,15 @@ static struct perf_guest_switch_msr *intel_guest_get_msrs(int *nr, void *data)
>> return arr;
>> }
>>
>> - if (!x86_pmu.pebs_vmx)
>> + if (!pmu || !x86_pmu.pebs_vmx)
>> return arr;
>>
>> + arr[(*nr)++] = (struct perf_guest_switch_msr){
>> + .msr = MSR_IA32_DS_AREA,
>> + .host = (unsigned long)cpuc->ds,
>> + .guest = pmu->ds_area,
>> + };
>> +
>> arr[*nr] = (struct perf_guest_switch_msr){
>> .msr = MSR_IA32_PEBS_ENABLE,
>> .host = cpuc->pebs_enabled & ~cpuc->intel_ctrl_guest_mask,
> s/pmu/kvm_pmu/ or something. pmu is normally a struct pmu *, and having
> it be kvm_pmu here is super confusing.
will fix this in V8, Thanks!
Powered by blists - more mailing lists