Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1654922 > unrolled thread

[v4.12-rc3] Early boot panic on Broadwell

Started byChris Wilson <chris@chris-wilson.co.uk>
First post2017-06-01 10:30 +0200
Last post2017-06-02 07:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [v4.12-rc3] Early boot panic on Broadwell Chris Wilson <chris@chris-wilson.co.uk> - 2017-06-01 10:30 +0200
    Re: [v4.12-rc3] Early boot panic on Broadwell Linus Torvalds <torvalds@linux-foundation.org> - 2017-06-01 19:20 +0200
      Re: [v4.12-rc3] Early boot panic on Broadwell Ingo Molnar <mingo@kernel.org> - 2017-06-02 07:30 +0200

#1654922 — [v4.12-rc3] Early boot panic on Broadwell

FromChris Wilson <chris@chris-wilson.co.uk>
Date2017-06-01 10:30 +0200
Subject[v4.12-rc3] Early boot panic on Broadwell
Message-ID<tNtEu-9b-19@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1655614

FromLinus Torvalds <torvalds@linux-foundation.org>
Date2017-06-01 19:20 +0200
Message-ID<tNBVo-5uA-35@gated-at.bofh.it>
In reply to#1654922
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

[toc] | [prev] | [next] | [standalone]


#1655899

FromIngo Molnar <mingo@kernel.org>
Date2017-06-02 07:30 +0200
Message-ID<tNNjQ-4Mf-11@gated-at.bofh.it>
In reply to#1655614
* 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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web