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 69C4DC55165 for ; Thu, 30 Jul 2026 12:40:08 +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=ylBp3ID7LGMPxx9g2HOSILblRK6WLP/WK8iYeAR7QiU=; b=W8sOfEDsOUz83dIP0VO+v7Ofjy 7NIIzN8A4DnyeFTSWor9iNwJKrz0yveBV+OUGfxD/TmUPfG6Z1tD8T/IRS+wfLoJcVM9A4/KTU4QR 4SmXNS0q/65FNRzzmkn2HYAM1HBL3cPwpOWrguMHZhW3ubX5UVJlcsTpLB/dDgZXEnFWMkkgTaQCs kzNpq9ADDRkAna3elqaws3A/moIdlUEbiiYT0RiJMHi/5YPtFYg48jawIWy5J4452K0EZNME4NvgR 8szAyVEHHGayXz1FrNwtLIlS1BtIrGX7JLcXihT7/6BeDNQvssPC0E4Tpg4nY3eymAsii5YUNUhe4 TBXhobGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wpQ3O-0000000AUQf-0GZm; Thu, 30 Jul 2026 12:40:02 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wpQ3N-0000000AUQN-1KOE for linux-arm-kernel@lists.infradead.org; Thu, 30 Jul 2026 12:40:01 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id BFEA160A63; Thu, 30 Jul 2026 12:40:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 750551F000E9; Thu, 30 Jul 2026 12:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785415200; bh=ylBp3ID7LGMPxx9g2HOSILblRK6WLP/WK8iYeAR7QiU=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=LdKV0UX9bNSTpp24GeRMDpcBAg6s2yEDz5n+vTHl4dsXmoxN0mtKB6u8SM4i3SUQK F+ZX/uf2pwzfh+DR5UMvWv0Z7Kd9gJJ+TsJ5Tl83T+wY1ui9uDzDMUJMXqBsUiNneC AW6gz5hhjtg6G4uR7yfTJN0EAbOji8QBjIeQwaaYb4zXiOT2dTotWlOGXxtzBj5gRj AGHc1cpbyl/sVs7JmfyNdK3qc1A1UDIwcSitY4rXfwKpERcs5JhTkhJjquXj7aTUwB WS5iPmR1Fwh+ykoMmaAww/F1QknOuKt5Pe8mOjUJs2DJk9mQM3VgMJsqn4yO3tTcQ/ VjI6muE/VhgLw== 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 1wpQ3K-0000000AWkz-2GkT; Thu, 30 Jul 2026 12:39:58 +0000 Date: Thu, 30 Jul 2026 13:39:58 +0100 Message-ID: <86ik5wd529.wl-maz@kernel.org> From: Marc Zyngier To: Mostafa Saleh Cc: linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, oupton@kernel.org, seiden@linux.ibm.com, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, vdonnefort@google.com, tabba@google.com, sebastianene@google.com, keirf@google.com Subject: Re: [PATCH v3] KVM: arm64: Optimize protected mode with FWB and DIC In-Reply-To: <20260723162002.3848054-1-smostafa@google.com> References: <20260723162002.3848054-1-smostafa@google.com> 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: smostafa@google.com, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, oupton@kernel.org, seiden@linux.ibm.com, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, vdonnefort@google.com, tabba@google.com, sebastianene@google.com, keirf@google.com 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 Thu, 23 Jul 2026 17:20:02 +0100, Mostafa Saleh wrote: > > KVM opportunistically enables FWB if supported by the system for guest > VMs, which allows it to elude cache maintenance for data as they are > forced to be cacheable from stage-2. > In that case, __clean_dcache_guest_page() will immediately return. > However in protected mode, before calling __clean_dcache_guest_page() > it loops over the range and fix_map/unmap it, issuing TLB > invalidations, dsb() and isb() unnecessarily. > > This can be optimized by returning early if FWB is supported, > kvm_pgtable_stage2_map() already issues dsb() and tlb invalidation > functions issue dsb() for the unmap path. > > Similarly for DIC, we can omit the call in > invalidate_icache_guest_page() > > No isb() needed as ERET is context synchronization event. > > Signed-off-by: Mostafa Saleh Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.