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 B4FBCCA9EDE for ; Mon, 12 Oct 2026 18:12:34 +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=4uCUhIE6G5JFckb9nIlCjDzETQkPo/I1KxDu5i4hUVA=; b=rfgsc/CKJccQ7P3Z3OaM4wcnaP cNLUk5UkoOIidGPpbvzXjGc9JQX/ytC/ZRTbbPqyHMLkAs2kU4nraq76l9DSqx5Ad9gUEwhDPyf25 242TpA5Vip6piHiSZyEFrE4vuzVtiC9fGUBUyyORTLJCE4nF9jv83APFmUDF6M/GSO/EqmhG91BUf 7+tYnj1AJ+lGW11NtyJXHStPHQffwAxHpeKBiowbT2hiWoq7azSC56tjA4dmoVOgd/nNOrwLeAs2K 1i7y9Orkr57VYdajKnBD9PyJqq63lutugK9B4YDn1ojqKFSaZGeqyxYXTIfVNdz8UiMjPETDqG6CP kcAeZl5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xGKVd-0000000BBlI-3bkr; Mon, 12 Oct 2026 18:12:25 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xGKVc-0000000BBl4-2HOw for linux-arm-kernel@lists.infradead.org; Mon, 12 Oct 2026 18:12:24 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 0276F60142; Mon, 12 Oct 2026 18:12:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB9071F008A1; Mon, 12 Oct 2026 18:12:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791828743; bh=4uCUhIE6G5JFckb9nIlCjDzETQkPo/I1KxDu5i4hUVA=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=EUhNMnvHF8Z+yDS5LZ3fp/Ly/EsdPzAOdZ2tDgkj3G1zeq0FM0JwM1dc3wm5UtO17 gBprWlkC637unc6yqDzHeyYJejgjeJHBsgrro2ELXbxnGwaRfw0PGWqEiYeyBA2QUZ H1f+nZajSlbOm6hVlqbFkJT7FmonWcB3Da90+dakk+X6i5nxF3+lhEk5zwGqydLbaW Tux9BWWMstP70D4DCpZHL2pcPkIZZ/j/FgPw7TPIHHKDnEG/6Sle1TNxmXxd3I0RzO dulJt/IhqfCORnhCBk5FTs573kG6dtK3q/yT+EW1D40qZn/6sTgJEvdOUDja53co0l Rm04C/jT7pMpw== 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 1xGKVZ-000000021Pt-2am8; Mon, 12 Oct 2026 18:12:21 +0000 Date: Mon, 12 Oct 2026 19:12:21 +0100 Message-ID: <86zewi23ga.wl-maz@kernel.org> From: Marc Zyngier To: Fuad Tabba Cc: Oliver Upton , Joey Gouly , Steffen Eiden , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] KVM: arm64: vgic-v4: Don't forward an LPI with no target vCPU In-Reply-To: References: <20261012084743.2228612-1-fuad.tabba@linux.dev> <8633ub2mlg.wl-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: fuad.tabba@linux.dev, oupton@kernel.org, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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 Mon, 12 Oct 2026 15:13:51 +0100, Fuad Tabba wrote: > > Hi Marc, > > On Mon, 12 Oct 2026 12:18:51 +0100, Marc Zyngier wrote: > [...] > > Isn't the core problem that we don't correctly handle the UNPRED > > double mapping of the same LPI? I'd rather we attack the issue at the > > source instead of papering over the consequences. > > > > I hacked the following, which is obviously untested. Can you give it a > > go? > > With your diff on rc3, the second MAPTI is dropped, and forwarding the > vfio-pci MSI to its event leaves the host up. > > However, a vgic_irq outlives its ITE while the LPI is pending on a > vCPU, so the check also drops a legitimate remap: a guest that > DISCARDs a pending LPI and then maps it again loses the new mapping. But this is yet another bug: 5.3.4 is pretty clear that DISCARD should get rid of everything (pending bit and mapping). I reckon this is yet another case of the initial implementation being overly worried about kicking vcpus out of the guest when destructive action is required. We should fix this. Thanks, M. -- Without deviation from the norm, progress is not possible.