Skip to content

Commit 53ae723

Browse files
ihaliphcahca
authored andcommitted
s390/test_unwind: use raw opcode instead of invalid instruction
Building with clang & LLVM_IAS=1 leads to an error: arch/s390/lib/test_unwind.c:179:4: error: invalid register pair " mvcl %%r1,%%r1\n" ^ The test creates an invalid instruction that would trap at runtime, but the LLVM inline assembler tries to validate it at compile time too. Use the raw instruction opcode instead. Reported-by: Nick Desaulniers <[email protected]> Signed-off-by: Ilie Halip <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Suggested-by: Ulrich Weigand <[email protected]> Link: ClangBuiltLinux#1421 Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Christian Borntraeger <[email protected]> Signed-off-by: Christian Borntraeger <[email protected]> [[email protected]: use illegal opcode, and update comment] Signed-off-by: Heiko Carstens <[email protected]>
1 parent 1360572 commit 53ae723

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/s390/lib/test_unwind.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,11 @@ static noinline int unwindme_func4(struct unwindme *u)
173173
}
174174

175175
/*
176-
* trigger specification exception
176+
* Trigger operation exception; use insn notation to bypass
177+
* llvm's integrated assembler sanity checks.
177178
*/
178179
asm volatile(
179-
" mvcl %%r1,%%r1\n"
180+
" .insn e,0x0000\n" /* illegal opcode */
180181
"0: nopr %%r7\n"
181182
EX_TABLE(0b, 0b)
182183
:);

0 commit comments

Comments
 (0)