Linux Documentation
 help / color / mirror / Atom feed
From: Kohei Enju <enju.kohei@fujitsu.com>
To: Marc Zyngier <maz@kernel.org>
Cc: Tomohiro Misono <misono.tomohiro@fujitsu.com>,
	 Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	 Mark Rutland <mark.rutland@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	 Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	 Thomas Gleixner <tglx@kernel.org>, Radu Rendec <radu@rendec.net>,
	 linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	 linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 4/4] irqchip/gicv3: Add workaround for FUJITSU-MONAKA erratum E#030003
Date: Wed, 7 Oct 2026 17:17:29 +0900	[thread overview]
Message-ID: <asX5CiaDodoFrn0q@FCCLS0092175.localdomain> (raw)
In-Reply-To: <878q4b2mj5.wl-maz@kernel.org>

Hi Marc,

On 10/06 10:42, Marc Zyngier wrote:
> On Tue, 06 Oct 2026 10:08:19 +0100,
> Kohei Enju <enju.kohei@fujitsu.com> wrote:
> > 
> > On 10/02 13:26, Marc Zyngier wrote:
> > > On Fri, 02 Oct 2026 11:26:52 +0100,
> > > Tomohiro Misono <misono.tomohiro@fujitsu.com> wrote:
> > > > 
> > > > From: Kohei Enju <enju.kohei@fujitsu.com>
> > > > 
> > > > On affected FUJITSU-MONAKA CPUs, an SGI generated by writing to
> > > > ICC_SGI0R_EL1, ICC_SGI1R_EL1, or ICC_ASGI1R_EL1 may be lost if the
> > > > operation races with CPU interface processing triggered by the arrival
> > > > of a higher-priority interrupt, an update to a pending interrupt, or a
> > > > transition of the PE to the Sleep state. When this occurs, the system
> > > > register write does not complete, causing the issuing core to hang.
> > > >
> > > 
> > > Is the SGI lost? Or is the sender core hanging?
> > 
> > Both: the SGI is lost, and the sysreg write does not complete, causing
> > the sending core to hang.
> 
> I don't think the two are distinguishable. You might want to simplify
> the commit message to simply say that the CPU hangs.
> 
> [...]
> 
> > > > +		 */
> > > > +		for_each_cpu(cpu, mask)
> > > > +			gic_send_sgi_via_rdist(cpu, d->hwirq);
> > > > +
> > > > +		/* Force the above writes to GICR_ISPENDR0 to be executed */
> > > > +		dsb(st);
> > > 
> > > This doesn't force things to be executed. This is about completion of
> > > the access, and with an nGnRE mapping, it doesn't enforce that the
> > > stores actually reach the RDs, only an arbitrary point in the memory
> > > subsystem.  The only way to guarantee this is to perform a read-back.
> > 
> > Understood.
> > 
> > I hadn't considered this when writing v1, but on further reflection, I
> > don't think gic_ipi_send_mask() needs to wait for the target CPUs to
> > handle the IPIs.
> 
> It's not about the target CPU handling the IPI, that'd be crazy. It is
> about making sure that the IPI request has been observed by the HW and
> that it is not going to race with something else.
> 
> > Given that the GICv2 driver does not wait for MMIO
> > write completion either, I don't think we need to ensure completion of
> > these writes before returning.
> 
> GICv2 has different architectural requirements (i.e. none). GICv3 is a
> bit clearer, see the requirements at the end of 12.1.3 in IHI0069H.b.
> 
> > 
> > If my understanding is correct, I'll remove the dsb(st) in v2.
> >
> 
> As indicated in the spec, you either need nGnRnE+DSB, or a read-back.
> Given that Linux uses nGnRE for all device mappings, read-back is the
> only option here.

I understand that section 12.1.3 describes how software can guarantee
completion of a memory-mapped GIC write. With an nGnRE mapping, if the
GICR_ISPENDR0 writes must complete before gic_ipi_send_mask() returns, a
read-back from each target Redistributor is needed.

What I am trying to understand is whether completion at this point is an
architectural requirement for this particular write, or a requirement of
Linux's ipi_send_mask() interface.

I could not find an explicit completion requirement for ipi_send_mask()
itself. The normal GICv3 path also appears to return after an ISB,
without the DSB described in section 12.1.6 as necessary to guarantee
that the associated Redistributor has observed the write. This is why I
am unsure what completion guarantee is required here.

More specifically, I would like to understand:
- What could an outstanding IPI request race with?
- Which component must have observed the request before
  gic_ipi_send_mask() returns: the CPU interface, the sending PE's
  Redistributor, or the target Redistributor?

A pointer to the relevant architectural requirement or an example of
such a race in Linux would help me understand why completion is needed
here.

Thanks,
Kohei

> 
> Thanks,
> 
> 	M.
> 
> -- 
> Jazz isn't dead. It just smells funny.

      reply	other threads:[~2026-10-07  8:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 10:26 [PATCH 0/4] arm64: Add workarounds for FUJITSU-MONAKA CPU Tomohiro Misono
2026-10-02 10:26 ` [PATCH 1/4] arm64: cputype: Add FUJITSU MONAKA definition Tomohiro Misono
2026-10-02 10:26 ` [PATCH 2/4] arm64: tlb: Add tlbi workaround for FUJITSU-MONAKA Erratum E#030001 Tomohiro Misono
2026-10-02 12:43   ` Will Deacon
2026-10-06  9:48     ` Tomohiro Misono (Fujitsu)
2026-10-02 13:01   ` Mark Rutland
2026-10-06  9:45     ` Tomohiro Misono (Fujitsu)
2026-10-02 10:26 ` [PATCH 3/4] perf: arm_pmu: Add workaround for FUJITSU-MONAKA Erratum E#030002 Tomohiro Misono
2026-10-02 12:44   ` Will Deacon
2026-10-06  9:52     ` Tomohiro Misono (Fujitsu)
2026-10-02 10:26 ` [PATCH 4/4] irqchip/gicv3: Add workaround for FUJITSU-MONAKA erratum E#030003 Tomohiro Misono
2026-10-02 12:26   ` Marc Zyngier
2026-10-06  9:08     ` Kohei Enju
2026-10-06  9:42       ` Marc Zyngier
2026-10-07  8:17         ` Kohei Enju [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=asX5CiaDodoFrn0q@FCCLS0092175.localdomain \
    --to=enju.kohei@fujitsu.com \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=misono.tomohiro@fujitsu.com \
    --cc=radu@rendec.net \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox