stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4.14 stable] powerpc: Fix DABR match on hash based
@ 2018-02-16  9:54 Naveen N. Rao
  2018-02-16 10:21 ` Naveen N. Rao
  0 siblings, 1 reply; 3+ messages in thread
From: Naveen N. Rao @ 2018-02-16  9:54 UTC (permalink / raw)
  To: Greg KH; +Cc: Benjamin Herrenschmidt, Michael Ellerman, stable

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Commit 398a719d34a1 ("powerpc/mm: Update bits used to skip hash_page")
mistakenly dropped the DSISR_DABRMATCH bit from the mask of bit tested
to skip trying to hash a page.

As a result, the DABR matches would no longer be detected.

This adds it back. We open code it in the 2 places where it matters
rather than fold it into DSISR_BAD_FAULT_32S/64S because this isn't
technically a bad fault and while we would never hit it with the
current code, I prefer if page_fault_is_bad() didn't trigger on these.

Fixes: 398a719d34a1 ("powerpc/mm: Update bits used to skip hash_page")
Cc: stable@vger.kernel.org # v4.14
Tested-by: Pedro Miraglia Franco de Carvalho <pedromfc@br.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Hi Greg,
This is a backport of commit f23ab3efb1b30 ("powerpc: Fix DABR match on
hash based systems") to v4.14. This wasn't applying on v4.14 due to
commit 4e003747043d5 ("powerpc/64s: Replace CONFIG_PPC_STD_MMU_64 with
CONFIG_PPC_BOOK3S_64"), which renamed CONFIG_PPC_STD_MMU_64. Kindly
apply this for v4.14-stable.

- Naveen

 arch/powerpc/kernel/exceptions-64s.S | 2 +-
 arch/powerpc/kernel/head_32.S        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index e9f72abc52b7..e91b40aa5417 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1617,7 +1617,7 @@ USE_TEXT_SECTION()
 	.balign	IFETCH_ALIGN_BYTES
 do_hash_page:
 	#ifdef CONFIG_PPC_STD_MMU_64
-	lis	r0,DSISR_BAD_FAULT_64S@h
+	lis	r0,(DSISR_BAD_FAULT_64S|DSISR_DABRMATCH)@h
 	ori	r0,r0,DSISR_BAD_FAULT_64S@l
 	and.	r0,r4,r0		/* weird error? */
 	bne-	handle_page_fault	/* if not, try to insert a HPTE */
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 8c54166491e7..29b2fed93289 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -388,7 +388,7 @@ DataAccess:
 	EXCEPTION_PROLOG
 	mfspr	r10,SPRN_DSISR
 	stw	r10,_DSISR(r11)
-	andis.	r0,r10,DSISR_BAD_FAULT_32S@h
+	andis.	r0,r10,(DSISR_BAD_FAULT_32S|DSISR_DABRMATCH)@h
 	bne	1f			/* if not, try to put a PTE */
 	mfspr	r4,SPRN_DAR		/* into the hash table */
 	rlwinm	r3,r10,32-15,21,21	/* DSISR_STORE -> _PAGE_RW */
-- 
2.16.1

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

* Re: [PATCH v4.14 stable] powerpc: Fix DABR match on hash based
  2018-02-16  9:54 [PATCH v4.14 stable] powerpc: Fix DABR match on hash based Naveen N. Rao
@ 2018-02-16 10:21 ` Naveen N. Rao
  2018-02-19 16:26   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Naveen N. Rao @ 2018-02-16 10:21 UTC (permalink / raw)
  To: Greg KH; +Cc: Benjamin Herrenschmidt, Michael Ellerman, stable

Naveen N. Rao wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> Commit 398a719d34a1 ("powerpc/mm: Update bits used to skip hash_page")
> mistakenly dropped the DSISR_DABRMATCH bit from the mask of bit tested
> to skip trying to hash a page.
> 
> As a result, the DABR matches would no longer be detected.
> 
> This adds it back. We open code it in the 2 places where it matters
> rather than fold it into DSISR_BAD_FAULT_32S/64S because this isn't
> technically a bad fault and while we would never hit it with the
> current code, I prefer if page_fault_is_bad() didn't trigger on these.
> 
> Fixes: 398a719d34a1 ("powerpc/mm: Update bits used to skip hash_page")
> Cc: stable@vger.kernel.org # v4.14
> Tested-by: Pedro Miraglia Franco de Carvalho <pedromfc@br.ibm.com>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Not quite sure if this is required, but:
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Thanks,
Naveen

> ---
> Hi Greg,
> This is a backport of commit f23ab3efb1b30 ("powerpc: Fix DABR match on
> hash based systems") to v4.14. This wasn't applying on v4.14 due to
> commit 4e003747043d5 ("powerpc/64s: Replace CONFIG_PPC_STD_MMU_64 with
> CONFIG_PPC_BOOK3S_64"), which renamed CONFIG_PPC_STD_MMU_64. Kindly
> apply this for v4.14-stable.
> 
> - Naveen
> 
>  arch/powerpc/kernel/exceptions-64s.S | 2 +-
>  arch/powerpc/kernel/head_32.S        | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> index e9f72abc52b7..e91b40aa5417 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -1617,7 +1617,7 @@ USE_TEXT_SECTION()
>  	.balign	IFETCH_ALIGN_BYTES
>  do_hash_page:
>  	#ifdef CONFIG_PPC_STD_MMU_64
> -	lis	r0,DSISR_BAD_FAULT_64S@h
> +	lis	r0,(DSISR_BAD_FAULT_64S|DSISR_DABRMATCH)@h
>  	ori	r0,r0,DSISR_BAD_FAULT_64S@l
>  	and.	r0,r4,r0		/* weird error? */
>  	bne-	handle_page_fault	/* if not, try to insert a HPTE */
> diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
> index 8c54166491e7..29b2fed93289 100644
> --- a/arch/powerpc/kernel/head_32.S
> +++ b/arch/powerpc/kernel/head_32.S
> @@ -388,7 +388,7 @@ DataAccess:
>  	EXCEPTION_PROLOG
>  	mfspr	r10,SPRN_DSISR
>  	stw	r10,_DSISR(r11)
> -	andis.	r0,r10,DSISR_BAD_FAULT_32S@h
> +	andis.	r0,r10,(DSISR_BAD_FAULT_32S|DSISR_DABRMATCH)@h
>  	bne	1f			/* if not, try to put a PTE */
>  	mfspr	r4,SPRN_DAR		/* into the hash table */
>  	rlwinm	r3,r10,32-15,21,21	/* DSISR_STORE -> _PAGE_RW */
> -- 
> 2.16.1
> 
> 

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

* Re: [PATCH v4.14 stable] powerpc: Fix DABR match on hash based
  2018-02-16 10:21 ` Naveen N. Rao
@ 2018-02-19 16:26   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2018-02-19 16:26 UTC (permalink / raw)
  To: Naveen N. Rao; +Cc: Benjamin Herrenschmidt, Michael Ellerman, stable

On Fri, Feb 16, 2018 at 03:51:40PM +0530, Naveen N. Rao wrote:
> Naveen N. Rao wrote:
> > From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > 
> > Commit 398a719d34a1 ("powerpc/mm: Update bits used to skip hash_page")
> > mistakenly dropped the DSISR_DABRMATCH bit from the mask of bit tested
> > to skip trying to hash a page.
> > 
> > As a result, the DABR matches would no longer be detected.
> > 
> > This adds it back. We open code it in the 2 places where it matters
> > rather than fold it into DSISR_BAD_FAULT_32S/64S because this isn't
> > technically a bad fault and while we would never hit it with the
> > current code, I prefer if page_fault_is_bad() didn't trigger on these.
> > 
> > Fixes: 398a719d34a1 ("powerpc/mm: Update bits used to skip hash_page")
> > Cc: stable@vger.kernel.org # v4.14
> > Tested-by: Pedro Miraglia Franco de Carvalho <pedromfc@br.ibm.com>
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> Not quite sure if this is required, but:
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Thanks, now queued up.

greg k-h

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

end of thread, other threads:[~2018-02-19 16:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-16  9:54 [PATCH v4.14 stable] powerpc: Fix DABR match on hash based Naveen N. Rao
2018-02-16 10:21 ` Naveen N. Rao
2018-02-19 16:26   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).