]> git.baikalelectronics.ru Git - kernel.git/commit
objtool/x86: Fix elf_add_alternative() endianness
authorVasily Gorbik <gor@linux.ibm.com>
Wed, 12 May 2021 17:42:13 +0000 (19:42 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 12 May 2021 19:17:01 +0000 (21:17 +0200)
commit3058cec0c0a4324cfc502cfdffb6c7e4861b32d7
tree9a4b9a0f7beb3453214f17bee4db3a8934c5e549
parenta66523ef73fc0b9567da66e9ab5f2a1f6a69969e
objtool/x86: Fix elf_add_alternative() endianness

Currently x86 kernel cross-compiled on big endian system fails at boot with:

  kernel BUG at arch/x86/kernel/alternative.c:258!

Corresponding bug condition look like the following:

  BUG_ON(feature >= (NCAPINTS + NBUGINTS) * 32);

Fix that by converting alternative feature/cpuid to target endianness.

Fixes: 8f1c0c558438 ("objtool/x86: Rewrite retpoline thunk calls")
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: https://lore.kernel.org/r/patch-2.thread-6c9df9.git-6c9df9a8098d.your-ad-here.call-01620841104-ext-2554@work.hours
tools/objtool/arch/x86/decode.c