diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2016-06-20 08:05:54 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2016-06-28 03:32:36 -0400 |
commit | 2c79813a1f459dd702f9b324a96b0849dd02a6a4 (patch) | |
tree | 6e67856b1018819b8e6986081d3c88c4de21efc9 | |
parent | 80a60f6ef19a0d4d06a55065f69fa3dbbbac8bcc (diff) |
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>
-rw-r--r-- | arch/s390/kernel/sysinfo.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/arch/s390/kernel/sysinfo.c b/arch/s390/kernel/sysinfo.c index 96d81502e599..050b8d067d3b 100644 --- a/arch/s390/kernel/sysinfo.c +++ b/arch/s390/kernel/sysinfo.c | |||
@@ -20,13 +20,7 @@ | |||
20 | 20 | ||
21 | int topology_max_mnest; | 21 | int topology_max_mnest; |
22 | 22 | ||
23 | /* | 23 | static inline int __stsi(void *sysinfo, int fc, int sel1, int sel2, int *lvl) |
24 | * stsi - store system information | ||
25 | * | ||
26 | * Returns the current configuration level if function code 0 was specified. | ||
27 | * Otherwise returns 0 on success or a negative value on error. | ||
28 | */ | ||
29 | int stsi(void *sysinfo, int fc, int sel1, int sel2) | ||
30 | { | 24 | { |
31 | register int r0 asm("0") = (fc << 28) | sel1; | 25 | register int r0 asm("0") = (fc << 28) | sel1; |
32 | register int r1 asm("1") = sel2; | 26 | register int r1 asm("1") = sel2; |
@@ -41,9 +35,24 @@ int stsi(void *sysinfo, int fc, int sel1, int sel2) | |||
41 | : "+d" (r0), "+d" (rc) | 35 | : "+d" (r0), "+d" (rc) |
42 | : "d" (r1), "a" (sysinfo), "K" (-EOPNOTSUPP) | 36 | : "d" (r1), "a" (sysinfo), "K" (-EOPNOTSUPP) |
43 | : "cc", "memory"); | 37 | : "cc", "memory"); |
38 | *lvl = ((unsigned int) r0) >> 28; | ||
39 | return rc; | ||
40 | } | ||
41 | |||
42 | /* | ||
43 | * stsi - store system information | ||
44 | * | ||
45 | * Returns the current configuration level if function code 0 was specified. | ||
46 | * Otherwise returns 0 on success or a negative value on error. | ||
47 | */ | ||
48 | int stsi(void *sysinfo, int fc, int sel1, int sel2) | ||
49 | { | ||
50 | int lvl, rc; | ||
51 | |||
52 | rc = __stsi(sysinfo, fc, sel1, sel2, &lvl); | ||
44 | if (rc) | 53 | if (rc) |
45 | return rc; | 54 | return rc; |
46 | return fc ? 0 : ((unsigned int) r0) >> 28; | 55 | return fc ? 0 : lvl; |
47 | } | 56 | } |
48 | EXPORT_SYMBOL(stsi); | 57 | EXPORT_SYMBOL(stsi); |
49 | 58 | ||