[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1569199517-5884-1-git-send-email-vincent.chen@sifive.com>
Date: Mon, 23 Sep 2019 08:45:13 +0800
From: Vincent Chen <vincent.chen@...ive.com>
To: linux-riscv@...ts.infradead.org
Cc: paul.walmsley@...ive.com, palmer@...ive.com, aou@...s.berkeley.edu,
linux-kernel@...r.kernel.org, vincent.chen@...ive.com
Subject: [PATCH 0/4] riscv: correct the do_trap_break()
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
Powered by blists - more mailing lists