From: "K.Prasad" <prasad@linux.vnet.ibm.com>
To: Roland McGrath <roland@redhat.com>
Cc: Michael Neuling <mikey@neuling.org>,
Benjamin Herrenschmidt <benh@au1.ibm.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
David Gibson <dwg@au1.ibm.com>,
linuxppc-dev@ozlabs.org, Alan Stern <stern@rowland.harvard.edu>,
paulus@samba.org
Subject: Re: [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64
Date: Fri, 22 Jan 2010 12:44:02 +0530 [thread overview]
Message-ID: <20100122071402.GA3356@in.ibm.com> (raw)
In-Reply-To: <20100119100335.3EB621DE@magilla.sf.frob.com>
On Tue, Jan 19, 2010 at 02:03:35AM -0800, Roland McGrath wrote:
> > It is also not clear to me if disabling pre-emption for the user-space
> > (albeit for a very tiny time-window) is incorrect and if their side-effects
> > are known. If otherwise, I think we should choose to operate in pre-empt
> > safe mode and avoid all costs associated when done without it.
>
> I never really gave much consideration to returning to user mode with
> preemption disabled. It would not really have occurred to me that was
> even possible. I can't say it seems to me like it could ever be a very
> good idea. I find it hard even to start listing the cans of worms that
> might be opened by that. Perhaps the powerpc maintainers have a clearer
> picture of it than I do.
>
> What does it mean when there is something that prevents it from returning
> to user mode? i.e., TIF_SIGPENDING or TIF_NEED_RESCHED, or whatever. It
> could do a lot in the kernel before it gets back to user mode. What if in
> there somewhere it blocks voluntarily?
>
> Similarly, what does it mean if you get to user mode but the single-stepped
> instruction is a load/store that gets a page fault? What if it blocks in
> the page fault handler?
>
> For that matter, what about a page fault for the kernel-mode case?
>
> Perhaps I'm imagining gremlins where there aren't any, but I just cannot
> really get my head around this "disable preemption while running some
> unknown instruction that normally runs with preemption enabled" thing--let
> alone "disable preemption while returning to user mode".
>
>
> Thanks,
> Roland
I posted a patch which re-enables pre-emption after a hw-breakpoint is
processed (linuxppc-dev ref: 20100121084640.GA3252@in.ibm.com). It does
lead to clumsiness (due to the new variables to track states, prior
breakpoints, etc.) but with the reasons you pointed out, it is much
better than having uncertain/incorrect code.
Thanks for your comments.
-- K.Prasad
next prev parent reply other threads:[~2010-01-22 7:14 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-11 16:04 [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64 K.Prasad
2009-12-14 0:56 ` Roland McGrath
2009-12-14 18:03 ` K.Prasad
2009-12-14 19:26 ` Roland McGrath
2009-12-17 19:03 ` K.Prasad
2010-01-19 9:40 ` K.Prasad
2010-01-19 10:03 ` Roland McGrath
2010-01-22 7:14 ` K.Prasad [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-01-19 9:12 [Patch 0/1] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XI K.Prasad
2010-01-19 9:14 ` [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64 K.Prasad
2010-01-21 8:46 [Patch 0/1] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XII K.Prasad
2010-01-21 8:49 ` [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64 K.Prasad
2010-02-15 5:56 [Patch 0/1] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XIII K.Prasad
2010-02-15 5:59 ` [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64 K.Prasad
2010-02-21 1:01 ` Frederic Weisbecker
2010-02-22 13:17 ` K.Prasad
2010-02-23 10:57 ` K.Prasad
2010-02-26 17:52 ` Frederic Weisbecker
2010-02-26 1:58 ` Frederic Weisbecker
2010-03-08 23:57 ` David Gibson
2010-03-09 2:14 ` K.Prasad
2010-03-08 18:12 [Patch 0/1] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XIV K.Prasad
2010-03-08 18:14 ` [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64 K.Prasad
2010-03-12 6:19 ` Benjamin Herrenschmidt
2010-03-15 6:29 ` K.Prasad
2010-04-07 8:03 ` Benjamin Herrenschmidt
2010-04-14 3:53 ` K.Prasad
2010-03-23 5:33 ` Paul Mackerras
2010-03-23 7:28 ` 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=20100122071402.GA3356@in.ibm.com \
--to=prasad@linux.vnet.ibm.com \
--cc=benh@au1.ibm.com \
--cc=dwg@au1.ibm.com \
--cc=fweisbec@gmail.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.org \
--cc=paulus@samba.org \
--cc=roland@redhat.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).