From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Xie Yuanbin <xieyuanbin1@huawei.com>
Cc: linux@armlinux.org.uk, rmk+kernel@armlinux.org.uk,
clrkwllms@kernel.org, rostedt@goodmis.org, linusw@kernel.org,
arnd@arndb.de, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev,
liaohua4@huawei.com, lilinjie8@huawei.com
Subject: Re: [PATCH] ARM: enable interrupts when arm_notify_die() is handling user mode errors
Date: Thu, 25 Jun 2026 17:21:59 +0200 [thread overview]
Message-ID: <20260625152159.WtO_S3i7@linutronix.de> (raw)
In-Reply-To: <20260625122612.43501-1-xieyuanbin1@huawei.com>
On 2026-06-25 20:26:12 [+0800], Xie Yuanbin wrote:
> ```c
> if (!inf->fn(addr, ifsr | FSR_LNX_PF, regs))
> return;
>
> if (likely(user_mode(regs)))
> local_irq_enable();
>
> pr_alert("8<--- cut here ---\n");
> ```
> or
> ```c
> if (!inf->fn(addr, ifsr | FSR_LNX_PF, regs))
> return;
>
> if (likely(interrupts_enabled(regs)))
> local_irq_enable();
>
> pr_alert("8<--- cut here ---\n");
> ```
>
> Which one do you prefer? I prefer the first one, because for kernel
> fault, kernel may have encountered a serious issue,
> and enabling interrupts may be not appropriate.
Why would the latter be not appropriate?.
Anyway, in the kernel case you do die() which disables interrupts as of
oops_begin(). It does later restore the state in oops_end() and invokes
make_task_dead(). This one will complain if either preemption or
interrupts are disabled and reset both.
Should you get that far and not panic() earlier (due to in_interrupt()
for instance) then interrupts will be later enabled before that kernel
thread is killed. So it could be done earlier or not, at this point the
system is pretty much done.
Sebastian
prev parent reply other threads:[~2026-06-25 15:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 7:35 [PATCH] ARM: enable interrupts when arm_notify_die() is handling user mode errors Xie Yuanbin
2026-06-25 8:50 ` Sebastian Andrzej Siewior
2026-06-25 9:05 ` Russell King
2026-06-25 9:30 ` Sebastian Andrzej Siewior
2026-06-25 10:20 ` Russell King
2026-06-25 12:08 ` Sebastian Andrzej Siewior
2026-06-25 10:00 ` Xie Yuanbin
2026-06-25 10:23 ` Russell King
2026-06-25 12:26 ` Xie Yuanbin
2026-06-25 15:21 ` Sebastian Andrzej Siewior [this message]
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=20260625152159.WtO_S3i7@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=arnd@arndb.de \
--cc=clrkwllms@kernel.org \
--cc=liaohua4@huawei.com \
--cc=lilinjie8@huawei.com \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=linux@armlinux.org.uk \
--cc=rmk+kernel@armlinux.org.uk \
--cc=rostedt@goodmis.org \
--cc=xieyuanbin1@huawei.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