The code in arch/arm64/mm/cache.S creates three empty alternatives, all
from calling the dcache_by_myline_op_nosync asm macro.  If \op == cvau,
it creates an empty alternative for ARM64_WORKAROUND_4311569.

Since orig_len == 0, the alternative patching code mostly ignores it,
though it does do an unnecessary clean_dcache_range_nopatch().  It also
triggers an objtool error ("empty alternative entry").

Clean it up by moving the .ifnc check outside the alternative emit.

Signed-off-by: Josh Poimboeuf <[email protected]>
---
 arch/arm64/include/asm/assembler.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/include/asm/assembler.h 
b/arch/arm64/include/asm/assembler.h
index effae53e9739d..6e059efced5bb 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -404,13 +404,13 @@ alternative_else_nop_endif
        add     \start, \start, \linesz
        cmp     \start, \end
        b.lo    .Ldcache_op\@
-alternative_if ARM64_WORKAROUND_4311569
        .ifnc   \op, cvau
+alternative_if ARM64_WORKAROUND_4311569
        mov     \start, \tmp
        mov     \tmp, xzr
        cbnz    \start, .Ldcache_op\@
-       .endif
 alternative_else_nop_endif
+       .endif
 
        _cond_uaccess_extable .Ldcache_op\@, \fixup
        .endm
-- 
2.54.0


Reply via email to