aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-internal.h
diff options
context:
space:
mode:
authorMathieu Desnoyers <[email protected]>2019-06-30 09:56:13 -0400
committerShuah Khan <[email protected]>2019-07-08 13:00:41 -0600
commitee8a84c60bcc1f1615bd9cb3edfe501e26cdc85b (patch)
treea1ed1858d71619f592b03087dfe9692f027e028c /lib/mpi/mpi-internal.h
parentf4fb8a97dc903cc278feb45cff55622e25360b89 (diff)
rseq/selftests: Fix Thumb mode build failure on arm32
Using ".arm .inst" for the arm signature introduces build issues for programs compiled in Thumb mode because the assembler stays in the arm mode for the rest of the inline assembly. Revert to using a ".word" to express the signature as data instead. The choice of signature is a valid trap instruction on arm32 little endian, where both code and data are little endian. ARMv6+ big endian (BE8) generates mixed endianness code vs data: little-endian code and big-endian data. The data value of the signature needs to have its byte order reversed to generate the trap instruction. Prior to ARMv6, -mbig-endian generates big-endian code and data (which match), so the endianness of the data representation of the signature should not be reversed. However, the choice between BE32 and BE8 is done by the linker, so we cannot know whether code and data endianness will be mixed before the linker is invoked. So rather than try to play tricks with the linker, the rseq signature is simply data (not a trap instruction) prior to ARMv6 on big endian. This is why the signature is expressed as data (.word) rather than as instruction (.inst) in assembler. Because a ".word" is used to emit the signature, it will be interpreted as a literal pool by a disassembler, not as an actual instruction. Considering that the signature is not meant to be executed except in scenarios where the program execution is completely bogus, this should not be an issue. Signed-off-by: Mathieu Desnoyers <[email protected]> Acked-by: Will Deacon <[email protected]> CC: Peter Zijlstra <[email protected]> CC: Thomas Gleixner <[email protected]> CC: Joel Fernandes <[email protected]> CC: Catalin Marinas <[email protected]> CC: Dave Watson <[email protected]> CC: Will Deacon <[email protected]> CC: Shuah Khan <[email protected]> CC: Andi Kleen <[email protected]> CC: [email protected] CC: "H . Peter Anvin" <[email protected]> CC: Chris Lameter <[email protected]> CC: Russell King <[email protected]> CC: Michael Kerrisk <[email protected]> CC: "Paul E . McKenney" <[email protected]> CC: Paul Turner <[email protected]> CC: Boqun Feng <[email protected]> CC: Josh Triplett <[email protected]> CC: Steven Rostedt <[email protected]> CC: Ben Maurer <[email protected]> CC: [email protected] CC: Andy Lutomirski <[email protected]> CC: Andrew Morton <[email protected]> CC: Linus Torvalds <[email protected]> CC: Carlos O'Donell <[email protected]> CC: Florian Weimer <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-internal.h')
0 files changed, 0 insertions, 0 deletions