s390/mm: use basic block for essa inline assembly
Use only simple inline assemblies which consist of a single basic block if the register asm construct is being used. Otherwise gcc would generate broken code if the compiler option --sanitize-coverage=trace-pc would be used. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
db7f5eef3d
commit
931641c639
|
@ -34,20 +34,25 @@ static int __init cmma(char *str)
|
||||||
}
|
}
|
||||||
__setup("cmma=", cmma);
|
__setup("cmma=", cmma);
|
||||||
|
|
||||||
void __init cmma_init(void)
|
static inline int cmma_test_essa(void)
|
||||||
{
|
{
|
||||||
register unsigned long tmp asm("0") = 0;
|
register unsigned long tmp asm("0") = 0;
|
||||||
register int rc asm("1") = -EOPNOTSUPP;
|
register int rc asm("1") = -EOPNOTSUPP;
|
||||||
|
|
||||||
if (!cmma_flag)
|
|
||||||
return;
|
|
||||||
asm volatile(
|
asm volatile(
|
||||||
" .insn rrf,0xb9ab0000,%1,%1,0,0\n"
|
" .insn rrf,0xb9ab0000,%1,%1,0,0\n"
|
||||||
"0: la %0,0\n"
|
"0: la %0,0\n"
|
||||||
"1:\n"
|
"1:\n"
|
||||||
EX_TABLE(0b,1b)
|
EX_TABLE(0b,1b)
|
||||||
: "+&d" (rc), "+&d" (tmp));
|
: "+&d" (rc), "+&d" (tmp));
|
||||||
if (rc)
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
void __init cmma_init(void)
|
||||||
|
{
|
||||||
|
if (!cmma_flag)
|
||||||
|
return;
|
||||||
|
if (cmma_test_essa())
|
||||||
cmma_flag = 0;
|
cmma_flag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue