From: Mark Rutland <mark.rutland@arm.com>
To: "Tomohiro Misono (Fujitsu)" <misono.tomohiro@fujitsu.com>
Cc: 'Catalin Marinas' <catalin.marinas@arm.com>,
'Will Deacon' <will@kernel.org>,
'Jonathan Corbet' <corbet@lwn.net>,
'Shuah Khan' <skhan@linuxfoundation.org>,
'Randy Dunlap' <rdunlap@infradead.org>,
'Marc Zyngier' <maz@kernel.org>,
'Thomas Gleixner' <tglx@kernel.org>,
'Radu Rendec' <radu@rendec.net>,
'Oliver Upton' <oupton@kernel.org>,
'Fuad Tabba' <fuad.tabba@linux.dev>,
'Joey Gouly' <joey.gouly@arm.com>,
'Steffen Eiden' <seiden@linux.ibm.com>,
'Suzuki K Poulose' <suzuki.poulose@arm.com>,
'Zenghui Yu' <yuzenghui@huawei.com>,
"Kohei Enju (Fujitsu)" <enju.kohei@fujitsu.com>,
"'linux-arm-kernel@lists.infradead.org'"
<linux-arm-kernel@lists.infradead.org>,
"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
"'linux-doc@vger.kernel.org'" <linux-doc@vger.kernel.org>,
"'linux-perf-users@vger.kernel.org'"
<linux-perf-users@vger.kernel.org>,
"'kvmarm@lists.linux.dev'" <kvmarm@lists.linux.dev>
Subject: Re: [PATCH v2 3/4] perf: arm_pmu: Add workaround for FUJITSU-MONAKA Erratum E#030002
Date: Fri, 16 Oct 2026 14:27:14 +0100 [thread overview]
Message-ID: <atImMmlBmOYlY5T2@J2N7QTR9R3.cambridge.arm.com> (raw)
In-Reply-To: <OSCPR01MB1573944ED57DC682897594F06E59B2@OSCPR01MB15739.jpnprd01.prod.outlook.com>
On Fri, Oct 16, 2026 at 01:00:13PM +0000, Tomohiro Misono (Fujitsu) wrote:
> > Subject: Re: [PATCH v2 3/4] perf: arm_pmu: Add workaround for FUJITSU-MONAKA Erratum E#030002
> >
> > On Fri, Oct 16, 2026 at 07:00:47PM +0900, Tomohiro Misono wrote:
> > > FUJITSU-MONAKA Erratum E#030002 affects FUJITSU-MONAKA CPU.
> > >
> > > On affected FUJITSU-MONAKA CPUs, after a PMU event counter is
> > > stopped at a value just before overflow, an overflow might still
> > > be incorrectly detected, resulting interrupt storm in some case.
> > >
> > > For example, if the following conditions are met:
> > > 1) Running perf to count an event in user space only
> > > 2) The event can also occur in kernel space
> > > 3) The counter value is set just before the overflow
> > > (when using the -F option, initial counter value is -1)
> > >
> > > when the kernel is about to return to user space after enabling
> > > the count, an overflow interrupt is incorrectly triggered by an
> > > event that occurred in kernel space. Since the counter value is
> > > not updated (correctly), the interrupt handler does nothing and
> > > returns with the same condition. This leads to another wrong interrupt
> > > and results in an interrupt storm and eventually a softlockup.
> >
> > I don't fully understand this.
> >
> > Surely the relevant PMOVS{CLR,SET}[n] bit set as if the counter n
> > overflowed?
> >
> > If that bit is set, the handler will certainly do *something*.
> >
> > If that bit is not set, the interrupt shouldn't be asserted at all. When
> > does it get de-asserted?
>
> Sorry, my explanation wasn't clear. The interrupt will be de-asserted
> as usual.
I'm trying to work out which of the following happens due to the
erratum:
(a) When the erratum occurs, the HW sets a bit in PMOVS*. An overflow
interrupt is asserted because PMOVS* is non-zero. The overflow
handler will see that bit was set in PMOVS*. Clearing PMOVS*
de-asserts the interrupt as usual.
(b) When the erratum occurs, the HW does not set a bit in PMOVS*, and
asserts an overflow interrupt even if PMOVS* is clear. The overflow
handler might not see a bit set in PMOVS*.
(c) Something else.
Can you pleaes confirm what HW does with PMOVS* when the erratum occurs?
I assume (a), but you haven't explicitly stated that so far.
> The problem is that armpmu_event_set_period() will not update the counter
> value if, for example, the counter is -1. Therefore, false overflow detection will continue.
> With this patch, armpmu_event_set_period() will force the counter to -6 so that
> false overflow detection won't occur in the kernel, since the maximum event
> count at a time is 5.
I expected that were this to occur a number of times in quick
succession, the core perf code would throttle the event, and adjust the
period.
I am presumably missing some detail that prevents that.
I assume you've seen the issue in practice? i.e. you've actucally
triggered this with the perf tool on real hardware?
Mark.
next prev parent reply other threads:[~2026-10-16 13:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 10:00 [PATCH v2 0/4] arm64: Add workarounds for FUJITSU-MONAKA CPU Tomohiro Misono
2026-10-16 10:00 ` [PATCH v2 1/4] arm64: cputype: Add FUJITSU MONAKA definition Tomohiro Misono
2026-10-16 11:51 ` Mark Rutland
2026-10-16 10:00 ` [PATCH v2 2/4] arm64: tlb: Add tlbi workaround for FUJITSU-MONAKA Erratum E#030001 Tomohiro Misono
2026-10-16 11:50 ` Mark Rutland
2026-10-16 12:35 ` Marc Zyngier
2026-10-16 10:00 ` [PATCH v2 3/4] perf: arm_pmu: Add workaround for FUJITSU-MONAKA Erratum E#030002 Tomohiro Misono
2026-10-16 12:08 ` Mark Rutland
2026-10-16 13:00 ` Tomohiro Misono (Fujitsu)
2026-10-16 13:27 ` Mark Rutland [this message]
2026-10-16 10:00 ` [PATCH v2 4/4] irqchip/gicv3: Add workaround for FUJITSU-MONAKA erratum E#030003 Tomohiro Misono
2026-10-17 11:48 ` kernel test robot
2026-10-17 12:27 ` Marc Zyngier
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=atImMmlBmOYlY5T2@J2N7QTR9R3.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=enju.kohei@fujitsu.com \
--cc=fuad.tabba@linux.dev \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--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=maz@kernel.org \
--cc=misono.tomohiro@fujitsu.com \
--cc=oupton@kernel.org \
--cc=radu@rendec.net \
--cc=rdunlap@infradead.org \
--cc=seiden@linux.ibm.com \
--cc=skhan@linuxfoundation.org \
--cc=suzuki.poulose@arm.com \
--cc=tglx@kernel.org \
--cc=will@kernel.org \
--cc=yuzenghui@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
all inboxes | Powered by JetHome®