From: Marc Zyngier <maz@kernel.org>
To: Zenghui Yu <yuzenghui@huawei.com>
Cc: <kvmarm@lists.linux.dev>, <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <oliver.upton@linux.dev>,
<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: Sat, 17 Aug 2024 11:25:42 +0100 [thread overview]
Message-ID: <86a5hbzbrt.wl-maz@kernel.org> (raw)
In-Reply-To: <20240817101541.1664-1-yuzenghui@huawei.com>
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.
>
> 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
With that,
Reviewed-by: Marc Zyngier <maz@kernel.org>
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2024-08-17 10:26 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 [this message]
2024-08-17 10:31 ` Zenghui Yu
2024-08-19 16:26 ` Oliver Upton
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=86a5hbzbrt.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=james.morse@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.upton@linux.dev \
--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).