From: Marc Zyngier <maz@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: "D Scott Phillips" <scott@os.amperecomputing.com>,
"Oliver Upton" <oupton@kernel.org>,
kvmarm@lists.linux.dev
Subject: Re: [PATCH] arm64: errata: Mitigate AmpereOne erratum AC03_CPU_57 and AC04_CPU_29
Date: Sat, 11 Jul 2026 23:27:04 +0100 [thread overview]
Message-ID: <87jyr15fif.wl-maz@kernel.org> (raw)
In-Reply-To: <20260710223718.2C85B1F000E9@smtp.kernel.org>
On Fri, 10 Jul 2026 23:37:17 +0100,
sashiko-bot@kernel.org wrote:
[...]
> [Severity: High]
> This isn't a bug introduced by this patch, but does dropping irq->irq_lock
> between computing the LR snapshot and folding it create a race condition that
> loses concurrent virtual interrupts?
>
> vgic_v3_deactivate() takes the lock, computes the snapshot, and then the
> scoped_guard ends:
>
> scoped_guard(raw_spinlock, &irq->irq_lock) {
> ...
> lr = vgic_v3_compute_lr(vcpu, irq) & ~ICH_LR_ACTIVE_BIT;
> }
>
> If a concurrent device injects an interrupt here via vgic_inject_irq() and
> sets irq->pending_latch = true, won't the subsequent call to
> vgic_v3_fold_lr(vcpu, lr) re-acquire the lock and evaluate the stale snapshot?
>
> vgic_v3_fold_lr() would see !(val & ICH_LR_STATE) is true and execute:
>
> if (irq->config == VGIC_CONFIG_LEVEL && !(val & ICH_LR_STATE))
> irq->pending_latch = false;
>
> Could this wipe out the newly arrived interrupt and cause guest devices to
> stall?
Having thought about it (yes, this is what the NSJ is for), my
conclusion is that this report is utter bollocks.
The clearing of the latch obviously only applies to level interrupts,
which can only be set by SW. The convention is that the Ack of a level
interrupt consumes the latched signal (SW can't distinguish it from a
device interrupt anyway).
A *device* interrupt sets irq->line_level, and can only be dropped by
the device itself, not by anything happening in the LR.
My conclusion is that Sashiko doesn't understand the GIC interrupt
life cycle, and is deeply confused by it. I'm shocked.
M.
--
Jazz isn't dead. It just smells funny.
next prev parent reply other threads:[~2026-07-11 22:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 22:21 [PATCH] arm64: errata: Mitigate AmpereOne erratum AC03_CPU_57 and AC04_CPU_29 D Scott Phillips
2026-07-10 22:37 ` sashiko-bot
2026-07-11 7:53 ` Marc Zyngier
2026-07-11 22:27 ` Marc Zyngier [this message]
2026-07-11 7:37 ` 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=87jyr15fif.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=oupton@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=scott@os.amperecomputing.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 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.