All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Florian Bezdeka <florian.bezdeka@siemens.com>
Cc: xenomai@lists.linux.dev,  Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [PATCH Dovetail 6.18 3/3] arm64: irq_pipeline: Fix IPI_KGDB_ROUNDUP and IPI_CPU_BACKTRACE IPIs
Date: Tue, 03 Feb 2026 12:59:58 +0100	[thread overview]
Message-ID: <87pl6mxcjl.fsf@xenomai.org> (raw)
In-Reply-To: <20260201-wip-flo-fixes-for-6-18-v1-3-91ea07c7eb7e@siemens.com> (Florian Bezdeka's message of "Mon, 02 Feb 2026 08:55:22 +0100")

Florian Bezdeka <florian.bezdeka@siemens.com> writes:

> Both IPIs (IPI_KGDB_ROUNDUP and IPI_CPU_BACKTRACE) are multiplexed in
> case the IRQ pipelining is enabled, so we have to set an IPI reason
> in both cases.
>
> Both cases were directly calling into the IRQ chip implementation and
> forgot to set the reason. IPIs were ignored on the receiving side at
> the end.
>
> As tracing should be bypassed for all IRQs behind NR_IPI we can not
> call smp_cross_call() - where setting the reason / ipi message took
> place.
>
> Setting the reason has been factored out into set_ipi_message() which
> can be called with and without IRQ pipelining.
>
> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
> ---
>  arch/arm64/kernel/smp.c | 29 +++++++++++++++++++++--------
>  1 file changed, 21 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index 716ba0b0c274b..f85392de0e6a6 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -913,6 +913,24 @@ static void __noreturn ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs *regs
>  #endif
>  }
>  
> +#ifdef CONFIG_IRQ_PIPELINE
> +
> +DEFINE_PER_CPU(unsigned long, ipi_messages);
> +
> +static inline void set_ipi_message(const cpumask_t *target, unsigned int ipi)
> +{
> +	int cpu;
> +
> +	for_each_cpu(cpu, target)
> +		set_bit(ipi, &per_cpu(ipi_messages, cpu));
> +
> +	wmb();
> +}
> +#else
> +static inline void set_ipi_message(const cpumask_t *target, unsigned int ipi)
> +{ }
> +#endif
> +
>  static void arm64_send_ipi(const cpumask_t *mask, unsigned int nr)
>  {
>  	unsigned int cpu;
> @@ -926,6 +944,7 @@ static void arm64_send_ipi(const cpumask_t *mask, unsigned int nr)
>  
>  static void arm64_backtrace_ipi(cpumask_t *mask)
>  {
> +	set_ipi_message(mask, IPI_CPU_BACKTRACE);
>  	arm64_send_ipi(mask, IPI_CPU_BACKTRACE);
>  }
>  
> @@ -951,6 +970,7 @@ void kgdb_roundup_cpus(void)
>  		if (cpu == this_cpu)
>  			continue;
>  
> +		set_ipi_message(cpumask_of(cpu), IPI_KGDB_ROUNDUP);
>  		__ipi_send_single(get_ipi_desc(cpu, IPI_KGDB_ROUNDUP), cpu);
>  	}
>  }
> @@ -1047,8 +1067,6 @@ static void __smp_cross_call(const struct cpumask *target, unsigned int ipinr)
>  	arm64_send_ipi(target, ipinr);
>  }
>  
> -static DEFINE_PER_CPU(unsigned long, ipi_messages);
> -
>  static DEFINE_PER_CPU(unsigned int [MAX_IPI], ipi_counts);
>  
>  static irqreturn_t ipi_handler(int irq, void *data)
> @@ -1074,13 +1092,8 @@ static irqreturn_t ipi_handler(int irq, void *data)
>  
>  static void smp_cross_call(const struct cpumask *target, unsigned int ipinr)
>  {
> -	unsigned int cpu;
> -
>  	/* regular in-band IPI (multiplexed over SGI0). */
> -	for_each_cpu(cpu, target)
> -		set_bit(ipinr, &per_cpu(ipi_messages, cpu));
> -
> -	wmb();
> +	set_ipi_message(target, ipinr);
>  	__smp_cross_call(target, 0);
>  }

Ouch, yes. Ack.

-- 
Philippe.

      reply	other threads:[~2026-02-03 12:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02  7:55 [PATCH Dovetail 6.18 0/3] Fix IPI mapping for arm64 Florian Bezdeka
2026-02-02  7:55 ` [PATCH Dovetail 6.18 1/3] arm64: irq_pipeline: Fix mapping of SGI/LPI IPIs Florian Bezdeka
2026-02-03 13:08   ` Philippe Gerum
2026-02-03 15:25     ` Florian Bezdeka
2026-02-03 17:22       ` Philippe Gerum
2026-02-03 17:44         ` Philippe Gerum
2026-02-03 21:48         ` Florian Bezdeka
2026-02-03 22:00           ` Bezdeka, Florian
2026-02-04 11:44             ` Philippe Gerum
2026-02-04 16:46               ` Florian Bezdeka
2026-02-04 18:04                 ` Philippe Gerum
2026-02-02  7:55 ` [PATCH Dovetail 6.18 2/3] arm64: irq_pipeline: Fix size of IPI statistics array Florian Bezdeka
2026-02-03 11:59   ` Philippe Gerum
2026-02-02  7:55 ` [PATCH Dovetail 6.18 3/3] arm64: irq_pipeline: Fix IPI_KGDB_ROUNDUP and IPI_CPU_BACKTRACE IPIs Florian Bezdeka
2026-02-03 11:59   ` Philippe Gerum [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=87pl6mxcjl.fsf@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=florian.bezdeka@siemens.com \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai@lists.linux.dev \
    /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.