[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7bf307c7-0b05-781b-a2a3-19b47589eb8a@netscape.net>
Date: Sat, 16 Jul 2022 07:32:46 -0400
From: Chuck Zmudzinski <brchuckz@...scape.net>
To: Juergen Gross <jgross@...e.com>, xen-devel@...ts.xenproject.org,
x86@...nel.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org,
Thorsten Leemhuis <regressions@...mhuis.info>
Cc: jbeulich@...e.com, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
"# 5 . 17" <stable@...r.kernel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Pavel Machek <pavel@....cz>, Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>
Subject: Re: [PATCH 0/3] x86: make pat and mtrr independent from each other
On 7/15/2022 10:25 AM, Juergen Gross wrote:
> Today PAT can't be used without MTRR being available, unless MTRR is at
> least configured via CONFIG_MTRR and the system is running as Xen PV
> guest. In this case PAT is automatically available via the hypervisor,
> but the PAT MSR can't be modified by the kernel and MTRR is disabled.
>
> As an additional complexity the availability of PAT can't be queried
> via pat_enabled() in the Xen PV case, as the lack of MTRR will set PAT
> to be disabled. This leads to some drivers believing that not all cache
> modes are available, resulting in failures or degraded functionality.
>
> The same applies to a kernel built with no MTRR support: it won't
> allow to use the PAT MSR, even if there is no technical reason for
> that, other than setting up PAT on all cpus the same way (which is a
> requirement of the processor's cache management) is relying on some
> MTRR specific code.
>
> Fix all of that by:
>
> - moving the function needed by PAT from MTRR specific code one level
> up
> - adding a PAT indirection layer supporting the 3 cases "no or disabled
> PAT", "PAT under kernel control", and "PAT under Xen control"
> - removing the dependency of PAT on MTRR
>
> Juergen Gross (3):
> x86: move some code out of arch/x86/kernel/cpu/mtrr
> x86: add wrapper functions for mtrr functions handling also pat
> x86: decouple pat and mtrr handling
>
> arch/x86/include/asm/memtype.h | 13 ++-
> arch/x86/include/asm/mtrr.h | 27 ++++--
> arch/x86/include/asm/processor.h | 10 +++
> arch/x86/kernel/cpu/common.c | 123 +++++++++++++++++++++++++++-
> arch/x86/kernel/cpu/mtrr/generic.c | 90 ++------------------
> arch/x86/kernel/cpu/mtrr/mtrr.c | 58 ++++---------
> arch/x86/kernel/cpu/mtrr/mtrr.h | 1 -
> arch/x86/kernel/setup.c | 12 +--
> arch/x86/kernel/smpboot.c | 8 +-
> arch/x86/mm/pat/memtype.c | 127 +++++++++++++++++++++--------
> arch/x86/power/cpu.c | 2 +-
> arch/x86/xen/enlighten_pv.c | 4 +
> 12 files changed, 289 insertions(+), 186 deletions(-)
>
This patch series seems related to the regression reported
here on May 5, 2022:
https://lore.kernel.org/regressions/YnHK1Z3o99eMXsVK@mail-itl/
I am experiencing that regression and could test this patch
on my system.
Can you confirm that with this patch series you are trying
to fix that regression?
Chuck
Powered by blists - more mailing lists