From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B031C43458 for ; Sun, 5 Jul 2026 19:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OPI+ApKqdzBUwz1sXIFVIUKT6N0yjrQCNo8ScPon0rE=; b=Cl6Z+ZTNWnxYuWnBxglU+yI4za zzOvbH2m2qx3D8CES5/cJVf2Y+xo/Ds7jALUyHXPktJTL2eN93ZbRq23gAofmbLSJkKwAY9IG6Mvk FGgb1YGmOo3fRQyHnWGpWQd2mtGfTTdlai2KJhwLhFLXpsetEuAB3Am9hQ7ObEvr3WPhYRhbXC0+W XZHn2L/yXnCXdL2ZwV1m/H6kGnVvpGrxnJ/s7Kxp3dbg/09oypzPNTyGZINwEUOMPS0l52AO2hooC u5wK/IpZ7sL5qsNTz2sYthjIoLOeK/WUXXVljGN7IEmtYvpAkDGxfxl58EDtFBiN2R3sDJEZ+UgZc ZXyM7j5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wgSTP-00000009cmq-0LkD; Sun, 05 Jul 2026 19:25:51 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wgSTN-00000009cmi-2SaP for linux-arm-kernel@lists.infradead.org; Sun, 05 Jul 2026 19:25:49 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id A7CC941915; Sun, 5 Jul 2026 19:25:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88CD51F000E9; Sun, 5 Jul 2026 19:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783279548; bh=OPI+ApKqdzBUwz1sXIFVIUKT6N0yjrQCNo8ScPon0rE=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=QKAn6fqmHWbVb6fQ26XB5SXr8dfPE/yyl6eeEnIY4buUZrRYYnOLCXflQL468TJXv g2bWXPkBhcuLddlkoEPAdslZykWk5gnMk1i7KQtunwTrY+f6LUH7AqI2tUlvRkLnSZ 7JnRUD+nuA01QSzTm+gvIoizkdplV7cQBK00trh3Evme0/iaawGzFmWFjoqHSPG8G3 Yi+nvqlGxjXJ9RZC4kO3SjRvVxIsKL1w5XPlr7GxqBHJah9PWmDDmZ6RgACsKdLXf9 /gm7Ffyk72sC4AG1pQ6wpkcQ2ITzqetGFl46xPxtLoDUn4YH/tuuvVT6FI5d41fk9j vgl+yMGcSPNRA== 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 1wgSTK-00000001frG-14pI; Sun, 05 Jul 2026 19:25:46 +0000 Date: Sun, 05 Jul 2026 20:27:34 +0100 Message-ID: <87echh6xuh.wl-maz@kernel.org> From: Marc Zyngier To: Dev Jain Cc: Bradley Morgan , Oliver Upton , Fuad Tabba , Joey Gouly , Steffen Eiden , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Quentin Perret , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] KVM: arm64: Record whether pKVM stage 2 mapping is cacheable In-Reply-To: References: <20260701192428.17430-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) 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: dev.jain@arm.com, include@grrlz.net, oupton@kernel.org, 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, 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 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, 05 Jul 2026 15:08:58 +0100, Dev Jain wrote: > > > > On 02/07/26 12:54 am, 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") > > Is Fixes tag required? If I am reading correctly, Arm ARM says this: > > "For VA-based cache maintenance instructions, the instruction operates on the > caches regardless of the memory type and cacheability attributes marked for > the memory address in the VMSA translation table entries. This means that > the effects of the cache maintenance instructions can apply regardless of: > Whether the address accessed: > Is Normal memory or Device memory. > Has the Cacheable attribute or the Non-cacheable attribute." > > So nothing goes wrong if we do dcache clean for non-cacheable > memory. Two things: - having to perform CMOs for something that is not *expected* to be cacheable is both pointless and a contradiction of the intent - what you quote is about the nature of the *mapping*, and not the memory that is being mapped. Cleaning a dirty cache line on an unsuspecting MMIO endpoint is never going to end nicely. Just have a try. My reading of all this is that a fix indeed is required, and therefore a Fixes tag *must* be present. M. -- Jazz isn't dead. It just smells funny.