linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: "K.Prasad" <prasad@linux.vnet.ibm.com>
Cc: Michael Neuling <mikey@neuling.org>,
	Benjamin Herrenschmidt <benh@au1.ibm.com>,
	shaggy@linux.vnet.ibm.com,
	Frederic Weisbecker <fweisbec@gmail.com>,
	David Gibson <dwg@au1.ibm.com>,
	linuxppc-dev@ozlabs.org, Alan Stern <stern@rowland.harvard.edu>,
	Roland McGrath <roland@redhat.com>
Subject: Re: [RFC Patch 1/2] PPC64-HWBKPT: Disable interrupts for data breakpoint exceptions
Date: Tue, 30 Mar 2010 16:24:42 +1100	[thread overview]
Message-ID: <20100330052442.GB12619@drongo> (raw)
In-Reply-To: <20100323140702.GB21836@in.ibm.com>

On Tue, Mar 23, 2010 at 07:37:02PM +0530, K.Prasad wrote:

> Index: linux-2.6.ppc64_test/arch/powerpc/kernel/exceptions-64s.S
> ===================================================================
> --- linux-2.6.ppc64_test.orig/arch/powerpc/kernel/exceptions-64s.S
> +++ linux-2.6.ppc64_test/arch/powerpc/kernel/exceptions-64s.S
> @@ -735,6 +735,9 @@ _STATIC(do_hash_page)
>  	std	r3,_DAR(r1)
>  	std	r4,_DSISR(r1)
>  
> +	andis.  r0,r4,0x0040		/* Data Address Breakpoint match? */

Minor comment: why not DSISR_DABRMATCH@h instead of 0x0040?

> +	bne-    handle_dabr_fault
> +
>  	andis.	r0,r4,0xa450		/* weird error? */
>  	bne-	handle_page_fault	/* if not, try to insert a HPTE */
>  BEGIN_FTR_SECTION
> @@ -823,6 +826,15 @@ END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISER
>  	bl	.raw_local_irq_restore
>  	b	11f
>  
> +/* We have a data breakpoint exception - handle it */
> +handle_dabr_fault:
> +	/* Populate the pt_regs structure */

Another minor comment: that comment isn't accurate since you're not
putting anything in the pt_regs, just getting arguments to do_dabr
from it.

> +	ld      r4,_DAR(r1)
> +	ld      r5,_DSISR(r1)
> +	addi    r3,r1,STACK_FRAME_OVERHEAD
> +	bl      .do_dabr
> +	b       .ret_from_except_lite
> +
>  /* Here we have a page fault that hash_page can't handle. */
>  handle_page_fault:
>  	ENABLE_INTS
> Index: linux-2.6.ppc64_test/arch/powerpc/mm/fault.c
> ===================================================================
> --- linux-2.6.ppc64_test.orig/arch/powerpc/mm/fault.c
> +++ linux-2.6.ppc64_test/arch/powerpc/mm/fault.c
> @@ -151,7 +151,7 @@ int __kprobes do_page_fault(struct pt_re
>  	if (!user_mode(regs) && (address >= TASK_SIZE))
>  		return SIGSEGV;
>  
> -#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
> +#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE) || defined(CONFIG_PPC64))

If we added similar code to head_32.S, we could probably remove this
whole ifdef block.  But that can be done in a later patch.

Paul.

  reply	other threads:[~2010-03-30  5:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100323140008.954823303@pr>
2010-03-23 14:07 ` [RFC Patch 1/2] PPC64-HWBKPT: Disable interrupts for data breakpoint exceptions K.Prasad
2010-03-30  5:24   ` Paul Mackerras [this message]
2010-03-30  5:32     ` Benjamin Herrenschmidt
2010-03-30 10:19       ` K.Prasad
2010-03-30 10:17     ` K.Prasad
2010-03-23 14:07 ` [RFC Patch 2/2] PPC64-HWBKPT: Implement hw-breakpoints for PPC64 K.Prasad
2010-03-26 21:11   ` Dave Kleikamp
2010-03-29 11:31     ` K.Prasad
2010-03-29 19:53       ` Dave Kleikamp
2010-03-30 10:12         ` K.Prasad

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=20100330052442.GB12619@drongo \
    --to=paulus@samba.org \
    --cc=benh@au1.ibm.com \
    --cc=dwg@au1.ibm.com \
    --cc=fweisbec@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=prasad@linux.vnet.ibm.com \
    --cc=roland@redhat.com \
    --cc=shaggy@linux.vnet.ibm.com \
    --cc=stern@rowland.harvard.edu \
    /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).