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 CB877377010; Sun, 20 Sep 2026 23:51:51 +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=1789948312; cv=none; b=XY3fJWRP+V+k6fH5LosmcBranYBhz4wWCbvtRjr96aSkZ8+OplWLMtncJ4hwjJcfFLUrjLnCIf6d6WzKGJanXlDYbWOQmXQQ6ZZWyCigJNYfx6Yzh7uYP10wnu3V8VuuTEeEYbtlxTqij3rifIy2rM6IQsJLiHVRlSiUF31Iovw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789948312; c=relaxed/simple; bh=U5m7WADaRLL8j4XyHtWlFJb/IzUnoMGq7dmQW6a6KpQ=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=Ew9Mhg+f7BPOFAlH4gxFkOGaD9oW8n3Pk7Yl+qFZEOfgl87j/KiBSTFSM/ahx4WjK2PQPZqarANGasgrylw1jjWFAepBpHeJtEwbFOHurpMS6RcvaqfQGnqp2COehGDaFaeQXxpYiz1mEwYC0RzlVC7H3c3u5BeYA8+KKZU6K2A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oH4PGHC7; 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="oH4PGHC7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50B1A1F000FF; Sun, 20 Sep 2026 23:51:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789948311; bh=n69+NQuL0MBxH8A3qlY0/AgvLV3+f1D8QUKm2WY4ZWI=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=oH4PGHC7Axy/Amkc3VJw6ozl7LfldOKz0UpByM3IxPHU7qL8yngrsdYxQzs9eGLTW C4sn78GXQp/fyHcdD+bDrxfPf7T2K+QDKtaaWH2cSzndRSH3VxWVgPBuSydUJrLB7R EGhSuoyKjzlwGWooX1oU3HhsTUGEQBbq9hu2gFOmUIfZlKCAYPYlQCGpaV7wqEVUF1 yMOzXd1c/KQHw8gGicCACzqNmsZhS9/QJirj18ScOL9NFYan29trdzttHAj5Gzkjw3 bpGAoTvlRa6fAITu/GAsuUlv1D53qUFZCSLR5UQNj9JNMY2XPSxoTTWtPuqmTM9bJ+ RM1Yx1mPiZ5Mw== Received: from sofa.misterjones.org ([185.219.108.64] helo=lobster-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 1x8RK0-0000000BJ26-4AzT; Sun, 20 Sep 2026 23:51:49 +0000 Date: Mon, 21 Sep 2026 00:54:52 +0100 Message-ID: <87a4pb4gxf.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: Fuad Tabba , Yuchao Zhang , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] KVM: arm64: vgic: Do not remove in-flight LPIs from AP list on disable In-Reply-To: References: <20260918040214.85580-1-ndaugoing@gmail.com> <20260918040214.85580-2-ndaugoing@gmail.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/30.1 (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: oupton@kernel.org, fuad.tabba@linux.dev, ndaugoing@gmail.com, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@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 Fri, 18 Sep 2026 20:15:56 +0100, Oliver Upton wrote: > > On Fri, Sep 18, 2026 at 12:58:17PM +0100, Fuad Tabba wrote: > > Hi Yuchao, > > > > On Fri, 18 Sept 2026 at 12:51, Yuchao Zhang wrote: > > > > > > Hi Fuad, > > > > > > Thanks a lot for pointing me to that thread! I was not aware of > > > Hyunwoo's earlier report and the discussion with Oliver and Marc. > > > > > > I'll read through the thread and their rationale on the ap_list_lock > > > approach. I'm happy to defer to Hyunwoo's effort to avoid duplicate > > > work. > > > > I'm not sure you should defer to their effort. It doesn't seem like > > Hyunwoo has done any work on this for a while. I just wanted to point > > you to the existing discussion. > > Yuchao if you have cycles I would definitely appreciate it if you can > pursue a fix. My view hasn't changed since before: let's make that > traversal of the ap_list is done under the ap_list_lock, as this is not > intended to be walked lock-free. > > Taking a step back, the whole cross-vCPU LPI disabling always leaves me > feeling ill... Really when RWP=0 becomes visible from another vCPU we > need to guarantee that the LPIs have been actually retired, meaning we > can't have one sitting in an LR. Even with the locking fix I think we > miss this. > > Given how unlikely it is for well-behaved software to disable LPIs > remotely in the first place, I wonder if we should just halt the VM > similar to how we handle accesses to the active state. That's a really > big hammer but we've had a lot of bugs in this department and I'm > somewhat biased towards an obviously correct solution. Irrespective of the whole ap_list_lock issue, I think this is the only valid option. Messing with the ap_list of another vcpu while it is running can never result in something that actually works. There's a hack doing that in my tree. > We wouldn't need to do this for a vCPU disabling LPIs on its own > redistributor since we've already exited the guest. In general, we could stop the target vcpu only. But this is making things more complex, and I quite like the idea of a large hammer... ;-) M. -- Jazz isn't dead. It just smells funny.