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 9B2A542E00A; Thu, 30 Jul 2026 12:40:00 +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=1785415201; cv=none; b=B2INS+BNfGwa9NFCaiTYr1EQN5H3zweLymE7zmPvwbIkCaXVQx1/ewrMbctKS5BXJ9pGAYMIiTzN9IiWFBIiHAONaApLIm2bbU4buDliKI8XiedRE3FF4p46wHEy2pFU5cdmkJiExpMH3MzyxPNu++UuwaEHxtV8p4e1MoHcVtU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785415201; c=relaxed/simple; bh=YqOKDmF9/H9jh4NntpuxPDa3eeApiYIE1miaTdp4/HM=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=JjJ4Wmrqi4H94BuQFp90EUnD1qAkfhS6lmSjC+GVAeajbq8jzMD8Q9S/dU7UFsw5+gEDQPn0+BSM5UxMNSQ2Q0CFM86Syxcf0fBScnvOAAQxeN48i1FhrEMJtDeFVC59KJUn/Ja3RLDoo/85dJmJipZOlVDXd/y6C9677FdZ1LE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LdKV0UX9; 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="LdKV0UX9" 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) 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: 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 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.