[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bb40cfa3-0125-c733-e4fd-da861c068f2c@redhat.com>
Date: Wed, 1 Jun 2022 13:24:37 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org, x86@...nel.org,
Like Xu <likexu@...cent.com>
Subject: Re: [PATCH] x86: events: Do not return bogus capabilities if PMU is
broken
On 6/1/22 13:07, Peter Zijlstra wrote:
> On Wed, Jun 01, 2022 at 05:42:56AM -0400, Paolo Bonzini wrote:
>> From: Like Xu <likexu@...cent.com>
>>
>> If the PMU is broken due to firmware issues, check_hw_exists() will return
>> false but perf_get_x86_pmu_capability() will still return data from x86_pmu.
>> Likewise if some of the hotplug callbacks cannot be installed the contents
>> of x86_pmu will not be reverted.
>>
>> Handle the failure in both cases by clearing x86_pmu if init_hw_perf_events()
>> or reverts to software events only.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
>
> No SoB from Like,
And hardly any code from him either except for a single memset, :) but
I'll add
Signed-off-by: Like Xu <likexu@...cent.com>
Co-developed-by: Like Xu <likexu@...cent.com>
(I have hooks that notice this when pushing, but they don't help with
git-send-email...).
>> @@ -2982,6 +2985,11 @@ unsigned long perf_misc_flags(struct pt_regs *regs)
>>
>> void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap)
>> {
>> + if (!x86_pmu.name) {
>
> We have x86_pmu_initialized(), the implementation is a bit daft, but
> might as well use it here too, no?
Yes, thanks.
Paolo
Powered by blists - more mailing lists