Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

arm64: tlb: Allow XZR argument to TLBI ops

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 <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oupton@kernel.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Mark Rutland and committed by
Will Deacon
bfd9c931 9d1a7c4a

+3 -3
+3 -3
arch/arm64/include/asm/tlbflush.h
··· 38 38 : : ) 39 39 40 40 #define __TLBI_1(op, arg) asm (ARM64_ASM_PREAMBLE \ 41 - "tlbi " #op ", %0\n" \ 41 + "tlbi " #op ", %x0\n" \ 42 42 ALTERNATIVE("nop\n nop", \ 43 - "dsb ish\n tlbi " #op ", %0", \ 43 + "dsb ish\n tlbi " #op ", %x0", \ 44 44 ARM64_WORKAROUND_REPEAT_TLBI, \ 45 45 CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \ 46 - : : "r" (arg)) 46 + : : "rZ" (arg)) 47 47 48 48 #define __TLBI_N(op, arg, n, ...) __TLBI_##n(op, arg) 49 49