arm64: entry: Avoid empty alternatives entries
authorJulien Thierry <jthierry@redhat.com>
Thu, 9 Jan 2020 16:02:59 +0000 (16:02 +0000)
committerWill Deacon <will@kernel.org>
Tue, 21 Jan 2020 09:55:18 +0000 (09:55 +0000)
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.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Julien Thierry <jthierry@redhat.com>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/entry.S

index 7c6a0a4..605bb7c 100644 (file)
        .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