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 87D02CCFA1E for ; Wed, 12 Nov 2025 08:34:07 +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=CDSdYmkj0+ryjFEqIIpAJYeLYQdfS//sbY9Pkge/Mr4=; b=zRHCodiuVxfCSgmDGEPStuwzs+ VSsIViTkEJDcT6hBYcmAl13lag0IJWCcWGcP+i+L885mCCZ7U2322LbCe7sRlFJbca6+cq+zLKOkI ML8829j/oy3xBWdhuBV1yRjQGGYcSR0OcgkSmX9Lg/+klar8WDvTaiUDWUPOjjmvQEDC6IEojCXLx bzkWtGPZn63HG3gZypznFIW6GLeHDk822Dcf+Q1h13zzCycysjpoarstqug0AGiuSSZIpUDWWVOY0 HI7FWqwWd4E6jDyYrS6EJunam5r80/bd2aCdEEOSAqzWLDr943sLdWEPsqaqE2DrYZ4WeJxbPabG/ 5y2NX+Yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vJ6Ij-00000008MgP-0Tw0; Wed, 12 Nov 2025 08:34:01 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vJ6If-00000008MfZ-3pcm for linux-arm-kernel@lists.infradead.org; Wed, 12 Nov 2025 08:33:59 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 46E3A40B62; Wed, 12 Nov 2025 08:33:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23938C116B1; Wed, 12 Nov 2025 08:33:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762936437; bh=81f0ESLSrnetgKGzemcxP8SfAbjzKr+GfwSLMaWOTFw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Qr7kV1C7PkAAiV0WEdvnFAjNELGLD9nOqg1HaEzXLXtHkYdeBiKlVu5/nz0F8WvDs ATYkqKkjN/63MXvgCFzwpl7EGVe/X0jBZvmE613OI2ZwWBPdJzp2egaPpHcJFZ5u5q uv/VPbmPGRueN//p9s1KpM7TRPjoLmKpB/mh0rc9ncnsXD9JPxxPEJApOShu5upu3x CicYGiDKmCLVwOzS+5NPs6p+ZWC32uAlXhVQCohBnYdlHSVuHiiD32LYoE/usiE0Ks zdaq9TqJIm8Sulxc5+wNiwDr1Ual/8n1zc69LEeU2Zv3SM74XQ9S4Xok+8P/Y17ptk Aqm54UmE05bKQ== 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.98.2) (envelope-from ) id 1vJ6Ic-00000004Su3-2m1u; Wed, 12 Nov 2025 08:33:54 +0000 Date: Wed, 12 Nov 2025 08:33:54 +0000 Message-ID: <86y0obtzt9.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Joey Gouly , Suzuki K Poulose , Zenghui Yu , Christoffer Dall , Volodymyr Babchuk , Yao Yuan Subject: Re: [PATCH v2 20/45] KVM: arm64: Revamp vgic maintenance interrupt configuration In-Reply-To: References: <20251109171619.1507205-1-maz@kernel.org> <20251109171619.1507205-21-maz@kernel.org> 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/30.1 (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: oupton@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, christoffer.dall@arm.com, Volodymyr_Babchuk@epam.com, yaoyuan@linux.alibaba.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-20251112_003358_013864_7C3C8445 X-CRM114-Status: GOOD ( 17.87 ) 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, 12 Nov 2025 00:08:37 +0000, Oliver Upton wrote: > > On Sun, Nov 09, 2025 at 05:15:54PM +0000, Marc Zyngier wrote: > > +static void summarize_ap_list(struct kvm_vcpu *vcpu, > > + struct ap_list_summary *als) > > { > > struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu; > > struct vgic_irq *irq; > > - int count = 0; > > - > > - *multi_sgi = false; > > > > lockdep_assert_held(&vgic_cpu->ap_list_lock); > > > > - list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) { > > - int w; > > + *als = (typeof(*als)){}; > > > > - raw_spin_lock(&irq->irq_lock); > > - /* GICv2 SGIs can count for more than one... */ > > - w = vgic_irq_get_lr_count(irq); > > - raw_spin_unlock(&irq->irq_lock); > > + list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) { > > + scoped_guard(raw_spinlock, &irq->irq_lock) { > > + if (vgic_target_oracle(irq) != vcpu) > > + continue; > > From our conversation about this sort of thing a few weeks ago, wont > this 'continue' interact pooly with the for loop that scoped_guard() > expands to? Gahhh... I was sure I had killed that everywhere, but obviously failed to. I wish there was a coccinelle script to detect this sort of broken constructs (where are the script kiddies when you really need them?). Thanks for spotting it! > Consistent with the other checks against the destination oracle you'll > probably want a branch hint too. Yup, I'll add that. Thanks again, M. -- Without deviation from the norm, progress is not possible.