arm64: setup: name `mair` register
authorMark Rutland <mark.rutland@arm.com>
Fri, 26 Mar 2021 18:01:36 +0000 (18:01 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Sun, 28 Mar 2021 17:23:01 +0000 (18:23 +0100)
commit776e49af6000ef95301d0d3f834543bda43cb7fb
treeb2e141fa254242f1d7922dce307f8404c6cbce18
parentb07f3499661c61f03478c99ff3fcb2381ddb9e38
arm64: setup: name `mair` register

In __cpu_setup we conditionally manipulate the MAIR_EL1 value in x5
before later reusing x5 as a scratch register for unrelated temporary
variables.

To make this a bit clearer, let's move the MAIR_EL1 value into a named
register `mair`. To simplify the register allocation, this is placed in
the highest available caller-saved scratch register, x17. As it is no
longer clobbered by other usage, we can write the value to MAIR_EL1 at
the end of the function as we do for TCR_EL1 rather than part-way though
feature discovery.

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-2-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/proc.S