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 A65D12010EE; Tue, 23 Jun 2026 17:02:43 +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=1782234164; cv=none; b=RPvU/zFgVHrQU4JZQvhkfRTU6opQEJMReXitrR2ItOvr0wQ/fyU/3pF7jrKi3FDxwfjngtniAB4V+HVvrkuCbdmlSbtVHS8s6HVImzKRlYwrJMOw/LNlDpAtuZUsvN7epJSG2lqutEeGGBUOffDKsGVt/q0NpESwmlHgA50lWS8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782234164; c=relaxed/simple; bh=SGv396dS0nN5GCTptkqyeLaoKITtlZ63YnUwVrJ6D5U=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=JAl3UjoUJEKFyS1kpwJfEfAo8oass3GD0LEouvWZChs5zlGcAmbvw2dfR4IFTQgYwe0ymarNeA8X4X8rhUIbsj7iiAyAnAVjktH4dr1XkP9HoFFylz8aDmgIRjff+4vmgqEkgByLZAP6gTrkO3Ed/qG1kUYNHDgx5IyJSG7MD3w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LlI9FAR3; 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="LlI9FAR3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E8201F000E9; Tue, 23 Jun 2026 17:02:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782234163; bh=aBU6pCnOCTlrKDDQo5rEGB3OdGcEdLqLcPo64Ew0+ZM=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=LlI9FAR3V2CgWMRUYHx/Pp9RazmkuGtTnZYI9Uvf8uIWjc4H9Wo+izN90npoglUMQ yQt6RhXDyYsdwpNlP6XSA4s/hzUYUZ6pbIix9ox+bYTbj4PhkFq8rNJyaBPzdBl1ky k00ceYbUFinHQ3/PJsMyWmjGF4jlqJcpAjCjnlpUqejzM3SgcnG5w+IcVc6EDcZfA/ zYwLkikMu+Urz8T5fVKecSXBDE9L9leseBpv74ZXGgEW3gQrleJQosDm1qb/3ba3UH ZdbAetHjTGTU38VLT5TqtbA90HD+VHu4h5wceBO9OHldpMimKX7hepTQE3DZilrI4V UoNo7Fk98M9PQ== 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 1wc4WH-0000000FMe4-12PY; Tue, 23 Jun 2026 17:02:41 +0000 Date: Tue, 23 Jun 2026 18:02:40 +0100 Message-ID: <86qzlxqjf3.wl-maz@kernel.org> From: Marc Zyngier To: Bradley Morgan Cc: Oliver Upton , kvmarm@lists.linux.dev, Fuad Tabba , Joey Gouly , Steffen Eiden , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Quentin Perret , Vincent Donnefort , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2 1/2] KVM: arm64: skip pKVM cache flushes for non cacheable mappings In-Reply-To: <20260623163756.4591-1-include@grrlz.net> References: <20260623160339.15143-1-include@grrlz.net> <20260623163756.4591-1-include@grrlz.net> 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: include@grrlz.net, oupton@kernel.org, kvmarm@lists.linux.dev, tabba@google.com, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, qperret@google.com, vdonnefort@google.com, 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 Bradley, Just a few things to keep in mind for your next contributions: - If you are sending more than a single patch, add a cover letter. - Don't send a v2 in reply to a v1. It messes the threading we are relying on, and makes it hard to ignore replies to an older version. Always send new series standalone. - Don't immediately send a V2, even if (especially if!) a bot is pestering you. 34 minutes between versions is way too short (at least a few days is the norm). On Tue, 23 Jun 2026 17:37:55 +0100, Bradley Morgan wrote: > > pKVM keeps its own mapping list for stage 2 operations. Its flush path > uses that list directly, so it lost the PTE attribute check done by the > generic stage 2 walker. > > Record whether a mapping is cacheable and skip cache maintenance for > mappings that are not cacheable. > > Fixes: e912efed485a ("KVM: arm64: Introduce the EL1 pKVM MMU") > Cc: stable@vger.kernel.org What device memory gets mapped in an upstream pKVM guest that would require a backport to stable? > Signed-off-by: Bradley Morgan > --- > Changes in v2: > - Add patch 2 for the pKVM permission fault mapping cache bug. This is the sort of information that goes in the cover letter. > > arch/arm64/include/asm/kvm_pkvm.h | 1 + > arch/arm64/kvm/pkvm.c | 8 +++++++- > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/kvm_pkvm.h b/arch/arm64/include/asm/kvm_pkvm.h > index 74fedd9c5ff0..d9dd8239910d 100644 > --- a/arch/arm64/include/asm/kvm_pkvm.h > +++ b/arch/arm64/include/asm/kvm_pkvm.h > @@ -196,6 +196,7 @@ struct pkvm_mapping { > u64 gfn; > u64 pfn; > u64 nr_pages; > + bool cacheable; Errr, no. That's a terrible idea. This thing is already big enough, let's not add a bool right in the middle (use pahole to find out why this is bad). Given that nr_pages is for a range, and that the minimum page size uses 12 bits, the largest number of pages you can have here is 56-12=48 bit wide. That's another 16 bits worth of flags you can use. Thanks, M. -- Without deviation from the norm, progress is not possible.