From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 BA2D34EA37B; Tue, 13 Oct 2026 11:16:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791890173; cv=none; b=TPgv7VQoDXu6o2z2pJXvTTr06ekv14/apuiKlWkcZZmVW2ZzYKySRmcVDiw/MbLdITUHb82SqSKkoaVVmSR4587vm8UKBBRrzvx548qNoCIyC1YGpOr/t0KaGUcHZhU+K93Fh5d65aqkG7fn7o0lyRjXbdDBlAkbnmNypgW39Fo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791890173; c=relaxed/simple; bh=Nh2S46mF39E1MI11GQxHRN4q+cch/BXqPz79oz31IFc=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=jsG4uSyZzAcUZx7Rz2sJtV54/3UG9vfi3VjfP2jPCn1ATmBpGmWTtGPnH4Sm41GdzhQwUmFB1rnBnz2T4dib2xCl4v7r6fFg0VrE1ZDCcf2cSjvnjrMBnXS2sHmgaiz3vHt7m8sFQnmCKjWl9ZMRWG03Q+BGB0NBIivjrJFgMAY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V1uIN3ay; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="V1uIN3ay" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45EFE1F000FF; Tue, 13 Oct 2026 11:16:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791890172; bh=k0zH0Wnlh/sO6ZQbr+1OS83JkdmxfQFaqrYbJIXwek0=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=V1uIN3ayhOIYE1p9Qg95iKfyIODI2N3VGPlSnAjihXP1edyiVdww2p4n/LmCPoACD Kg+IRNwuy7PogVLswRSIHLmP++sV5vEmijTIYulBJ4oiOCPFV/cBg7LCzNk1QaZ615 E7EBOu/ZPpGOG2eYCxMIH3sOYXSyhU9Egwwut3ZOLZooI7jRzReaywth3YT1oewH25 9vzRzWpjRFfvUiA6L7MnKdNqSC1X36Dw12SFxF4X6tz7NKtQCBE+/aiQHW8vdwdAZE 9pRS0pnX88hjYCfRvEU/rCRYna2j9U3a94QjiXWqnNnzj2Mqn2gkwYUDzFo8IXqPu5 vI+jN2wDm+ruQ== 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 1xGaUL-00000002KbM-3wmH; Tue, 13 Oct 2026 11:16:10 +0000 Date: Tue, 13 Oct 2026 12:16:09 +0100 Message-ID: <86v77526me.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 , Andre Przywara , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/2] KVM: arm64: vgic-its: Fix LPI double mapping and DISCARD In-Reply-To: References: <20261013081646.933312-1-fuad.tabba@linux.dev> <86wlrl2a2f.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) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev 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: 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, andre.przywara@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 On Tue, 13 Oct 2026 11:50:09 +0100, Fuad Tabba wrote: > > Hi Marc, > > On Tue, 13 Oct 2026 11:01:44 +0100, Marc Zyngier wrote: > [...] > > Yeah, I now have a series that has the counting pause, your single > > vcpu pause (fixed to DTRT), and the LPI disabling fix. Patch #2 of > > this series can probably make use of the single-vcpu stunning. > > I'll rebase the series on that once it's out, with patch 2 using the > single-vcpu stunning. > > > As for the OUTSIDE_GUEST discussion, I've had a long discussion with > > Will where we reversed engineered the synchronisation requirements, > > and concluded that there was nothing to fix on that front (the logic > > is incredibly subtle and counter-intuitive, but overall sound). This > > patch is therefore dropped. > > The first [High] issue Sashiko found on patch 2 [1] holds for DISCARD, > because the fold writes back the pending_latch that DISCARD clears. > With a 2ms delay after the exit to widen the window, and the DISCARD > sent at a varying time, the guest in my DISCARD reproducer takes the > discarded LPI in 13 of 20 runs on v2. > > A vCPU on its way into the guest does the same: it loads its LRs in > kvm_vgic_flush_hwstate() while it's still OUTSIDE_GUEST_MODE, so > kvm_arm_halt_guest() doesn't wait for it. With the delay after the > flush instead, on v2 plus your 1/7 and 2/7 [2] and both changes from > your reply to 1/7 [3], the guest takes it in 9 of 20 runs. Does this mean we still need OUTSIDE_GUEST_MODE to be a store-release past the point where we resync the state? > Once DISCARD waits for irq->on_lr to clear before clearing > pending_latch, the guest takes it in none of 20 runs in either case. > I'll add that to v3, unless the single-vcpu stunning already waits for > it. Polling for on_lr feels very dodgy, and I'd like to avoid this. If the OUTSIDE_GUEST release addresses it, I'd rather do that. Thanks, M. -- Without deviation from the norm, progress is not possible.