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 3F4B2D7237F for ; Fri, 23 Jan 2026 12:23:18 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From: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=2Z/83YbtV088zyoX0OD3/pWQXCZpS3v4RXqrhoiNfSw=; b=IXFWlrmu0YGSR6y4FK7wU2OZJB mJVGFy6a3mMdWwo54k3wv1fAgxWazi84TsjtVyoze/XEi30O2cNuo+6ETtGG8OyirGftHdd4nKPEz L59QF0BFMIcGQYY31c4d7xpNlcVz4RmqYiD2P/4soKd0JH8RC1QnEFYVVNvk9y4oSNGu0Xc0rbUT+ u953kBnmV5N/EKmKvHMFCyqAkAkiM0/NJUocar/J9gV7TnHsZby2WcGXbZGUVGlZh8LiWDXyMldxs OgY28ks3H0StLOTVwvm5wJgH9YwgktV0ALvHa7KEUaM3aB5uTRyWYaTRNWcfwlFynPRHHTYAxGevn vI/6Ofjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vjGC1-00000008to8-1aCI; Fri, 23 Jan 2026 12:23:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vjGBy-00000008tnm-0I3U for linux-arm-kernel@lists.infradead.org; Fri, 23 Jan 2026 12:23:11 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BD64A1476; Fri, 23 Jan 2026 04:22:58 -0800 (PST) Received: from raptor (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 776043F740; Fri, 23 Jan 2026 04:23:03 -0800 (PST) Date: Fri, 23 Jan 2026 12:22:58 +0000 From: Alexandru Elisei To: Marc Zyngier Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Joey Gouly , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Will Deacon , Quentin Perret , Fuad Tabba Subject: Re: [PATCH 0/6] KVM: arm64: ... and FWB for all Message-ID: References: <20260119105651.255693-1-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260119105651.255693-1-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260123_042310_149596_634326E8 X-CRM114-Status: GOOD ( 22.82 ) 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 Hi Marc, On Mon, Jan 19, 2026 at 10:56:45AM +0000, Marc Zyngier wrote: > [Yes, you can tell what I was listening to] > > Today, running in protected mode puts the host under it's own S2 with > FWB=0, even if the rest of the guests are running with FWB=1. The > rationale for this special-casing of the host is that we want the > combined attributes to actually reflect the ones exposed by S1. > > We therefore use NormalCacheable (which is the weakest memory type) as > the default attributes at S2 so that S1 can only strengthen the final > memory type. > > But there is no reason why we cannot achieve the same effect with > FWB. We normally use FWB to enforce cacheable memory from S2, > irrespective of S1. But it is possible to configure the S2 attributes > as "pass-through", so that the S1 attributes are always used. Would you mind clarifying why FWB is preferable? Is it so that pkvm uses the same approach for configuring stage 2 for the host as for a guest? Or is it something else? > > This small series implements that change, adding a flag that actually > describes what we are trying to do (instead of the NOFWB flag which is > pretty obscure), and fixes an interesting gotcha with CMOs. > Interestingly, CMOs never actually worked with NOFWB on an FWB-aware > platform... Hmm... as far I can tell pkvm doesn't populate mm_ops->dcache_clean_inval_poc for host_mmu, so pKVM doesn't issue CMOs for the host s2, with or without these changes. Thanks, Alex > > Patches on top of 6.19-rc5. > > Marc Zyngier (6): > arm64: Add MT_S2{,_FWB}_AS_S1 encodings > KVM: arm64: Add KVM_PGTABLE_S2_AS_S1 flag > KVM: arm64: Make stage2_pte_cacheable() return false when S2_AS_S1 is > set > KVM: arm64: Switch pKVM host S2 over to KVM_PGTABLE_S2_AS_S1 > KVM: arm64: Kill KVM_PGTABLE_S2_NOFWB > KVM: arm64: Simplify PAGE_S2_MEMATTR > > arch/arm64/include/asm/kvm_pgtable.h | 7 +++--- > arch/arm64/include/asm/memory.h | 11 ++++++--- > arch/arm64/include/asm/pgtable-prot.h | 4 ++-- > arch/arm64/kvm/hyp/nvhe/mem_protect.c | 4 +++- > arch/arm64/kvm/hyp/pgtable.c | 32 +++++++++++++++++++-------- > 5 files changed, 39 insertions(+), 19 deletions(-) > > -- > 2.47.3 > >