[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220324104217.GE8939@worktop.programming.kicks-ass.net>
Date: Thu, 24 Mar 2022 11:42:17 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Dongli Si <kvmx86@...il.com>
Cc: joro@...tes.org, liam.merwick@...cle.com, kim.phillips@....com,
mingo@...nel.org, acme@...nel.org, mark.rutland@....com,
alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
namhyung@...nel.org, tglx@...utronix.de, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] perf/x86/amd: Don't touch the Host-only bit inside
the guest hypervisor
On Sun, Mar 20, 2022 at 08:21:06AM +0800, Dongli Si wrote:
> @@ -1027,7 +1028,8 @@ void amd_pmu_enable_virt(void)
> {
> struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
>
> - cpuc->perf_ctr_virt_mask = 0;
> + if (hypervisor_is_type(X86_HYPER_NATIVE))
> + cpuc->perf_ctr_virt_mask = 0;
So I had to go and read the original commit to figure out wth this code
is supposed to be doing. I'm thinking this all can use a wee comment.
Also, the above is very ambiguous as to what it does. Specifically if we
don't set perf_ctr_virt_mask, then what is the actual value (yes, I
know, but its not very clear is it). Also, if we don't in fact change
perf_ctr_virt_mask then these following two lines:
>
> /* Reload all events */
> amd_pmu_disable_all();
amd_pmu_enable_all(0);
are somewhat completely pointless, no?
So can we please get a patch that clarifies things instead of making
things even more obscure?
Powered by blists - more mailing lists