From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796401882; b=smMIzxfsRDgMxElyEeb5xkEyFGHBd9Bl+Sic8SfZublrUHFDAqob8KVgRxOgRgklocdO e7x/T0kcVwsKExB9MHR+f8yWqFOXA26RPvrqJ5HbGe7c5380r880uhSikVIoCM1ApI1fb 1+fRX5XhBClAxh6k4VGC3MKunAWqjOx5paX7wR4Rbwh7f0FSPVXv5rcOHSa2erw2RLFru q4+kF9DmV7LzJfI0HTtcMKQ+JhjY+5WADE6GDOZeM7AMwno9gEatKKqnBrHszQYOngdoy BH/8NrTLG8PMChVDXqfXgyP4zFK25Cnhuk629rfCAgwWRfuHSoJJANDWdJjGa694V4w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796401882; h=Received:DKIM-Signature:Received:Date:Message-ID:From:To:Cc:Subject: In-Reply-To:References:User-Agent:MIME-Version:Content-Type: X-SA-Exim-Connect-IP:X-SA-Exim-Rcpt-To:X-SA-Exim-Mail-From: X-SA-Exim-Scanned; bh=+PFQj2DEgPemIyXNe3yR8zTjltgZYYPzrSOUDtlZpZw=; b=ipexBiT5VEVU5g6OLZMs6pCpu0FlaCF5kv7+rnsorcpmwixMtZZ8eiXCW5fkUlPgQGHT D6TT/Z3uecLi2k3Jjp9z751Spzq2G65JanQoyQDQXY+eBzhDNFesf2y2Wy6qK7Allfcg6 Wf3LCFGScoGIQSM/qzV6mPgQLgOnhroaVpVtod99g/OO8B94+Y5tYLXfwJEkELzxCEP6D QEPFg2uk6Ga+H8R0OE9qT883GlAgrgY0RviEFHBFFD9fyawppx29ltJKSNlnG+uNnhJ/m ekD5l8m/yrvc3xpF6LKyLywBf4YCSSq8R8g0r8/56ZNMBLUMH8hV7ZvC7Df2K41dfcA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=C97YsGLj; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EEA1606A322; Fri, 4 Dec 2026 16:31:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=C97YsGLj Received: by smtp.kernel.org (Postfix) with ESMTPSA id D53251F000C2; Fri, 4 Dec 2026 16:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796401881; bh=+PFQj2DEgPemIyXNe3yR8zTjltgZYYPzrSOUDtlZpZw=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=C97YsGLjLKg1/xqmfrfMvfodgf0EmLj+k6XfAgGppL1e6ZrV4NulNFuj9B3AkhEwf dgUDhNhrjZk9bIINghL6vsEvqEUU7reiX5mDCinqv2XoMm/Gn/IxFpKG6mtNAiLb9Y nD+/E3XsN+umOhUeDxu4EvmTygKWwAb9uLLmtSBEqBmy1Nj9Uc8yArMoqqT9IBMBr8 O3eFmz4wStS/hmAYh5GzkyXnB1GBA7tN4QUWNXZZpz37gKLwgVJoJ4VhBklE/EiN67 cc2vZs5EpqSkFww3GvcJ6IJheCSljPv2koaKMojl7SDc9iXjTsghmE/l6mlILZf8sL xh1Zj/+Z2TSJA== 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 1xZWBr-00000007Cxq-3t6m; Fri, 04 Dec 2026 16:31:20 +0000 Date: Fri, 04 Dec 2026 16:31:19 +0000 Message-ID: <86v759vwh4.wl-maz@kernel.org> From: Marc Zyngier To: Justin He Cc: "sashiko-reviews@lists.linux.dev" , "kvmarm@lists.linux.dev" , "kvm@vger.kernel.org" , Oliver Upton , nd Subject: Re: [PATCH v4 4/4] KVM: arm64: nv: Allow the L1 VNCR page in cacheable PFNMAP memory In-Reply-To: References: <20261203105805.165749-1-justin.he@arm.com> <20261203105805.165749-5-justin.he@arm.com> <86zeulwdgn.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) X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: Justin.He@arm.com, sashiko-reviews@lists.linux.dev, kvmarm@lists.linux.dev, kvm@vger.kernel.org, oupton@kernel.org, nd@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Fri, 04 Dec 2026 11:34:36 +0000, Justin He wrote: > > Hi Marc, > > [...] > > > > Thank you for your contribution! Sashiko AI review found 1 potential > > > > issue to consider: > > > > - [High] KVM: arm64: vncr_pfn_is_cacheable() checks VMA prot instead of > > > > PTE prot > > > > -- > > > > > > Make sense to me. Inspecting vma->vm_page_prot can indeed misclassify a > > > VM_PFNMAP mapping whose per-PTE attributes were overridden with > > > vmf_insert_pfn_prot(). > > > > > > vncr_pfn_is_cacheable() will resolve the actual host PTE pgprot > > > via follow_pfnmap_start() and check it with kvm_pgprot_is_cacheable() > > > instead of relying on vma->vm_page_prot. > > > > > > I'll give it another day for any further comments before sending v5. > > > > Honestly, I'm starting to question whether this is worth the > > complexity. I can see the appeal for memory that lives outside of the > > kernel's view, but having to deal with devices on the VNCR path is > > absolutely deadly. > > Fair point. The goal is strictly cacheable memory outside the linear > map that the guest uses as RAM, not device MMIO, and I agree that > getting a device mapping wrong on the EL2 fixmap path is not > acceptable. > > Let's drop patch 4 from this series so patches 1-3 (the fixmap offset > fix, the AF update SEA fix, and the selftest) can move forward on > their own. I'll send v5 with just those three patches if you agree. I can take those first three patches right as they are, no need to resend. > If we revisit non-linear-map cacheable RAM for VNCR later, would you > prefer an explicit opt-in from the backing memory (similar to > VM_MTE_ALLOWED) to rule out arbitrary devices, or should VNCR stay > restricted to memory with a linear map / struct page? The issue is to distinguish RAM from devices when the only thing we have for that purpose is a userspace PTE and no notion of which is what. Do you see any reliable way to distinguish those? They are both flagged PTE_SPECIAL, but that's about it. I'm not sure what a new flag gives us, to be honest. Ideally, what I'd really want is a PTE bit saying "this is memory" or "this is a device". But we only have the attributes for this, and I'm worried this is not enough... Thanks, M. -- Without deviation from the norm, progress is not possible.