Linux-RISC-V Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/4] riscv: correct the do_trap_break()
@ 2019-09-23  0:45 Vincent Chen
  2019-09-23  0:45 ` [PATCH 1/4] riscv: avoid kernel hangs when trapped in BUG() Vincent Chen
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Vincent Chen @ 2019-09-23  0:45 UTC (permalink / raw)
  To: linux-riscv; +Cc: vincent.chen, palmer, linux-kernel, aou, paul.walmsley


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

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, back to index

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-23  0:45 [PATCH 0/4] riscv: correct the do_trap_break() Vincent Chen
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

Linux-RISC-V Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-riscv/0 linux-riscv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-riscv linux-riscv/ https://lore.kernel.org/linux-riscv \
		linux-riscv@lists.infradead.org
	public-inbox-index linux-riscv

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-riscv


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git