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 5C03AFC5914 for ; Thu, 26 Feb 2026 09:18:03 +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=OtgTf982cM8v4Z3VgsFQdPTulaRPVPh5nheZkr0MT3I=; b=Utfw9TMfsgfToegyvrCRDCdKvA 1AV8i2m5eH1eOuBgU2pcuwX6V/zmrm8S/wc2WeQ+TF5uHDjDaZZLQlKKagH7I57fX+NJKZcghZiek Krnb8EfIKvSjRF46DKzNtczaQZnuQMi9ZxnqJ/jrwHoafx84JW4fSFtQsAqhH2Cd1h2Xdrjp5wFN0 xhjzs0M8W9QJi9lB6naN7EC7Hfs+2IiOSFYURKDXwajtPaxEJAwpDrUI+zmIMTBxybiR2iemr5Pk7 oc1+t4ktCweMXJCwzOhAJlJItuOWKOmQEZATVK0/fWhNZmm09PNnEGqsfj8L4D39dSmaNsgPeXwU/ KjolXn5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vvXCN-00000005jS6-1wKA; Thu, 26 Feb 2026 08:58:19 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vvXCL-00000005jRV-1GKC for linux-arm-kernel@lists.infradead.org; Thu, 26 Feb 2026 08:58:17 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 757CF60054; Thu, 26 Feb 2026 08:58:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 264EAC19422; Thu, 26 Feb 2026 08:58:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772096296; bh=CJPFR8xcGhZkLwYD4/+N3Jj6LEc+gL7NvBbIc+ztvmE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YlBPW6DWfsx+ikbyLYeunLk+w6+QSSSjMTkRbNT15h7QWBhTy4cRdsGG+qnmZC496 E5Gg3c99x9kBKqV4/XGZemOC83uYozmbHlgmnU4tESpSeW79w0oCLzOWylLYTQQwGQ nQ5HPCCcxznFhWx5BSq41qA6FCJef81HStrvjFLg9Pnp8S78yYgouaV2qA168iAnSz dbW+aK1ZoXbghqJ5/nXI9F7nBaA3PpP5SPuF2WWwR88Jn7Z05LTE6oTkIfkknOI/PU XsGyDM18qzs5hI0xKuc0bNE5sNuj5AFEOcqjLKVcZPjljm/P9osG0dYYAYWlZa21py Woebjd1yKFQ+Q== 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 1vvXCI-0000000DyxP-0ay3; Thu, 26 Feb 2026 08:58:14 +0000 Date: Thu, 26 Feb 2026 08:58:13 +0000 Message-ID: <868qcfankq.wl-maz@kernel.org> From: Marc Zyngier To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, oupton@kernel.org, ryan.roberts@arm.com, will@kernel.org Subject: Re: [PATCH 0/2] arm64: tlb: Optimize ARM64_WORKAROUND_REPEAT_TLBI In-Reply-To: <20260218164348.2022831-1-mark.rutland@arm.com> References: <20260218164348.2022831-1-mark.rutland@arm.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: mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, oupton@kernel.org, ryan.roberts@arm.com, will@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 Wed, 18 Feb 2026 16:43:46 +0000, Mark Rutland wrote: > > Hi all, > > Some Arm partners have complained that the overhead of > ARM64_WORKAROUND_REPEAT_TLBI is too large, and despite the relevant > errata being categorized as "rare", they still want to use the > workaround in some deployments. > > For historical reasons, the current workaround is far stronger (and > consequently far more expensive) than necessary. In part, the SDENs had > somewhat misleading descriptions, which have recently been clarified: > > * Arm Cortex-A76 erratum #1286807 > SDEN v33: https://developer.arm.com/documentation/SDEN-885749/33-0/ > > * Arm Cortex-A55 erratum #2441007 > SDEN v16: https://developer.arm.com/documentation/SDEN-859338/1600/ > > * Arm Cortex-A510 erratum #2441009 > SDEN v19: https://developer.arm.com/documentation/SDEN-1873351/1900/ > > Patch 1 allows the __TLBI*() helpers to generate XZR as an argument. > I've split this out as its own patch to make bisection easier in case we > see any problems due to incorrect trap+emulation handling of XZR. > Otherwise this shouldn't have any functional change. > > Patch 2 is the actual optimization, spelled out in detail in the commit > message. The gist is that it's not necessary to duplicate every > individual TLBI, and it's sufficient to have a single arbitrary TLBI;DSB > after any number of batched TLBIs;DSB. > > As mentioned in the commit message for patch 2, this results in fewer > alternatives and better code generation whenever > ARM64_WORKAROUND_REPEAT_TLBI is built into the kernel, so it's a > (trivial) win on hardware that isn't affected by the relevant errata. > > Mark. > > Mark Rutland (2): > arm64: tlb: Allow XZR argument to TLBI ops > arm64: tlb: Optimize ARM64_WORKAROUND_REPEAT_TLBI > > arch/arm64/include/asm/tlbflush.h | 63 ++++++++++++++++++------------- > arch/arm64/kernel/sys_compat.c | 2 +- > arch/arm64/kvm/hyp/nvhe/mm.c | 2 +- > arch/arm64/kvm/hyp/nvhe/tlb.c | 8 ++-- > arch/arm64/kvm/hyp/pgtable.c | 2 +- > arch/arm64/kvm/hyp/vhe/tlb.c | 10 ++--- > 6 files changed, 49 insertions(+), 38 deletions(-) > A bit late, but FTR, Reviewed-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.