public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Chuck Zmudzinski <brchuckz@netscape.net>
To: Juergen Gross <jgross@suse.com>,
	xen-devel@lists.xenproject.org, x86@kernel.org,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	Thorsten Leemhuis <regressions@leemhuis.info>
Cc: jbeulich@suse.com, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"# 5 . 17" <stable@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Pavel Machek <pavel@ucw.cz>, Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH 0/3] x86: make pat and mtrr independent from each other
Date: Sat, 16 Jul 2022 08:01:22 -0400	[thread overview]
Message-ID: <a5fd5d8f-c360-ce4c-57fb-504f8998190c@netscape.net> (raw)
In-Reply-To: <7bf307c7-0b05-781b-a2a3-19b47589eb8a@netscape.net>

On 7/16/2022 7:32 AM, Chuck Zmudzinski wrote:
> 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:

I'm sorry, the date of that report was May 4, 2022, not
May 5, 2022 - just to avoid any doubt about which regression
I am referring to.

Chuck

>
> https://lore.kernel.org/regressions/YnHK1Z3o99eMXsVK@mail-itl/
>
> I am experiencing that regression 

or a very similar regression that is caused by the same commit:

bdd8b6c98239cad
("drm/i915: replace X86_FEATURE_PAT with pat_enabled()")

> and could test this patch
> on my system.
>
> Can you confirm that with this patch series you are trying
> to fix that regression?
>
> Chuck

Chuck

  parent reply	other threads:[~2022-07-16 12:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 14:25 [PATCH 0/3] x86: make pat and mtrr independent from each other Juergen Gross
2022-07-15 14:25 ` [PATCH 1/3] x86: move some code out of arch/x86/kernel/cpu/mtrr Juergen Gross
2022-07-18 12:20   ` Borislav Petkov
2022-07-15 14:25 ` [PATCH 2/3] x86: add wrapper functions for mtrr functions handling also pat Juergen Gross
2022-07-15 16:41   ` Rafael J. Wysocki
2022-07-15 14:25 ` [PATCH 3/3] x86: decouple pat and mtrr handling Juergen Gross
2022-07-19 15:15   ` Borislav Petkov
2022-08-17  9:17     ` Juergen Gross
2022-07-16 11:32 ` [PATCH 0/3] x86: make pat and mtrr independent from each other Chuck Zmudzinski
2022-07-16 11:42   ` Borislav Petkov
2022-07-17  4:06     ` Chuck Zmudzinski
2022-07-16 12:01   ` Chuck Zmudzinski [this message]
2022-07-17  7:55 ` Thorsten Leemhuis
2022-07-18 11:32   ` Chuck Zmudzinski
2022-07-19 13:16     ` Chuck Zmudzinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5fd5d8f-c360-ce4c-57fb-504f8998190c@netscape.net \
    --to=brchuckz@netscape.net \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=regressions@leemhuis.info \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox