linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/4] arm64: kgdb: disable interrupts while a software step is enabled
Date: Wed, 21 Jun 2017 11:00:08 +0100	[thread overview]
Message-ID: <20170621100008.GI3768@arm.com> (raw)
In-Reply-To: <20170621024304.GI4820@linaro.org>

On Wed, Jun 21, 2017 at 11:43:05AM +0900, AKASHI Takahiro wrote:
> On Tue, Jun 20, 2017 at 06:07:00PM +0100, Will Deacon wrote:
> > On Tue, Jun 20, 2017 at 11:43:34AM +0900, AKASHI Takahiro wrote:
> > > On Wed, Jun 07, 2017 at 05:50:18PM +0100, Will Deacon wrote:
> > > > On Wed, Jun 07, 2017 at 02:34:50PM +0900, AKASHI Takahiro wrote:
> >
> > > > Ok, but don't we need to re-enable interrupts, otherwise we can't safely
> > > > handle the fault (which might involve blocking)?
> > > 
> > > I thought a lot, but have got no other way to solve the issue, which
> > > totally makes stepi in vain.
> > > In theory, you might be right, but in practice, people don't always expect
> > > to step through the whole sequence of fault recovery with single stepping.
> > > Once we do 'c(ontinue),' interrupts are enabled again and the execution
> > > will follow as expected.
> > 
> > It's not the stepping guarantees I'm worried about. I'm more worried that
> > the fault handler panics because it's called with IRQs disabled,
> 
> I'm still wondering how it can cause panic.

Well you're calling the page fault path with interrupts disabled. It might
try to allocate page tables without passing GFP_ATOMIC, or it might block on
I/O or reschedule.

The answer might well be "you can't step put_user and friends", but perhaps
we should try to enforce that rather than go horribly wrong if you do it.

Will

  reply	other threads:[~2017-06-21 10:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23  4:30 [PATCH v3 0/4] arm64: kgdb: fix single stepping AKASHI Takahiro
2017-05-23  4:30 ` [PATCH v3 1/4] " AKASHI Takahiro
2017-06-05 16:29   ` Will Deacon
2017-06-07  4:43     ` AKASHI Takahiro
2017-05-23  4:30 ` [PATCH v3 2/4] arm64: kgdb: disable interrupts while a software step is enabled AKASHI Takahiro
2017-06-05 16:29   ` Will Deacon
2017-06-07  5:34     ` AKASHI Takahiro
2017-06-07 16:50       ` Will Deacon
2017-06-20  2:43         ` AKASHI Takahiro
2017-06-20 17:07           ` Will Deacon
2017-06-21  2:43             ` AKASHI Takahiro
2017-06-21 10:00               ` Will Deacon [this message]
2017-05-23  4:30 ` [PATCH v3 3/4] arm64: kgdb: prevent kgdb from being invoked recursively AKASHI Takahiro
2017-05-23  4:30 ` [PATCH v3 4/4] kgdb: select a correct cpu while in a single stepping AKASHI Takahiro

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=20170621100008.GI3768@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).