From: Oliver Upton <oliver.upton@linux.dev>
To: Zenghui Yu <yuzenghui@huawei.com>
Cc: Marc Zyngier <maz@kernel.org>,
kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, james.morse@arm.com,
suzuki.poulose@arm.com, wanghaibin.wang@huawei.com
Subject: Re: [PATCH] KVM: arm64: vgic-debug: Don't put unmarked LPIs
Date: Mon, 19 Aug 2024 09:26:49 -0700 [thread overview]
Message-ID: <ZsNySeySMxxcpUTS@linux.dev> (raw)
In-Reply-To: <99900ad4-6b05-4bba-ec7a-f4f4d36ab71b@huawei.com>
On Sat, Aug 17, 2024 at 06:31:45PM +0800, Zenghui Yu wrote:
> On 2024/8/17 18:25, Marc Zyngier wrote:
> > On Sat, 17 Aug 2024 11:15:41 +0100,
> > Zenghui Yu <yuzenghui@huawei.com> wrote:
> > >
> > > If there were LPIs being mapped behind our back (i.e., between .start() and
> > > .stop()), we would put them at iter_unmark_lpis() without checking if they
> > > were actually *marked*, which is obviously not good.
> > >
> > > Switch to use the xa_for_each_marked() iterator to fix it.
Urgh, that's what I'd meant to do. Thanks for catching this Zenghui.
> > > Fixes: 85d3ccc8b75b ("KVM: arm64: vgic-debug: Use an xarray mark for debug iterator")
> > > Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
> > > ---
> > > arch/arm64/kvm/vgic/vgic-debug.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c
> > > index bc74d06398ef..e1397ab2072a 100644
> > > --- a/arch/arm64/kvm/vgic/vgic-debug.c
> > > +++ b/arch/arm64/kvm/vgic/vgic-debug.c
> > > @@ -85,7 +85,7 @@ static void iter_unmark_lpis(struct kvm *kvm)
> > > struct vgic_irq *irq;
> > > unsigned long intid;
> > >
> > > - xa_for_each(&dist->lpi_xa, intid, irq) {
> > > + xa_for_each_marked(&dist->lpi_xa, intid, irq, LPI_XA_MARK_DEBUG_ITER) {
> > > xa_clear_mark(&dist->lpi_xa, intid, LPI_XA_MARK_DEBUG_ITER);
> > > vgic_put_irq(kvm, irq);
> > > }
> >
> > Ouch. Nicely caught. I think this deserves a
> >
> > Cc: stable@vger.kernel.org # v6.10
>
> Yup. I guess Oliver will help to add it when applying ;-)
Indeed, I'll grab it here in a moment.
> >
> > With that,
> >
> > Reviewed-by: Marc Zyngier <maz@kernel.org>
>
Thanks both!
--
Best,
Oliver
next prev parent reply other threads:[~2024-08-19 16:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-17 10:15 [PATCH] KVM: arm64: vgic-debug: Don't put unmarked LPIs Zenghui Yu
2024-08-17 10:25 ` Marc Zyngier
2024-08-17 10:31 ` Zenghui Yu
2024-08-19 16:26 ` Oliver Upton [this message]
2024-08-19 17:25 ` Oliver Upton
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=ZsNySeySMxxcpUTS@linux.dev \
--to=oliver.upton@linux.dev \
--cc=james.morse@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=wanghaibin.wang@huawei.com \
--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;
as well as URLs for NNTP newsgroup(s).