[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb73b122-47f8-d3fa-232a-e865920a8bee@intel.com>
Date: Thu, 14 Jan 2021 09:58:51 +0800
From: "Xu, Like" <like.xu@...el.com>
To: Peter Zijlstra <peterz@...radead.org>,
Like Xu <like.xu@...ux.intel.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, eranian@...gle.com,
kvm@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Andi Kleen <andi@...stfloor.org>,
Kan Liang <kan.liang@...ux.intel.com>, wei.w.wang@...el.com,
luwei.kang@...el.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 03/17] KVM: x86/pmu: Introduce the ctrl_mask value for
fixed counter
On 2021/1/14 2:06, Peter Zijlstra wrote:
> On Mon, Jan 04, 2021 at 09:15:28PM +0800, Like Xu wrote:
>> @@ -327,6 +328,7 @@ static void intel_pmu_refresh(struct kvm_vcpu *vcpu)
>> pmu->counter_bitmask[KVM_PMC_FIXED] = 0;
>> pmu->version = 0;
>> pmu->reserved_bits = 0xffffffff00200000ull;
>> + pmu->fixed_ctr_ctrl_mask = ~0ull;
> All 1s
>
>>
>> entry = kvm_find_cpuid_entry(vcpu, 0xa, 0);
>> if (!entry)
>> @@ -358,6 +360,9 @@ static void intel_pmu_refresh(struct kvm_vcpu *vcpu)
>> ((u64)1 << edx.split.bit_width_fixed) - 1;
>> }
>>
>> + for (i = 0; i < pmu->nr_arch_fixed_counters; i++)
>> + pmu->fixed_ctr_ctrl_mask |= (0xbull << (i * 4));
> With some extra 1s on top
You're right, I think it should be:
pmu->fixed_ctr_ctrl_mask &= ~(0xbull << (i * 4));
w/o invertion and I will fix it in the next version.
>
>> + pmu->fixed_ctr_ctrl_mask = ~pmu->fixed_ctr_ctrl_mask;
> Inverted is all 0s, always.
>
>> pmu->global_ctrl = ((1ull << pmu->nr_arch_gp_counters) - 1) |
>> (((1ull << pmu->nr_arch_fixed_counters) - 1) << INTEL_PMC_IDX_FIXED);
>> pmu->global_ctrl_mask = ~pmu->global_ctrl;
>> --
>> 2.29.2
>>
Powered by blists - more mailing lists