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 EB10339B978; Sat, 22 Aug 2026 08:02:32 +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=1787385754; cv=none; b=k4Em3jvF23lnp5unuhLSf+9BMxP8D5LFtMBwEPnKQh4EH0WDiIoLPYOAEwdpeBJ5nUKOUYg7eN1qephIgWUfHrBNk8RE+oOnd5pvVBRnr4hBBrl3NIAVEjny6vkypwEw0Ypere9MO09kS0JIFU0Av2xOI4H6dBgbVV+ClRnFXwk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787385754; c=relaxed/simple; bh=QnkWzxR5BDXY2RvfExDfzub0evwhS5jOdddGQL60Q1Q=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=VDee+BIdFW3UmURttKOV74ZNP7IGmZthaVivOnQ/gq0ts4hNzFMsbzmpoNTjon/fmeN0K3Ix4kJN8vDtyC9v8Rm8+H19Aj18XAIa9XnV5N4wwJYFKqTHzwgg+2EHZZncB9QAvBSlqkHxAhM5H8bXgbni7gkOwVsJPHmLnEPo/Ss= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UUa6eNWY; 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="UUa6eNWY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 859A81F000E9; Sat, 22 Aug 2026 08:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787385752; bh=TqtkQkyTl4mS7J4aXez7TT37PaSDo7fJmYQG5Touqio=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=UUa6eNWYSEbut5PHH26edBdMvSMZu/joqPiO+Ue81cleWKGByVzMqnbWVYaV3L3jB S/W7TS5tjinUyzRpOR2AOPUlGNe27baRi4yqYFwGlkgZtAqDQMyqPuJdRiGYQ8nEy8 WUX3CDSyhvn+3kpSGU/fb1Z6RH1tSDgPoBrNrYRA4l50kBSejiEL0QNSIFODL/yDbd 6abf8ay7m6k8bDqHIcFVwafATqQkHiOhSGOv5EUIkDIawcvl7c5Sy24qpAAkM8YRvH BoW5Uu7XiXq8S7n3Z8HxwHz6p+sFgxYDRWkTc0LIXWu+fOlBADiRV1zov5nfkkBeLw fj6jV8GdyvR9Q== 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 1wxggQ-00000000E2n-2bnS; Sat, 22 Aug 2026 08:02:30 +0000 Date: Sat, 22 Aug 2026 09:02:30 +0100 Message-ID: <86wlti4m7d.wl-maz@kernel.org> From: Marc Zyngier To: Fuad Tabba Cc: Oliver Upton , Eric Auger , Joey Gouly , Steffen Eiden , Suzuki K Poulose , Zenghui Yu , Will Deacon , Sascha Bischoff , Sebastian Ene , Fuad Tabba , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/4] KVM: arm64: vgic-its: Make the ITS table save reliable In-Reply-To: <20260821064445.615838-1-fuad.tabba@linux.dev> References: <20260821064445.615838-1-fuad.tabba@linux.dev> 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: fuad.tabba@linux.dev, oupton@kernel.org, eauger@redhat.com, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, will@kernel.org, sascha.bischoff@arm.com, sebastianene@google.com, tabba@google.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, 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 Fri, 21 Aug 2026 07:44:41 +0100, Fuad Tabba wrote: > > Hi folks, > > Changes since v1 [1]: > - Free the LPI translation cache in vgic_mmio_write_its_baser() too, > inside the its_lock section. (Eric) > - Reworded patch 1 to name the register the write is to. (Eric) > - Rebased onto kvmarm/next. > > Marc pointed out on the v2 ITS series [2] that patch 3 fixed the wrong > end of the problem: KVM should drop the collections when the guest > changes the table that described them, rather than validating them at > save time. He also called that patch's -EINVAL a mistake, since it > aborts a save userspace has to be able to issue. This series does both, > following his answers [3] to the two open questions: purge the whole > list, and skip the offending device rather than fail. > > vgic_mmio_write_its_baser() now frees the cached devices or collections > whenever the stored register value changes, not only when VALID is > cleared, and drops the translation cache with them. It tests for a > change rather than a write because the ITS driver rewrites an unchanged > GITS_BASER on resume. With that in place the check patch 3 added is > unreachable, so it is reverted, and vgic_its_save_device_tables() skips > a device the table can no longer address instead of failing the save. > > compute_next_devid_offset() now calls vgic_its_check_id(), which reads > guest memory for an indirect table, so the save does 2n reads rather > than n. It stays linear, as the scan stops at the first > reachable successor. Patch 1's Fixes: tag names a v4.15 commit, so it > will be picked up for stable. Drop the tag if that is not wanted. > > Patches 1 and 3 apply to v7.2 unchanged, but patch 2 reverts a commit > only in kvmarm/next, so the series is based there. > > Tested on QEMU: the new selftest, vgic_irq, vgic_lpi_stress and boots. > Both cases of the new selftest reset and restore the tables they saved, > and both fail without the series. > > Based on kvmarm/next (aa8e5dc6a7a2a). Reviewed-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.