s390/sysinfo: use basic block for stsi 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:
Heiko Carstens 2016-06-20 14:05:54 +02:00 committed by Martin Schwidefsky
parent 80a60f6ef1
commit 2c79813a1f
1 changed files with 17 additions and 8 deletions

View File

@ -20,13 +20,7 @@
int topology_max_mnest; int topology_max_mnest;
/* static inline int __stsi(void *sysinfo, int fc, int sel1, int sel2, int *lvl)
* stsi - store system information
*
* Returns the current configuration level if function code 0 was specified.
* Otherwise returns 0 on success or a negative value on error.
*/
int stsi(void *sysinfo, int fc, int sel1, int sel2)
{ {
register int r0 asm("0") = (fc << 28) | sel1; register int r0 asm("0") = (fc << 28) | sel1;
register int r1 asm("1") = sel2; register int r1 asm("1") = sel2;
@ -41,9 +35,24 @@ int stsi(void *sysinfo, int fc, int sel1, int sel2)
: "+d" (r0), "+d" (rc) : "+d" (r0), "+d" (rc)
: "d" (r1), "a" (sysinfo), "K" (-EOPNOTSUPP) : "d" (r1), "a" (sysinfo), "K" (-EOPNOTSUPP)
: "cc", "memory"); : "cc", "memory");
*lvl = ((unsigned int) r0) >> 28;
return rc;
}
/*
* stsi - store system information
*
* Returns the current configuration level if function code 0 was specified.
* Otherwise returns 0 on success or a negative value on error.
*/
int stsi(void *sysinfo, int fc, int sel1, int sel2)
{
int lvl, rc;
rc = __stsi(sysinfo, fc, sel1, sel2, &lvl);
if (rc) if (rc)
return rc; return rc;
return fc ? 0 : ((unsigned int) r0) >> 28; return fc ? 0 : lvl;
} }
EXPORT_SYMBOL(stsi); EXPORT_SYMBOL(stsi);