Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E161409107 for ; Thu, 11 Jun 2026 13:45:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781185509; cv=none; b=EiyGScWTb4JiRMPWEJVLZBNTNCiPaXKUF0hj3szocwz0oLTcftPCDO5vA1BVrfFmstE4eJmG5TD58OW4/qkj43uVqwM3CXunawPEf24meCym2iYcWtsLn3O2ERfQL+zd4RCkAulZbN3NpgDx8I+06XfL/bLxfO0bwn3KVhFKeQs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781185509; c=relaxed/simple; bh=l2NxSeo2hxpiXbRiQ5lMJPk3K5h6JAZV71IKj8X99Zg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jJTiugDGh8TbV2oY8x9M/bdVK6GhX7vGB+53SVXizaG7x3HmcCr9+Ps2761uTU4swrlaOR4tc/D8ODrSdTcSe9xWyN3ItSonu52wGhQXOkK6zzNJp+OJO8uUbeYvqms7b0F5E//3loEBas3KOm7dBWqdG+3QpDTqcrzHUcV/DzY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=lcYpC+xY; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="lcYpC+xY" 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 7B59E1E5E; Thu, 11 Jun 2026 06:45:01 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8A5B83FAF5; Thu, 11 Jun 2026 06:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1781185506; bh=l2NxSeo2hxpiXbRiQ5lMJPk3K5h6JAZV71IKj8X99Zg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lcYpC+xYPrdCtC6muYkA9ORk4X1iW7YeNPEeANB7oQLZgsShKzWTJZ1xBTVTLaXDh WJAeX0aeHb8SC15bIbs6+E56TaU0yplNaYssJdURmQ2DUZg5dLCIc2WAhkQTGiBjOq JloaakVlR0GLc6T9z2envUTLHz4/0YoWgrBHKx10= From: Mark Rutland To: stable@vger.kernel.org Cc: anshuman.khandual@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, lee@kernel.org, mark.rutland@arm.com, maz@kernel.org, oupton@kernel.org, ryan.roberts@arm.com, will@kernel.org, yuzenghui@huawei.com Subject: [PATCH 6.1.y 2/3] arm64: tlb: Allow XZR argument to TLBI ops Date: Thu, 11 Jun 2026 14:44:50 +0100 Message-Id: <20260611134451.1700637-3-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20260611134451.1700637-1-mark.rutland@arm.com> References: <20260611134451.1700637-1-mark.rutland@arm.com> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit commit bfd9c931d19aa59fb8371d557774fa169b15db9a upstream. The TLBI instruction accepts XZR as a register argument, and for TLBI operations with a register argument, there is no functional difference between using XZR or another GPR which contains zeroes. Operations without a register argument are encoded as if XZR were used. Allow the __TLBI_1() macro to use XZR when a register argument is all zeroes. Today this only results in a trivial code saving in __do_compat_cache_op()'s workaround for Neoverse-N1 erratum #1542419. In subsequent patches this pattern will be used more generally. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Marc Zyngier Cc: Oliver Upton Cc: Ryan Roberts Cc: Will Deacon Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman [Mark: Backport to v6.1.y] Signed-off-by: Mark Rutland --- arch/arm64/include/asm/tlbflush.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h index 412a3b9a3c25d..2626a45849c24 100644 --- a/arch/arm64/include/asm/tlbflush.h +++ b/arch/arm64/include/asm/tlbflush.h @@ -37,12 +37,12 @@ : : ) #define __TLBI_1(op, arg) asm (ARM64_ASM_PREAMBLE \ - "tlbi " #op ", %0\n" \ + "tlbi " #op ", %x0\n" \ ALTERNATIVE("nop\n nop", \ - "dsb ish\n tlbi " #op ", %0", \ + "dsb ish\n tlbi " #op ", %x0", \ ARM64_WORKAROUND_REPEAT_TLBI, \ CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \ - : : "r" (arg)) + : : "rZ" (arg)) #define __TLBI_N(op, arg, n, ...) __TLBI_##n(op, arg) -- 2.30.2