All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <oss@buserror.net>
To: laurentiu.tudor@nxp.com, linuxppc-dev@lists.ozlabs.org,
	mpe@ellerman.id.au
Cc: madalin.bucur@nxp.com, aneesh.kumar@linux.vnet.ibm.com
Subject: Re: [PATCH] powerpc: booke: fix boot crash due to null hugepd
Date: Fri, 17 Feb 2017 04:08:24 -0600	[thread overview]
Message-ID: <1487326104.5636.47.camel@buserror.net> (raw)
In-Reply-To: <20170216151129.8971-1-laurentiu.tudor@nxp.com>

On Thu, 2017-02-16 at 09:11 -0600, laurentiu.tudor@nxp.com wrote:
> From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
> 
> On 32-bit book-e machines, hugepd_ok() does not take
> into account null hugepd values, causing this crash at boot:

Why only 32-bit?

> diff --git a/arch/powerpc/include/asm/nohash/pgtable.h
> b/arch/powerpc/include/asm/nohash/pgtable.h
> index 0cd8a38..e5805ad 100644
> --- a/arch/powerpc/include/asm/nohash/pgtable.h
> +++ b/arch/powerpc/include/asm/nohash/pgtable.h
> @@ -230,7 +230,7 @@ static inline int hugepd_ok(hugepd_t hpd)
>  	return ((hpd_val(hpd) & 0x4) != 0);
>  #else
>  	/* We clear the top bit to indicate hugepd */
> -	return ((hpd_val(hpd) & PD_HUGE) ==  0);
> +	return (hpd_val(hpd) && (hpd_val(hpd) & PD_HUGE) == 0);
>  #endif
>  }
>  

Any reason why this can't go back to being "hpd_val(hpd) > 0"?  Why was nohash
changed to begin with?  I don't expect nohash (or at least fsl-book3e) will
ever have a pagetable that is not native-endian, and "> 0" is consistent with
what the TLB miss code is doing.

Also, the patch that broke this was tagged for stable (which again raises the
question of why an extraneous change was made) so this patch needs to be as
well.

-Scott

  reply	other threads:[~2017-02-17 10:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16 15:11 [PATCH] powerpc: booke: fix boot crash due to null hugepd laurentiu.tudor
2017-02-17 10:08 ` Scott Wood [this message]
2017-02-17 10:18   ` Laurentiu Tudor
2017-02-17 12:18 ` Aneesh Kumar K.V
2017-02-17 12:37   ` Laurentiu Tudor
2017-02-28 14:55   ` Laurentiu Tudor
2017-02-28 22:46     ` Scott Wood
2017-03-01 11:09       ` Michael Ellerman
2017-03-08  7:25 ` Michael Ellerman
2017-05-16 14:47 [PATCH] " laurentiu.tudor
2017-05-16 14:47 ` laurentiu.tudor at nxp.com
2017-05-17  9:15 ` Greg KH
2017-05-17  9:15   ` Greg KH
2017-05-17  9:30   ` Laurentiu Tudor
2017-05-17  9:30     ` Laurentiu Tudor

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=1487326104.5636.47.camel@buserror.net \
    --to=oss@buserror.net \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=laurentiu.tudor@nxp.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=madalin.bucur@nxp.com \
    --cc=mpe@ellerman.id.au \
    /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 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.