linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org,
	"Shriya R . Kulkarni" <shriykul@in.ibm.com>,
	Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Subject: Re: [PATCH] powerpc64/hw_breakpoints: Handle data breakpoints in radix mode
Date: Wed, 14 Jun 2017 08:38:43 +0530	[thread overview]
Message-ID: <87r2yn1d1g.fsf@skywalker.in.ibm.com> (raw)
In-Reply-To: <20170613184200.22541-1-naveen.n.rao@linux.vnet.ibm.com>

"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:

> On P9, trying to use data breakpoints throws the splat shown below (*).
> This is because the check for a data breakpoint in DSISR is in
> do_hash_page(). Move this check to handle_page_fault() so as to catch
> data breakpoints in both hash and radix MMU modes.
>
> While at it, also remove the label '11' that was made redundant by
> commit a546498f3bf9aa ("powerpc: Call do_page_fault() with interrupts
> off")
>
> (*)
>     Unable to handle kernel paging request for data at address 0xc000000000e19218
>     Faulting instruction address: 0xc0000000001155e8
>     cpu 0x0: Vector: 300 (Data Access) at [c0000000ef1e7b20]
>     pc: c0000000001155e8: find_pid_ns+0x48/0xe0
>     lr: c000000000116ac4: find_task_by_vpid+0x44/0x90
>     sp: c0000000ef1e7da0
>     msr: 9000000000009033
>     dar: c000000000e19218
>     dsisr: 400000
>     current = 0xc0000000f1f59700
>     paca    = 0xc00000000fd40000 softe: 0 irq_happened: 0x01
>     pid   = 1192, comm = sh
>     Linux version 4.12.0-rc3-nnr (root@ea605ec2993c) (gcc version 5.4.0 20160609 (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.1) ) #74 SMP Tue Jun 13 16:52:49 UTC 2017
>     enter ? for help
>     [c0000000ef1e7dc0] c000000000116ac4 find_task_by_vpid+0x44/0x90
>     [c0000000ef1e7de0] c000000000108800 SyS_setpgid+0x80/0x220
>     [c0000000ef1e7e30] c00000000000ba6c system_call+0x38/0xfc
>     --- Exception: c01 (System Call) at 00007fff94480890
>     SP (7fffd91e7260) is in userspace
>
> Fixes: caca285e5ab4a ("powerpc/mm/radix: Use STD_MMU_64 to properly
> isolate hash related code")
> Reported-by: Shriya R. Kulkarni <shriykul@in.ibm.com>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> ---
>  arch/powerpc/kernel/exceptions-64s.S | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> index ae418b85c17c..17ee701b8336 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -1411,10 +1411,8 @@ USE_TEXT_SECTION()
>  	.balign	IFETCH_ALIGN_BYTES
>  do_hash_page:
>  #ifdef CONFIG_PPC_STD_MMU_64
> -	andis.	r0,r4,0xa410		/* weird error? */
> +	andis.	r0,r4,0xa450		/* weird error? */

Can we convert that to a #define value. Ram did try to do that here.

https://lists.ozlabs.org/pipermail/linuxppc-dev/2017-June/158607.html


>  	bne-	handle_page_fault	/* if not, try to insert a HPTE */
> -	andis.  r0,r4,DSISR_DABRMATCH@h
> -	bne-    handle_dabr_fault
>  	CURRENT_THREAD_INFO(r11, r1)
>  	lwz	r0,TI_PREEMPT(r11)	/* If we're in an "NMI" */
>  	andis.	r0,r0,NMI_MASK@h	/* (i.e. an irq when soft-disabled) */
> @@ -1442,7 +1440,9 @@ do_hash_page:
>  
>  /* Here we have a page fault that hash_page can't handle. */
>  handle_page_fault:
> -11:	ld	r4,_DAR(r1)
> +	andis.  r0,r4,DSISR_DABRMATCH@h
> +	bne-    handle_dabr_fault
> +	ld	r4,_DAR(r1)
>  	ld	r5,_DSISR(r1)
>  	addi	r3,r1,STACK_FRAME_OVERHEAD
>  	bl	do_page_fault
> -- 
> 2.12.2


-aneesh

  reply	other threads:[~2017-06-14  3:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13 18:42 [PATCH] powerpc64/hw_breakpoints: Handle data breakpoints in radix mode Naveen N. Rao
2017-06-14  3:08 ` Aneesh Kumar K.V [this message]
2017-06-14  5:11   ` Naveen N. Rao
2017-06-14  5:13     ` Aneesh Kumar K.V
2017-06-14  6:32       ` Ram Pai
2017-06-14  6:41       ` Michael Ellerman
2017-06-14 13:41         ` Naveen N. Rao
2017-06-14  6:07 ` Anshuman Khandual
2017-06-14  9:27   ` Michael Ellerman
2017-06-16  5:16 ` Michael Ellerman
2017-06-18  9:41   ` Naveen N. Rao
2017-06-19  9:51     ` Aneesh Kumar K.V
2017-06-19 10:30       ` Naveen N. Rao
2017-06-19 18:45       ` [PATCH v2] powerpc64/exceptions: Refactor code to eliminate a few memory loads Naveen N. Rao
2017-11-10  4:34         ` Michael Ellerman
2017-11-13 17:04           ` Naveen N. Rao
2021-11-25 11:06             ` Christophe Leroy
2017-06-19 12:22 ` powerpc64/hw_breakpoints: Handle data breakpoints in radix mode Michael Ellerman

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=87r2yn1d1g.fsf@skywalker.in.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ravi.bangoria@linux.vnet.ibm.com \
    --cc=shriykul@in.ibm.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;
as well as URLs for NNTP newsgroup(s).