All of lore.kernel.org
 help / color / mirror / Atom feed
* [v4.12-rc3] Early boot panic on Broadwell
@ 2017-06-01  8:27 Chris Wilson
  2017-06-01 17:12 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2017-06-01  8:27 UTC (permalink / raw)
  To: Linus Torvalds, Mikulas Patocka, Ingo Molnar
  Cc: Peter Zijlstra, H. Peter Anvin, linux-kernel

Hi guys,

I hit an early boot panic on a Broadwell laptop (xps13-9343) that I
bisected to:

commit cbed27cdf0e3f7ea3b2259e86b9e34df02be3fe4
Author: Mikulas Patocka <mpatocka@redhat.com>
Date:   Tue Apr 18 15:07:11 2017 -0400

    x86/PAT: Fix Xorg regression on CPUs that don't support PAT
    
    In the file arch/x86/mm/pat.c, there's a '__pat_enabled' variable. The
    variable is set to 1 by default and the function pat_init() sets
    __pat_enabled to 0 if the CPU doesn't support PAT.
    
    However, on AMD K6-3 CPUs, the processor initialization code never calls
    pat_init() and so __pat_enabled stays 1 and the function pat_enabled()
    returns true, even though the K6-3 CPU doesn't support PAT.
    
    The result of this bug is that a kernel warning is produced when attempting to
    start the Xserver and the Xserver doesn't start (fork() returns ENOMEM).
    Another symptom of this bug is that the framebuffer driver doesn't set the
    K6-3 MTRR registers:
    
      x86/PAT: Xorg:3891 map pfn expected mapping type uncached-minus for [mem 0xe4000000-0xe5ffffff], got write-combining
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 3891 at arch/x86/mm/pat.c:1020 untrack_pfn+0x5c/0x9f
      ...
      x86/PAT: Xorg:3891 map pfn expected mapping type uncached-minus for [mem 0xe4000000-0xe5ffffff], got write-combining
    
    To fix the bug change pat_enabled() so that it returns true only if PAT
    initialization was actually done.
    
    Also, I changed boot_cpu_has(X86_FEATURE_PAT) to
    this_cpu_has(X86_FEATURE_PAT) in pat_ap_init(), so that we check the PAT
    feature on the processor that is being initialized.

In my testing, I found that reverting the /boot_cpu_has/this_cpu_has/
change was enough to restore working behaviour:

diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index 83a59a6..c537bfb 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -234,7 +234,7 @@ static void pat_bsp_init(u64 pat)
 
 static void pat_ap_init(u64 pat)
 {
-       if (!this_cpu_has(X86_FEATURE_PAT)) {
+       if (!boot_cpu_has(X86_FEATURE_PAT)) {
                /*
                 * If this happens we are on a secondary CPU, but switched to
                 * PAT on the boot CPU. We have no way to undo PAT.

Seems scary enough that different cpus may have different features, but
that may just be a symptom of the boot phase?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [v4.12-rc3] Early boot panic on Broadwell
  2017-06-01  8:27 [v4.12-rc3] Early boot panic on Broadwell Chris Wilson
@ 2017-06-01 17:12 ` Linus Torvalds
  2017-06-02  5:28   ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2017-06-01 17:12 UTC (permalink / raw)
  To: Chris Wilson
  Cc: Mikulas Patocka, Ingo Molnar, Peter Zijlstra, H. Peter Anvin,
	Linux Kernel Mailing List

On Thu, Jun 1, 2017 at 1:27 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> I hit an early boot panic on a Broadwell laptop (xps13-9343) that I
> bisected to:
>
> commit cbed27cdf0e3f7ea3b2259e86b9e34df02be3fe4

This is already reverted in -tip afaik, I just haven't gotten the pull
request yet.

               Linus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [v4.12-rc3] Early boot panic on Broadwell
  2017-06-01 17:12 ` Linus Torvalds
@ 2017-06-02  5:28   ` Ingo Molnar
  0 siblings, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2017-06-02  5:28 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Chris Wilson, Mikulas Patocka, Peter Zijlstra, H. Peter Anvin,
	Linux Kernel Mailing List


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Thu, Jun 1, 2017 at 1:27 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> >
> > I hit an early boot panic on a Broadwell laptop (xps13-9343) that I
> > bisected to:
> >
> > commit cbed27cdf0e3f7ea3b2259e86b9e34df02be3fe4
> 
> This is already reverted in -tip afaik, I just haven't gotten the pull
> request yet.

I'll send it later today.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-02  5:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-01  8:27 [v4.12-rc3] Early boot panic on Broadwell Chris Wilson
2017-06-01 17:12 ` Linus Torvalds
2017-06-02  5:28   ` Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.