]> git.karo-electronics.de Git - linux-beck.git/commitdiff
s390/cpumf: use basic block for ecctr inline assembly
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 20 Jun 2016 12:06:54 +0000 (14:06 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 28 Jun 2016 07:32:38 +0000 (09:32 +0200)
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>
arch/s390/include/asm/cpu_mf.h

index 9dd04b9e9782128135cfe9aa847a0e66b85812f7..03516476127bb250c42b8b51707b35e0ff04815c 100644 (file)
@@ -169,16 +169,27 @@ static inline int lcctl(u64 ctl)
 }
 
 /* Extract CPU counter */
-static inline int ecctr(u64 ctr, u64 *val)
+static inline int __ecctr(u64 ctr, u64 *content)
 {
-       register u64 content asm("4") = 0;
+       register u64 _content asm("4") = 0;
        int cc;
 
        asm volatile (
                "       .insn   rre,0xb2e40000,%0,%2\n"
                "       ipm     %1\n"
                "       srl     %1,28\n"
-               : "=d" (content), "=d" (cc) : "d" (ctr) : "cc");
+               : "=d" (_content), "=d" (cc) : "d" (ctr) : "cc");
+       *content = _content;
+       return cc;
+}
+
+/* Extract CPU counter */
+static inline int ecctr(u64 ctr, u64 *val)
+{
+       u64 content;
+       int cc;
+
+       cc = __ecctr(ctr, &content);
        if (!cc)
                *val = content;
        return cc;