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 D6A0FC3DA7F for ; Wed, 7 Aug 2024 10:02:12 +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:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID: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=N5SDEc7UJotBv5AXtn8aRxOz63s/69WznqCpd05ssO8=; b=l0Q+Y4JmkiSZVBw/j/fQkCOf7h oyae4rItBi9sCZJ0o8TzXifGws6xhd3sipVaDJ5C3DSeojVSUm0PeIDZfkR2JYIbWPpyByAM+beCx WuIKr/xiPW+Z1U+fduwVYV7XOzNIO5EmwmqSbKkYuciAXCoOztYrSZ0PB4Mf7rXt4kjSZGyRFiByc lImolb4h+lEqRpoioEVSalrPl64V6GbpUgjh1QaCKHgW0oxQzadm2cjbbewk/+7xUV5looyLDqKRV cuOIyj0977cQxEsQ3gv6Xy+hIiyzuPBmj6vmieDODbW59v57PmkQofyJm3sKHmDO0frD4WWVJlMEP pfJhgtJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbdUS-00000004db9-1Zp8; Wed, 07 Aug 2024 10:01:56 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbdTu-00000004dWY-3nVC for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2024 10:01:24 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C7CA0CE0AB6; Wed, 7 Aug 2024 10:01:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 146BFC32782; Wed, 7 Aug 2024 10:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723024880; bh=xGr64x9tfLljreKfD3h0qgfAiL3X9DZ+KZ5mlTg+1Rw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jmByfb5sWsfEMjny2ZneAvtFE7rHOWY6i2sV44/Fdh48YcCj6HNznr77TaOus3jYq mg1fZ9wtD0vsXiVDDnJv0rpGdyDmd6HtpEIoP0mkwGXTL7NEcBZBF+JQ+0flXDJdIx cUzMaQgf95GnOClFitOZYzmkLVAlGNblhub/TrTrYyx69DJYhJ7G85VrzHW6UALfYz s/ADX7LTSfj5BuG2NvNlAqCwo2MpkBwr8zes0U7M5VGqlP3Ks14xZDY8v39OcYIOZu 7Mjalp079PD3+/+74/6oJKmDqKxQoyTlwrJMBaf1trGq8bf3dkhWCf02EPUDPTk2HW uKarQs2fqatlw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sbdTp-001fRh-Rk; Wed, 07 Aug 2024 11:01:17 +0100 Date: Wed, 07 Aug 2024 11:01:17 +0100 Message-ID: <86cymk3b4i.wl-maz@kernel.org> From: Marc Zyngier To: Zenghui Yu Cc: , , , , , , Subject: Re: [PATCH] KVM: arm64: vgic-debug: Exit the iterator properly w/o LPI In-Reply-To: <20240807052024.2084-1-yuzenghui@huawei.com> References: <20240807052024.2084-1-yuzenghui@huawei.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.3 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: yuzenghui@huawei.com, 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 X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240807_030123_141744_2372D0C2 X-CRM114-Status: GOOD ( 18.81 ) 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 Wed, 07 Aug 2024 06:20:24 +0100, Zenghui Yu wrote: > > In case the guest doesn't have any LPI, we previously relied on the > iterator setting > > 'intid = nr_spis + VGIC_NR_PRIVATE_IRQS' && 'lpi_idx = 1' > > to exit the iterator. But it was broken with commit 85d3ccc8b75b ("KVM: > arm64: vgic-debug: Use an xarray mark for debug iterator") -- the intid > remains at 'nr_spis + VGIC_NR_PRIVATE_IRQS - 1', and we end up endlessly > printing the last SPI's state. > > Consider that it's meaningless to search the LPI xarray and populate > lpi_idx when there is no LPI, let's just skip the process for that case. > > The result is that > > * If there's no LPI, we focus on the intid and exit the iterator when it > runs out of the valid SPI range. > * Otherwise we keep the current logic and let the xarray drive the > iterator. > > Fixes: 85d3ccc8b75b ("KVM: arm64: vgic-debug: Use an xarray mark for debug iterator") > Signed-off-by: Zenghui Yu Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.