Re: [RFC v5 56/57] arm64: entry: Avoid empty alternatives entries

From: Mark Rutland
Date: Thu Jan 09 2020 - 11:51:51 EST


On Thu, Jan 09, 2020 at 04:02:59PM +0000, Julien Thierry wrote:
> kernel_ventry will create alternative entries to potentially replace
> 0 instructions with 0 instructions for EL1 vectors. While this does not
> cause an issue, it pointlessly takes up some bytes in the alternatives
> section.
>
> Do not generate such entries.
>
> Signed-off-by: Julien Thierry <jthierry@xxxxxxxxxx>

This looks like a sensible cleanup on its own. FWIW:

Acked-by: Mark Rutland <mark.rutland@xxxxxxx>

Mark.

> ---
> arch/arm64/kernel/entry.S | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> index 7c6a0a41676f..605bb7cbe499 100644
> --- a/arch/arm64/kernel/entry.S
> +++ b/arch/arm64/kernel/entry.S
> @@ -60,16 +60,16 @@
> .macro kernel_ventry, el, label, regsize = 64
> .align 7
> #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
> -alternative_if ARM64_UNMAP_KERNEL_AT_EL0
> .if \el == 0
> +alternative_if ARM64_UNMAP_KERNEL_AT_EL0
> .if \regsize == 64
> mrs x30, tpidrro_el0
> msr tpidrro_el0, xzr
> .else
> mov x30, xzr
> .endif
> - .endif
> alternative_else_nop_endif
> + .endif
> #endif
>
> sub sp, sp, #S_FRAME_SIZE
> --
> 2.21.0
>