]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Work around inline asm issues in alternate feature sections
authorBill Wendling <morbo@google.com>
Fri, 20 Nov 2020 22:40:34 +0000 (14:40 -0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 26 Nov 2020 11:05:43 +0000 (22:05 +1100)
commit0c9b1687b2c5b4f3f5224135479917d14c5d1f98
tree09670d0116c292a3a12327f7d469c8697a59324b
parent20ee963ca71a456d78dfd018dd5b61daeca50876
powerpc: Work around inline asm issues in alternate feature sections

The clang toolchain treats inline assembly a bit differently than
straight assembly code. In particular, inline assembly doesn't have
the complete context available to resolve expressions. This is
intentional to avoid divergence in the resulting assembly code.

We can work around this issue by borrowing a workaround done for ARM,
i.e. not directly testing the labels themselves, but by moving the
current output pointer by a value that should always be zero. If this
value is not null, then we will trigger a backward move, which is
explicitly forbidden.

Signed-off-by: Bill Wendling <morbo@google.com>
[mpe: Put it in a macro and only do the workaround for clang]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201120224034.191382-4-morbo@google.com
arch/powerpc/include/asm/feature-fixups.h