All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: vladimir.murzin@arm.com, peterz@infradead.org,
	catalin.marinas@arm.com, ruanjinjie@huawei.com,
	linux-kernel@vger.kernel.org, luto@kernel.org, will@kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] arm64/entry: Fix involuntary preemption exception masking
Date: Tue, 24 Mar 2026 13:19:42 +0100	[thread overview]
Message-ID: <87se9ph129.ffs@tglx> (raw)
In-Reply-To: <87fr5six4d.ffs@tglx>

On Sun, Mar 22 2026 at 00:25, Thomas Gleixner wrote:
> On Fri, Mar 20 2026 at 17:31, Mark Rutland wrote:
> Looking at those details made me also look at this magic
> arch_irqentry_exit_need_resched() inline function. 
>
> 	/*
> 	 * DAIF.DA are cleared at the start of IRQ/FIQ handling, and when GIC
> 	 * priority masking is used the GIC irqchip driver will clear DAIF.IF
> 	 * using gic_arch_enable_irqs() for normal IRQs. If anything is set in
> 	 * DAIF we must have handled an NMI, so skip preemption.
> 	 */
> 	if (system_uses_irq_prio_masking() && read_sysreg(daif))
> 		return false;
>
> Why is this using irqentry_enter/exit() in the first place? 

Ah. The entry point does

          if (regs_irqs_disabled(regs))
          	do_nmi();
          else
                do_irq();

So you end up in do_irq() and eventually in the preemption path and need
that check to prevent scheduling. So that should be fine and obviously
won't hit the code path I outlined.

Thanks,

        tglx






WARNING: multiple messages have this Message-ID (diff)
From: Thomas Gleixner <tglx@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, ada.coupriediaz@arm.com,
	catalin.marinas@arm.com, linux-kernel@vger.kernel.org,
	luto@kernel.org, peterz@infradead.org, ruanjinjie@huawei.com,
	vladimir.murzin@arm.com, will@kernel.org
Subject: Re: [PATCH 1/2] arm64/entry: Fix involuntary preemption exception masking
Date: Tue, 24 Mar 2026 13:19:42 +0100	[thread overview]
Message-ID: <87se9ph129.ffs@tglx> (raw)
In-Reply-To: <87fr5six4d.ffs@tglx>

On Sun, Mar 22 2026 at 00:25, Thomas Gleixner wrote:
> On Fri, Mar 20 2026 at 17:31, Mark Rutland wrote:
> Looking at those details made me also look at this magic
> arch_irqentry_exit_need_resched() inline function. 
>
> 	/*
> 	 * DAIF.DA are cleared at the start of IRQ/FIQ handling, and when GIC
> 	 * priority masking is used the GIC irqchip driver will clear DAIF.IF
> 	 * using gic_arch_enable_irqs() for normal IRQs. If anything is set in
> 	 * DAIF we must have handled an NMI, so skip preemption.
> 	 */
> 	if (system_uses_irq_prio_masking() && read_sysreg(daif))
> 		return false;
>
> Why is this using irqentry_enter/exit() in the first place? 

Ah. The entry point does

          if (regs_irqs_disabled(regs))
          	do_nmi();
          else
                do_irq();

So you end up in do_irq() and eventually in the preemption path and need
that check to prevent scheduling. So that should be fine and obviously
won't hit the code path I outlined.

Thanks,

        tglx





  reply	other threads:[~2026-03-24 12:19 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 11:30 [PATCH 0/2] arm64/entry: Fix involuntary preemption exception masking Mark Rutland
2026-03-20 11:30 ` Mark Rutland
2026-03-20 11:30 ` [PATCH 1/2] " Mark Rutland
2026-03-20 11:30   ` Mark Rutland
2026-03-20 13:04   ` Peter Zijlstra
2026-03-20 13:04     ` Peter Zijlstra
2026-03-20 14:11     ` Thomas Gleixner
2026-03-20 14:11       ` Thomas Gleixner
2026-03-20 14:57       ` Mark Rutland
2026-03-20 14:57         ` Mark Rutland
2026-03-20 15:34         ` Peter Zijlstra
2026-03-20 15:34           ` Peter Zijlstra
2026-03-20 16:16           ` Mark Rutland
2026-03-20 16:16             ` Mark Rutland
2026-03-20 15:50         ` Thomas Gleixner
2026-03-20 15:50           ` Thomas Gleixner
2026-03-23 17:21           ` Mark Rutland
2026-03-23 17:21             ` Mark Rutland
2026-03-20 14:59   ` Thomas Gleixner
2026-03-20 14:59     ` Thomas Gleixner
2026-03-20 15:37     ` Mark Rutland
2026-03-20 15:37       ` Mark Rutland
2026-03-20 16:26       ` Thomas Gleixner
2026-03-20 16:26         ` Thomas Gleixner
2026-03-20 17:31         ` Mark Rutland
2026-03-20 17:31           ` Mark Rutland
2026-03-21 23:25           ` Thomas Gleixner
2026-03-21 23:25             ` Thomas Gleixner
2026-03-24 12:19             ` Thomas Gleixner [this message]
2026-03-24 12:19               ` Thomas Gleixner
2026-03-25 11:03             ` Mark Rutland
2026-03-25 11:03               ` Mark Rutland
2026-03-25 15:46               ` Thomas Gleixner
2026-03-25 15:46                 ` Thomas Gleixner
2026-03-26  8:56                 ` Jinjie Ruan
2026-03-26  8:56                   ` Jinjie Ruan
2026-03-26 18:11                 ` Mark Rutland
2026-03-26 18:11                   ` Mark Rutland
2026-03-26 18:32                   ` Thomas Gleixner
2026-03-26 18:32                     ` Thomas Gleixner
2026-03-27  1:27                   ` Jinjie Ruan
2026-03-27  1:27                     ` Jinjie Ruan
2026-03-26  8:52               ` Jinjie Ruan
2026-03-26  8:52                 ` Jinjie Ruan
2026-03-24  3:14   ` Jinjie Ruan
2026-03-24  3:14     ` Jinjie Ruan
2026-03-24 10:51     ` Mark Rutland
2026-03-24 10:51       ` Mark Rutland
2026-03-20 11:30 ` [PATCH 2/2] arm64/entry: Remove arch_irqentry_exit_need_resched() Mark Rutland
2026-03-20 11:30   ` Mark Rutland

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=87se9ph129.ffs@tglx \
    --to=tglx@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=peterz@infradead.org \
    --cc=ruanjinjie@huawei.com \
    --cc=vladimir.murzin@arm.com \
    --cc=will@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.