arm64: setup: name `tcr` register
authorMark Rutland <mark.rutland@arm.com>
Fri, 26 Mar 2021 18:01:37 +0000 (18:01 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Sun, 28 Mar 2021 17:23:01 +0000 (18:23 +0100)
commit5cd6fa6de5e903a9500d858fffbc72c574d4513b
tree166c9ccc9739a78171dc9c12817d8524327fa92d
parent776e49af6000ef95301d0d3f834543bda43cb7fb
arm64: setup: name `tcr` register

In __cpu_setup we conditionally manipulate the TCR_EL1 value in x10
after previously using x10 as a scratch register for unrelated temporary
variables.

To make this a bit clearer, let's move the TCR_EL1 value into a named
register `tcr`. To simplify the register allocation, this is placed in
the highest available caller-saved scratch register, tcr.

Following the example of `mair`, we initialise the register with the
default value prior to any feature discovery, and write it to MAIR_EL1
after all feature discovery is complete, which allows us to simplify the
featuere discovery code.

The existing `mte_tcr` register is no longer needed, and is replaced by
the use of x10 as a temporary, matching the rest of the MTE feature
discovery assembly in __cpu_setup. As x20 is no longer used, the
function is now AAPCS compliant, as we've generally aimed for in our
assembly functions.

There should be no functional change as as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20210326180137.43119-3-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/proc.S