From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B685EC3DA4A for ; Mon, 19 Aug 2024 16:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AsK28yHmfsApUch3ci6Pzhi4GLlWPP29RXZc1Ds3IyI=; b=qVJQj0iQieiHRR26lJuCYIoZiP ZeHKQHZHt5N/l6sIhUZ0fspWhEPkuB56JT5bQWws0qtuF9xAFCWW3xPVGl3VoeIOHzZAa90pOx4Qt vDWPOUxkFBxJRE+AS816d5UzNkoH/hp+wrHK3Kita7hE7mfreFW69Z0rZLjO6ahGvvLvHYnnwJ+yo fm7l6q2QLekzjtuVSOtpbbjZr+owwrDFxxLXSJQrwJxXgs8HYyGNxYdksjcdDNVEedDbpPIHrEz3o 8J1O0u4tGrDCwcsMWZk+A+5aOBasS3Sd0mmxyzPwLduulo1wHpYlBdakM1tdrNeP9gTqr8paldQtU JZkTzoBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg5Fp-00000002AaK-3iyn; Mon, 19 Aug 2024 16:29:13 +0000 Received: from out-171.mta0.migadu.com ([91.218.175.171]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg5Df-000000029kT-3sKS for linux-arm-kernel@lists.infradead.org; Mon, 19 Aug 2024 16:27:01 +0000 Date: Mon, 19 Aug 2024 09:26:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1724084815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AsK28yHmfsApUch3ci6Pzhi4GLlWPP29RXZc1Ds3IyI=; b=DA0zKqhFxpybDfL5Z45D02TvTiKVCUI402G2mvw/UFkpdus/5RUA3xXm49eeD6u5hgTB5T fSKKMN+3XF8UjAKwuHlhVUX5VebqC9G4N7SxgHzVuJ74sZuSyaEekMpS47+mbwp8KlUd7k cGZhnieInUL6orETKfgOhJKVPMHVqzc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Zenghui Yu Cc: Marc Zyngier , 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 Message-ID: References: <20240817101541.1664-1-yuzenghui@huawei.com> <86a5hbzbrt.wl-maz@kernel.org> <99900ad4-6b05-4bba-ec7a-f4f4d36ab71b@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <99900ad4-6b05-4bba-ec7a-f4f4d36ab71b@huawei.com> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240819_092700_257610_99E60298 X-CRM114-Status: GOOD ( 21.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 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 > > > --- > > > 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 > Thanks both! -- Best, Oliver