public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Doug Smythies" <dsmythies@telus.net>
To: "'Bernhard Held'" <berny156@gmx.de>,
	"'Mikulas Patocka'" <mpatocka@redhat.com>,
	"'Andy Lutomirski'" <luto@kernel.org>,
	"'Ingo Molnar'" <mingo@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, "Doug Smythies" <dsmythies@telus.net>
Subject: Re: [tip:x86/urgent] x86/PAT: Fix Xorg regression on CPUs that don't support PAT
Date: Tue, 30 May 2017 17:53:22 -0700	[thread overview]
Message-ID: <003501d2d9a8$4ee48d20$ecada760$@net> (raw)

Note Before:
I might not have the address list correct, as I have re-created this
e-mail from the web page archive, having found the thread after bisecting the
kernel.

On 2017.05.29 18:50:57 -0400 (EDT) Mikulas Patocka wrote:
> On Sun, 28 May 2017, Andy Lutomirski wrote:
>> On Sun, May 28, 2017 at 11:18 AM, Bernhard Held <berny156@gmx.de> wrote:
>>> Hi,
>>>
>>> this patch breaks the boot of my kernel. The last message is "Booting
>>> the kernel.".

It breaks my kernel boot also, and I know of at least two others with
the same, or similar, problem as of kernel 4.12-rc3.

>>> My setup might be unusual: I'm running a Xenon E5450 (LGA 771) in a
>>> Gigbayte G33-DS3R board (LGA 775). The BIOS is patched with the
>>> microcode of the E5450 and recognizes the CPU.

I do not think my test server setup is unusual.
I use Ubuntu 16.04.2 server edition as my distro, and
steal Ubuntu kernel configurations for compiling.
My processor is an older model i7
(Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz)

> Hi
>
> Please do the following three tests and test if the kernel boots.
>
> 1. use the PAT patch and revert the change to the function pat_enabled()
> - i.e. change it to the original:
> bool pat_enabled(void)
> {
>	return !!__pat_enabled;
> }

Test 1 result: fail

>
> 2. use the PAT patch and revert the change to the function pat_ap_init
> - i.e. change it to the original:
> static void pat_ap_init(u64 pat)
> {
>	if (!boot_cpu_has(X86_FEATURE_PAT)) {

Test 2 result: pass

> 3. use the full PAT patch and apply the below patch on the top of it.
>

Test 3 result: fail

>> I think this patch is bogus.  pat_enabled() sure looks like it's
>> supposed to return true if PAT is *enabled*, and these days PAT is
>> "enabled" even if there's no HW PAT support.  Even if the patch were
>> somehow correct, it should have been split up into two patches, one to
>> change pat_enabled() and one to use this_cpu_has().
>> 
>> Ingo, I'd suggest reverting the patch, cc-ing stable on the revert so
>> -stable knows not to backport it, and starting over with the fix.
>> From very brief inspection, the right fix is to make sure that
>> pat_init(), or at least init_cache_modes(), gets called on the
>>
> pat_init() needs to be called with cache disabled - and the cache disable 
> code (functions prepare_set() and post_set()) exists in 
> arch/x86/kernel/cpu/mtrr/generic.c - it may not be compiled if CONFIG_MTRR 
> is not set.
>
> Though, it is possible to call init_cache_modes() - see the patch below. 
> init_cache_modes() does nothing if it is called multiple times.
>
>> affected CPUs.
>> 
>> As a future cleanup, I think that pat_enabled() could be deleted
>> outright and, if needed, replaced by functions like have_memtype_wc()
>> or similar.  (Do we already have helpers like that?)  Toshi, am I
>> right?
>> 
>> --Andy

             reply	other threads:[~2017-05-31  0:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31  0:53 Doug Smythies [this message]
2017-06-01  7:49 ` [tip:x86/urgent] x86/PAT: Fix Xorg regression on CPUs that don't support PAT Ian W MORRISON
2017-06-01 14:48   ` Ian W MORRISON
  -- strict thread matches above, loose matches on Subject: below --
2017-06-02  6:32 Ian W MORRISON
2017-04-18 19:07 [PATCH] X86: don't report PAT on CPUs that don't support it Mikulas Patocka
2017-05-24 10:21 ` [tip:x86/urgent] x86/PAT: Fix Xorg regression on CPUs that don't support PAT tip-bot for Mikulas Patocka
2017-05-28 18:18   ` Bernhard Held
2017-05-28 18:43     ` Andy Lutomirski
2017-05-29 22:50       ` Mikulas Patocka
2017-05-30 17:14         ` Dominik Brodowski
2017-05-30 17:59           ` Mikulas Patocka
2017-05-30 18:47             ` Dominik Brodowski
2017-05-30 19:30             ` Bernhard Held
2017-05-31  9:39             ` Junichi Nomura

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='003501d2d9a8$4ee48d20$ecada760$@net' \
    --to=dsmythies@telus.net \
    --cc=berny156@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpatocka@redhat.com \
    /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