From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92F3D1CB329; Wed, 7 Aug 2024 10:01:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723024880; cv=none; b=lp76ot00Rm1z7QYqmG0CnJMga62iokbHbC7ysycm7bKQwT/cCTdvXemk6XeHmJScVg6BVrsT89WAm+VVPZ9BFOeCco82TGjBCkzIRwiwN4A8pkY0ekkB+4tO0i+uHpH8giRVFKi5RiBYojW8Xm7ZuLBRbofBNNJ8mpvScbMbt9M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723024880; c=relaxed/simple; bh=xGr64x9tfLljreKfD3h0qgfAiL3X9DZ+KZ5mlTg+1Rw=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=P0jilXoc104oilq4QlmY3UoCCOHCw2A7j3KUyccLazu7XsfjCrfbItOzNc0hd181xuTZltQhnW9bG+RAy7KoOrl3ggDnD+J7hjTACJDO0AJ0vgTpEioimpyWSC6zAfpU8g/CoNFLTdGrMnUDtEQOsjMuPt/Imx5JiUa1lwpZhHg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jmByfb5s; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jmByfb5s" 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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.