Re: [PATCH 1/2] arm64/entry: Fix involuntary preemption exception masking

From: Jinjie Ruan

Date: Thu Mar 26 2026 - 21:27:38 EST




On 2026/3/27 2:11, Mark Rutland wrote:
> On Wed, Mar 25, 2026 at 04:46:01PM +0100, Thomas Gleixner wrote:
>> On Wed, Mar 25 2026 at 11:03, Mark Rutland wrote:
>>> On Sun, Mar 22, 2026 at 12:25:06AM +0100, Thomas Gleixner wrote:
>>> I *think* what would work for us is we could split some of the exit
>>> handling (including involuntary preemption) into a "prepare" step, as we
>>> have for return to userspace. That way, arm64 could handle exiting
>>> something like:
>>>
>>> local_irq_disable();
>>> irqentry_exit_prepare(); // new, all generic logic
>>> local_daif_mask();
>>> arm64_exit_to_kernel_mode() {
>>> ...
>>> irqentry_exit(); // ideally irqentry_exit_to_kernel_mode().
>>> ...
>>> }
>>>
>>> ... and other architectures can use a combined exit_to_kernel_mode() (or
>>> whatever we call that), which does both, e.g.
>>>
>>> // either noinstr, __always_inline, or a macro
>>> void irqentry_prepare_and_exit(void)
>>
>> That's a bad idea as that would require to do a full kernel rename of
>> all existing irqentry_exit() users.
>>
>>> {
>>> irqentry_exit_prepare();
>>> irqentry_exit();
>>> }
>>
>> Aside of the naming that should work.
>
> Thanks for confirming!
>
> I've pushed a (very early, WIP) draft to
>
> https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=arm64/entry/rework

The patch also looks good to me. Looking forward to seeing this move
forward.

>
> ... which is missing commit messages, comments, etc, but seems to work.
>
> I'll see about getting that tested, cleaned up, and on-list.
>
> Mark.
>