Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/cio: use basic blocks for i/o inline assemblies

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>
Acked-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
a4d9b97c 7b4ff87c

+82 -9
+82 -9
drivers/s390/cio/ioasm.c
··· 12 12 #include "orb.h" 13 13 #include "cio.h" 14 14 15 - int stsch(struct subchannel_id schid, struct schib *addr) 15 + static inline int __stsch(struct subchannel_id schid, struct schib *addr) 16 16 { 17 17 register struct subchannel_id reg1 asm ("1") = schid; 18 18 int ccode = -EIO; ··· 26 26 : "+d" (ccode), "=m" (*addr) 27 27 : "d" (reg1), "a" (addr) 28 28 : "cc"); 29 + return ccode; 30 + } 31 + 32 + int stsch(struct subchannel_id schid, struct schib *addr) 33 + { 34 + int ccode; 35 + 36 + ccode = __stsch(schid, addr); 29 37 trace_s390_cio_stsch(schid, addr, ccode); 30 38 31 39 return ccode; 32 40 } 33 41 EXPORT_SYMBOL(stsch); 34 42 35 - int msch(struct subchannel_id schid, struct schib *addr) 43 + static inline int __msch(struct subchannel_id schid, struct schib *addr) 36 44 { 37 45 register struct subchannel_id reg1 asm ("1") = schid; 38 46 int ccode = -EIO; ··· 54 46 : "+d" (ccode) 55 47 : "d" (reg1), "a" (addr), "m" (*addr) 56 48 : "cc"); 49 + return ccode; 50 + } 51 + 52 + int msch(struct subchannel_id schid, struct schib *addr) 53 + { 54 + int ccode; 55 + 56 + ccode = __msch(schid, addr); 57 57 trace_s390_cio_msch(schid, addr, ccode); 58 58 59 59 return ccode; 60 60 } 61 61 62 - int tsch(struct subchannel_id schid, struct irb *addr) 62 + static inline int __tsch(struct subchannel_id schid, struct irb *addr) 63 63 { 64 64 register struct subchannel_id reg1 asm ("1") = schid; 65 65 int ccode; ··· 79 63 : "=d" (ccode), "=m" (*addr) 80 64 : "d" (reg1), "a" (addr) 81 65 : "cc"); 66 + return ccode; 67 + } 68 + 69 + int tsch(struct subchannel_id schid, struct irb *addr) 70 + { 71 + int ccode; 72 + 73 + ccode = __tsch(schid, addr); 82 74 trace_s390_cio_tsch(schid, addr, ccode); 83 75 84 76 return ccode; 85 77 } 86 78 87 - int ssch(struct subchannel_id schid, union orb *addr) 79 + static inline int __ssch(struct subchannel_id schid, union orb *addr) 88 80 { 89 81 register struct subchannel_id reg1 asm("1") = schid; 90 82 int ccode = -EIO; ··· 106 82 : "+d" (ccode) 107 83 : "d" (reg1), "a" (addr), "m" (*addr) 108 84 : "cc", "memory"); 85 + return ccode; 86 + } 87 + 88 + int ssch(struct subchannel_id schid, union orb *addr) 89 + { 90 + int ccode; 91 + 92 + ccode = __ssch(schid, addr); 109 93 trace_s390_cio_ssch(schid, addr, ccode); 110 94 111 95 return ccode; 112 96 } 113 97 EXPORT_SYMBOL(ssch); 114 98 115 - int csch(struct subchannel_id schid) 99 + static inline int __csch(struct subchannel_id schid) 116 100 { 117 101 register struct subchannel_id reg1 asm("1") = schid; 118 102 int ccode; ··· 132 100 : "=d" (ccode) 133 101 : "d" (reg1) 134 102 : "cc"); 103 + return ccode; 104 + } 105 + 106 + int csch(struct subchannel_id schid) 107 + { 108 + int ccode; 109 + 110 + ccode = __csch(schid); 135 111 trace_s390_cio_csch(schid, ccode); 136 112 137 113 return ccode; ··· 180 140 } 181 141 EXPORT_SYMBOL(chsc); 182 142 183 - int rchp(struct chp_id chpid) 143 + static inline int __rchp(struct chp_id chpid) 184 144 { 185 145 register struct chp_id reg1 asm ("1") = chpid; 186 146 int ccode; ··· 191 151 " ipm %0\n" 192 152 " srl %0,28" 193 153 : "=d" (ccode) : "d" (reg1) : "cc"); 154 + return ccode; 155 + } 156 + 157 + int rchp(struct chp_id chpid) 158 + { 159 + int ccode; 160 + 161 + ccode = __rchp(chpid); 194 162 trace_s390_cio_rchp(chpid, ccode); 195 163 196 164 return ccode; 197 165 } 198 166 199 - int rsch(struct subchannel_id schid) 167 + static inline int __rsch(struct subchannel_id schid) 200 168 { 201 169 register struct subchannel_id reg1 asm("1") = schid; 202 170 int ccode; ··· 216 168 : "=d" (ccode) 217 169 : "d" (reg1) 218 170 : "cc", "memory"); 171 + 172 + return ccode; 173 + } 174 + 175 + int rsch(struct subchannel_id schid) 176 + { 177 + int ccode; 178 + 179 + ccode = __rsch(schid); 219 180 trace_s390_cio_rsch(schid, ccode); 220 181 221 182 return ccode; 222 183 } 223 184 224 - int hsch(struct subchannel_id schid) 185 + static inline int __hsch(struct subchannel_id schid) 225 186 { 226 187 register struct subchannel_id reg1 asm("1") = schid; 227 188 int ccode; ··· 242 185 : "=d" (ccode) 243 186 : "d" (reg1) 244 187 : "cc"); 188 + return ccode; 189 + } 190 + 191 + int hsch(struct subchannel_id schid) 192 + { 193 + int ccode; 194 + 195 + ccode = __hsch(schid); 245 196 trace_s390_cio_hsch(schid, ccode); 246 197 247 198 return ccode; 248 199 } 249 200 250 - int xsch(struct subchannel_id schid) 201 + static inline int __xsch(struct subchannel_id schid) 251 202 { 252 203 register struct subchannel_id reg1 asm("1") = schid; 253 204 int ccode; ··· 267 202 : "=d" (ccode) 268 203 : "d" (reg1) 269 204 : "cc"); 205 + return ccode; 206 + } 207 + 208 + int xsch(struct subchannel_id schid) 209 + { 210 + int ccode; 211 + 212 + ccode = __xsch(schid); 270 213 trace_s390_cio_xsch(schid, ccode); 271 214 272 215 return ccode;