All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Marek Vasut <marex@denx.de>, Riku Voipio <riku.voipio@iki.fi>,
	Laurent Vivier <laurent@vivier.eu>,
	Chris Wulff <crwulff@gmail.com>,
	patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 0/2] linux-user: Don't call gdb_handlesig unnecessarily
Date: Sat, 20 Oct 2018 12:49:31 -0700	[thread overview]
Message-ID: <9a54dfbd-e1fc-b20b-249e-97a613fff1e7@linaro.org> (raw)
In-Reply-To: <20181019174958.26616-1-peter.maydell@linaro.org>

On 10/19/18 10:49 AM, Peter Maydell wrote:
> This patchset fixes a minor bug in our handling of SIGTRAP
> in linux-user.
> 
> The CPU main-loop routines for linux-user generally call
> gdb_handlesig() when they're about to queue a SIGTRAP signal.  This
> is wrong, because queue_signal() will cause us to pend a signal, and
> process_pending_signals() will then call gdb_handlesig() itself.  So
> the effect is that we notify gdb of the SIGTRAP, and then if gdb says
> "OK, continue with signal X" we will incorrectly notify gdb of the
> signal X as well.  We don't do this double-notify for anything else,
> only SIGTRAP.
> 
> This bug only manifests if the user responds to the reported SIGTRAP
> using "signal SIGFOO" rather than "continue"; since the latter is the
> overwhelmingly common thing to do after a breakpoint most people
> won't have hit this.
> 
> Patch 1 fixes this bug for every target except nios2, by
> deleting the incorrect code.
> 
> Patch 2 fixes nios2 separately, because it was doing some odd
> things with gdb_handlesig(). This also fixes in passing a Coverity
> issue.
> 
> Tested with "make check-tcg", and with some by-hand stepping
> around with an attached gdb. NB that the nios2 patch is only
> compile tested as I don't have a nios2 linux-user environment
> and check-tcg doesn't cover it.
> 
> thanks
> -- PMM
> 
> Peter Maydell (2):
>   linux-user: Don't call gdb_handlesig() before queue_signal()
>   linux-user: Clean up nios2 main loop signal handling

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~

  parent reply	other threads:[~2018-10-20 19:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-19 17:49 [Qemu-devel] [PATCH 0/2] linux-user: Don't call gdb_handlesig unnecessarily Peter Maydell
2018-10-19 17:49 ` [Qemu-devel] [PATCH 1/2] linux-user: Don't call gdb_handlesig() before queue_signal() Peter Maydell
2018-10-19 17:49 ` [Qemu-devel] [PATCH 2/2] linux-user: Clean up nios2 main loop signal handling Peter Maydell
2018-11-12 16:12   ` Laurent Vivier
2018-10-20 19:49 ` Richard Henderson [this message]
2018-11-12 14:39 ` [Qemu-devel] [PATCH 0/2] linux-user: Don't call gdb_handlesig unnecessarily Peter Maydell
2018-11-12 14:46   ` Laurent Vivier
2018-11-12 14:48     ` Peter Maydell

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=9a54dfbd-e1fc-b20b-249e-97a613fff1e7@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=crwulff@gmail.com \
    --cc=laurent@vivier.eu \
    --cc=marex@denx.de \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.