]> git.itanic.dy.fi Git - linux-stable/commitdiff
s390/qdio: get rid of register asm
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 22 Jun 2021 13:26:16 +0000 (15:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 11:44:08 +0000 (12:44 +0100)
[ Upstream commit d3e2ff5436d6ee38b572ba5c01dc7994769bec54 ]

Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Stable-dep-of: 2862a2fdfae8 ("s390/qdio: fix do_sqbs() inline assembly constraint")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/s390/cio/qdio.h
drivers/s390/cio/qdio_main.c

index 3b0a4483a25205841283531374c4c3ffd6b3d755..e91d2a589957cedee8a5fc22803369a5a552e586 100644 (file)
@@ -88,15 +88,15 @@ enum qdio_irq_states {
 static inline int do_sqbs(u64 token, unsigned char state, int queue,
                          int *start, int *count)
 {
-       register unsigned long _ccq asm ("0") = *count;
-       register unsigned long _token asm ("1") = token;
        unsigned long _queuestart = ((unsigned long)queue << 32) | *start;
+       unsigned long _ccq = *count;
 
        asm volatile(
-               "       .insn   rsy,0xeb000000008A,%1,0,0(%2)"
-               : "+d" (_ccq), "+d" (_queuestart)
-               : "d" ((unsigned long)state), "d" (_token)
-               : "memory", "cc");
+               "       lgr     1,%[token]\n"
+               "       .insn   rsy,0xeb000000008a,%[qs],%[ccq],0(%[state])"
+               : [ccq] "+&d" (_ccq), [qs] "+&d" (_queuestart)
+               : [state] "d" ((unsigned long)state), [token] "d" (token)
+               : "memory", "cc", "1");
        *count = _ccq & 0xff;
        *start = _queuestart & 0xff;
 
@@ -106,16 +106,17 @@ static inline int do_sqbs(u64 token, unsigned char state, int queue,
 static inline int do_eqbs(u64 token, unsigned char *state, int queue,
                          int *start, int *count, int ack)
 {
-       register unsigned long _ccq asm ("0") = *count;
-       register unsigned long _token asm ("1") = token;
        unsigned long _queuestart = ((unsigned long)queue << 32) | *start;
        unsigned long _state = (unsigned long)ack << 63;
+       unsigned long _ccq = *count;
 
        asm volatile(
-               "       .insn   rrf,0xB99c0000,%1,%2,0,0"
-               : "+d" (_ccq), "+d" (_queuestart), "+d" (_state)
-               : "d" (_token)
-               : "memory", "cc");
+               "       lgr     1,%[token]\n"
+               "       .insn   rrf,0xb99c0000,%[qs],%[state],%[ccq],0"
+               : [ccq] "+&d" (_ccq), [qs] "+&d" (_queuestart),
+                 [state] "+&d" (_state)
+               : [token] "d" (token)
+               : "memory", "cc", "1");
        *count = _ccq & 0xff;
        *start = _queuestart & 0xff;
        *state = _state & 0xff;
index 5b63c505a2f7cf906e65fb148a56e6e54e038c02..620655bcbe80d7233704391054fc0cf294ff191b 100644 (file)
@@ -31,38 +31,41 @@ MODULE_DESCRIPTION("QDIO base support");
 MODULE_LICENSE("GPL");
 
 static inline int do_siga_sync(unsigned long schid,
-                              unsigned int out_mask, unsigned int in_mask,
+                              unsigned long out_mask, unsigned long in_mask,
                               unsigned int fc)
 {
-       register unsigned long __fc asm ("0") = fc;
-       register unsigned long __schid asm ("1") = schid;
-       register unsigned long out asm ("2") = out_mask;
-       register unsigned long in asm ("3") = in_mask;
        int cc;
 
        asm volatile(
+               "       lgr     0,%[fc]\n"
+               "       lgr     1,%[schid]\n"
+               "       lgr     2,%[out]\n"
+               "       lgr     3,%[in]\n"
                "       siga    0\n"
-               "       ipm     %0\n"
-               "       srl     %0,28\n"
-               : "=d" (cc)
-               : "d" (__fc), "d" (__schid), "d" (out), "d" (in) : "cc");
+               "       ipm     %[cc]\n"
+               "       srl     %[cc],28\n"
+               : [cc] "=&d" (cc)
+               : [fc] "d" (fc), [schid] "d" (schid),
+                 [out] "d" (out_mask), [in] "d" (in_mask)
+               : "cc", "0", "1", "2", "3");
        return cc;
 }
 
-static inline int do_siga_input(unsigned long schid, unsigned int mask,
-                               unsigned int fc)
+static inline int do_siga_input(unsigned long schid, unsigned long mask,
+                               unsigned long fc)
 {
-       register unsigned long __fc asm ("0") = fc;
-       register unsigned long __schid asm ("1") = schid;
-       register unsigned long __mask asm ("2") = mask;
        int cc;
 
        asm volatile(
+               "       lgr     0,%[fc]\n"
+               "       lgr     1,%[schid]\n"
+               "       lgr     2,%[mask]\n"
                "       siga    0\n"
-               "       ipm     %0\n"
-               "       srl     %0,28\n"
-               : "=d" (cc)
-               : "d" (__fc), "d" (__schid), "d" (__mask) : "cc");
+               "       ipm     %[cc]\n"
+               "       srl     %[cc],28\n"
+               : [cc] "=&d" (cc)
+               : [fc] "d" (fc), [schid] "d" (schid), [mask] "d" (mask)
+               : "cc", "0", "1", "2");
        return cc;
 }
 
@@ -78,23 +81,24 @@ static inline int do_siga_input(unsigned long schid, unsigned int mask,
  * Note: For IQDC unicast queues only the highest priority queue is processed.
  */
 static inline int do_siga_output(unsigned long schid, unsigned long mask,
-                                unsigned int *bb, unsigned int fc,
+                                unsigned int *bb, unsigned long fc,
                                 unsigned long aob)
 {
-       register unsigned long __fc asm("0") = fc;
-       register unsigned long __schid asm("1") = schid;
-       register unsigned long __mask asm("2") = mask;
-       register unsigned long __aob asm("3") = aob;
        int cc;
 
        asm volatile(
+               "       lgr     0,%[fc]\n"
+               "       lgr     1,%[schid]\n"
+               "       lgr     2,%[mask]\n"
+               "       lgr     3,%[aob]\n"
                "       siga    0\n"
-               "       ipm     %0\n"
-               "       srl     %0,28\n"
-               : "=d" (cc), "+d" (__fc), "+d" (__aob)
-               : "d" (__schid), "d" (__mask)
-               : "cc");
-       *bb = __fc >> 31;
+               "       lgr     %[fc],0\n"
+               "       ipm     %[cc]\n"
+               "       srl     %[cc],28\n"
+               : [cc] "=&d" (cc), [fc] "+&d" (fc)
+               : [schid] "d" (schid), [mask] "d" (mask), [aob] "d" (aob)
+               : "cc", "0", "1", "2", "3");
+       *bb = fc >> 31;
        return cc;
 }