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 0775347D458; Tue, 18 Aug 2026 16:39:00 +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=1787071142; cv=none; b=sSu79oxTcoVMzX0Havfd3/RU2ANon17LviKXFtnYWgN7fpSSipAdOZG9CRvnE0NH8Af6JCW9bjZSQmpkSvwbA3cxAqsJWLB2zLq4U5mH4TxgaFNP84CXzxk7KrtXEQNbpt4js2f3H4nN5k3arBJKGfmloGpmpQkRQKoWF6XUds0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787071142; c=relaxed/simple; bh=2j8nQBa5xH+2m8seNPtH0y4nI8R/1+Ozw/mrb5mKBGc=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=Oe8+C/1zSAkkCOZligE/juzSjhlKKDGLENM9GnBJDY38fogcLsJU6FjqpleZeFxGMlnUbGVn/LzfL8p74Wqy3GYo2LNnmclxAOvrT9iKC6Xm1LCq/Jldp+ous5agnRR/OxsUN9pjhfLfi1dBAzdrGxst+YOrc76lOZE579iOoLI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N8ExKLho; 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="N8ExKLho" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 041D81F000E9; Tue, 18 Aug 2026 16:39:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787071140; bh=9aY7pWsW2ln4Sq/7zBgi/YnBHwhhaIP7hD5DnJyV+7Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=N8ExKLho+mq9M01Q606g8A7kw043Icah1lXdLeJug9+XeGJbb9uPhl353mpoYLn6D 0n5JqjQaMs1GedUKrITaN/0oEJiy7XauEoZe9PP/VSN46EdfgzKwo+kKVTKSvSLrIo owvzdXZb6JapHsSbxiYEb+X1nNhYi/3cC+y0fF4Cr2BzQ03Pc8X+ji+rthvN7N+whD b7TL94nT20hIxAzqlZQg8ZwKT/QVYCvSvyogQg5Wky3t3bHvlMlsRsB7gEL23o9nAR cjzBHK8Pg9hhb3/dPlrIJ2YUOAt/c8ElXMVLmCCUFwxmi8NanIRs0PJnHIBwT7vFSo /EvrF9jGQr+3Q== 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 1wwMq1-0000000Ghog-3A91; Tue, 18 Aug 2026 16:38:57 +0000 Date: Tue, 18 Aug 2026 17:38:57 +0100 Message-ID: <865x175qou.wl-maz@kernel.org> From: Marc Zyngier To: Karl Mehltretter Cc: Oliver Upton , kvmarm@lists.linux.dev, Fuad Tabba , Joey Gouly , Steffen Eiden , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Paolo Bonzini , Shuah Khan , Eric Auger , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [RFC PATCH 1/2] KVM: arm64: vgic-v3: Roll back failed redistributor region setup In-Reply-To: References: <4e00fc25aa61ec52e6ef033a53588ce3f5550982.1786344511.git.kmehltretter@gmail.com> <86tsp2139b.wl-maz@kernel.org> <86jypv1lxo.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: 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: kmehltretter@gmail.com, oupton@kernel.org, kvmarm@lists.linux.dev, fuad.tabba@linux.dev, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, pbonzini@redhat.com, shuah@kernel.org, eric.auger@redhat.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@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 Thu, 13 Aug 2026 06:57:48 +0100, Karl Mehltretter wrote: > > On Wed, Aug 12, 2026 at 02:57:07PM +0100, Marc Zyngier wrote: > > On Mon, 10 Aug 2026 22:22:37 +0100, > > Karl Mehltretter wrote: > > > Is this closer to what you had in mind? > > > > No. I want *all* RDs to be gone on failure, and the next successful > > registration to result in all possible RDs to be matched against a > > vcpu if there are enough of them. Effectively an atomic behaviour from > > the PoV of userspace. > > > > See the patch below for what I came up with. > > > > Understood. I believe your sketch needs two small adjustments: > > free_index must be incremented before kvm_io_bus_register_dev(). > If registration fails, the current vCPU already has an RD assignment, but > there is otherwise no increment for the teardown path to undo. This probably is a separate patch. I don't think it has anything to do with the issue at hand. > > The garbage collection in vgic_v3_free_redist_region() should remain. > VM teardown frees the regions before unregistering the RD iodevs, so > removing it would leave rdreg pointers referring to freed regions. Why is this more than just an ordering change? Probably also a separate patch. > Does that look OK to you? If so, I could include both in v2. > I'll also split the selftest change and have it check only the > final state after the retry. Sure. Thanks, M. -- Without deviation from the norm, progress is not possible.