From: Vincent Chen <vincent.chen@sifive.com>
To: linux-riscv@lists.infradead.org
Cc: vincent.chen@sifive.com, palmer@sifive.com,
linux-kernel@vger.kernel.org, aou@eecs.berkeley.edu,
paul.walmsley@sifive.com
Subject: [PATCH 0/4] riscv: correct the do_trap_break()
Date: Mon, 23 Sep 2019 08:45:13 +0800 [thread overview]
Message-ID: <1569199517-5884-1-git-send-email-vincent.chen@sifive.com> (raw)
The following three situations may occur in the current implementation of
do_trap_break().
1. When the CONFIG_GENERIC_BUG is disabled, if a kernel thread is trapped
by BUG(), the whole system will be in the loop that infinitely handles
the break exception instead of entering the die function.
2. When the kernel runs code on behalf of a user thread, and the kernel
executes a WARN() or WARN_ON(), the user thread will be sent a bogus
SIGTRAP.
3. Handling the unexpected ebreak instructions is to send a SIGTRAP
to the trapped thread. However, if a kernel executes an unexpected
ebreak, it may cause the kernel thread to be stuck in the ebreak
instruction.
This patch set will solve the above problems by adjusting the
implementations of the do_trap_break().
Vincent Chen (4):
riscv: avoid kernel hangs when trapped in BUG()
rsicv: avoid sending a SIGTRAP to a user thread trapped in WARN()
riscv: Correct the handling of unexpected ebreak in do_trap_break()
riscv: remove the switch statement in do_trap_break()
arch/riscv/kernel/traps.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
--
2.7.4
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2019-09-23 0:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-23 0:45 Vincent Chen [this message]
2019-09-23 0:45 ` [PATCH 1/4] riscv: avoid kernel hangs when trapped in BUG() Vincent Chen
2019-09-27 22:25 ` Christoph Hellwig
2019-10-04 18:26 ` Paul Walmsley
2019-09-23 0:45 ` [PATCH 2/4] rsicv: avoid sending a SIGTRAP to a user thread trapped in WARN() Vincent Chen
2019-09-27 22:27 ` Christoph Hellwig
2019-09-27 22:56 ` Christoph Hellwig
2019-09-30 0:22 ` Vincent Chen
2019-10-04 18:26 ` Paul Walmsley
2019-09-23 0:45 ` [PATCH 3/4] riscv: Correct the handling of unexpected ebreak in do_trap_break() Vincent Chen
2019-09-27 22:43 ` Christoph Hellwig
2019-10-04 18:28 ` Paul Walmsley
2019-09-23 0:45 ` [PATCH 4/4] riscv: remove the switch statement " Vincent Chen
2019-09-27 22:47 ` Christoph Hellwig
2019-10-07 16:08 ` Paul Walmsley
2019-10-07 16:10 ` Christoph Hellwig
2019-10-07 16:30 ` Paul Walmsley
2019-10-08 0:14 ` Vincent Chen
2019-10-08 17:07 ` Paul Walmsley
2019-10-09 22:26 ` Paul Walmsley
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=1569199517-5884-1-git-send-email-vincent.chen@sifive.com \
--to=vincent.chen@sifive.com \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@sifive.com \
--cc=paul.walmsley@sifive.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).