Re: [PATCH for-4.20 v2] x86/intel: Fix PERF_GLOBAL fixup when virtualised

2025-01-21 Thread Jan Beulich
On 21.01.2025 18:07, Andrew Cooper wrote: > On 21/01/2025 5:04 pm, Jan Beulich wrote: >> On 21.01.2025 17:56, Andrew Cooper wrote: >>> --- a/xen/arch/x86/cpu/intel.c >>> +++ b/xen/arch/x86/cpu/intel.c >>> @@ -535,39 +535,49 @@ static void intel_log_freq(const struct cpuinfo_x86 >>> *c) >>> pr

Re: [PATCH for-4.20 v2] x86/intel: Fix PERF_GLOBAL fixup when virtualised

2025-01-21 Thread Andrew Cooper
On 21/01/2025 5:04 pm, Jan Beulich wrote: > On 21.01.2025 17:56, Andrew Cooper wrote: >> --- a/xen/arch/x86/cpu/intel.c >> +++ b/xen/arch/x86/cpu/intel.c >> @@ -535,39 +535,49 @@ static void intel_log_freq(const struct cpuinfo_x86 *c) >> printk("%u MHz\n", (factor * max_ratio + 50) / 100); >>

Re: [PATCH for-4.20 v2] x86/intel: Fix PERF_GLOBAL fixup when virtualised

2025-01-21 Thread Jan Beulich
On 21.01.2025 17:56, Andrew Cooper wrote: > --- a/xen/arch/x86/cpu/intel.c > +++ b/xen/arch/x86/cpu/intel.c > @@ -535,39 +535,49 @@ static void intel_log_freq(const struct cpuinfo_x86 *c) > printk("%u MHz\n", (factor * max_ratio + 50) / 100); > } > > +static void init_intel_perf(struct cpui

[PATCH for-4.20 v2] x86/intel: Fix PERF_GLOBAL fixup when virtualised

2025-01-21 Thread Andrew Cooper
Logic using performance counters needs to look at MSR_MISC_ENABLE.PERF_AVAILABLE before touching any other resources. When virtualised under ESX, Xen dies with a #GP fault trying to read MSR_CORE_PERF_GLOBAL_CTRL. Factor this logic out into a separate function (it's already too squashed to the RH