]> Git Repo - linux.git/commit
arm64: alternatives: Move length validation in alternative_{insn, endif}
authorNathan Chancellor <[email protected]>
Wed, 14 Apr 2021 00:08:04 +0000 (17:08 -0700)
committerCatalin Marinas <[email protected]>
Thu, 15 Apr 2021 17:33:25 +0000 (18:33 +0100)
commit22315a2296f4c251fa92aec45fbbae37e9301b6c
treed6be89f7456097ad3afed89d35a419ddefef27fe
parent738fa58ee1328481d1d7889e7c430b3401c571b9
arm64: alternatives: Move length validation in alternative_{insn, endif}

After commit 2decad92f473 ("arm64: mte: Ensure TIF_MTE_ASYNC_FAULT is
set atomically"), LLVM's integrated assembler fails to build entry.S:

<instantiation>:5:7: error: expected assembly-time absolute expression
 .org . - (664b-663b) + (662b-661b)
      ^
<instantiation>:6:7: error: expected assembly-time absolute expression
 .org . - (662b-661b) + (664b-663b)
      ^

The root cause is LLVM's assembler has a one-pass design, meaning it
cannot figure out these instruction lengths when the .org directive is
outside of the subsection that they are in, which was changed by the
.arch_extension directive added in the above commit.

Apply the same fix from commit 966a0acce2fc ("arm64/alternatives: move
length validation inside the subsection") to the alternative_endif
macro, shuffling the .org directives so that the length validation
happen will always happen in the same subsections. alternative_insn has
not shown any issue yet but it appears that it could have the same issue
in the future so just preemptively change it.

Fixes: f7b93d42945c ("arm64/alternatives: use subsections for replacement sequences")
Cc: <[email protected]> # 5.8.x
Link: https://github.com/ClangBuiltLinux/linux/issues/1347
Signed-off-by: Nathan Chancellor <[email protected]>
Reviewed-by: Sami Tolvanen <[email protected]>
Tested-by: Sami Tolvanen <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
Tested-by: Nick Desaulniers <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Catalin Marinas <[email protected]>
arch/arm64/include/asm/alternative-macros.h
This page took 0.053801 seconds and 4 git commands to generate.