aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Oberparleiter <oberpar@linux.vnet.ibm.com>2015-12-18 06:59:40 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2015-12-18 08:59:37 -0500
commit11b64c8acca05d7e50a873e0e8758b75d6d6650f (patch)
tree90d2c2012ec94000c8041900e23253dc851f90b0
parent42248979d5705e056b509cdcfb548e40f708cba8 (diff)
s390/cio: Change I/O instructions from inline to normal functions
Adding tracepoints to inline functions adds tracepoint invocation code for each instance where the function is inlined. The resulting increase in kernel code size can have negative impact: - More cache misses in instruction cache - Reduced amount of DMA-capable memory Therefore change all functions implementing I/O instructions from inline to normal functions. Bloat-o-meter summary after change (using performance_defconfig): add/remove: 24/2 grow/shrink: 4/39 up/down: 2205/-4858 (-2653) Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--drivers/s390/cio/Makefile2
-rw-r--r--drivers/s390/cio/ioasm.c224
-rw-r--r--drivers/s390/cio/ioasm.h220
3 files changed, 238 insertions, 208 deletions
diff --git a/drivers/s390/cio/Makefile b/drivers/s390/cio/Makefile
index 2c7cf0b3c5a0..3ab9aedeb84a 100644
--- a/drivers/s390/cio/Makefile
+++ b/drivers/s390/cio/Makefile
@@ -6,7 +6,7 @@
6CFLAGS_trace.o := -I$(src) 6CFLAGS_trace.o := -I$(src)
7 7
8obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o idset.o isc.o \ 8obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o idset.o isc.o \
9 fcx.o itcw.o crw.o ccwreq.o trace.o 9 fcx.o itcw.o crw.o ccwreq.o trace.o ioasm.o
10ccw_device-objs += device.o device_fsm.o device_ops.o 10ccw_device-objs += device.o device_fsm.o device_ops.o
11ccw_device-objs += device_id.o device_pgid.o device_status.o 11ccw_device-objs += device_id.o device_pgid.o device_status.o
12obj-y += ccw_device.o cmf.o 12obj-y += ccw_device.o cmf.o
diff --git a/drivers/s390/cio/ioasm.c b/drivers/s390/cio/ioasm.c
new file mode 100644
index 000000000000..98984818618f
--- /dev/null
+++ b/drivers/s390/cio/ioasm.c
@@ -0,0 +1,224 @@
1/*
2 * Channel subsystem I/O instructions.
3 */
4
5#include <linux/export.h>
6
7#include <asm/chpid.h>
8#include <asm/schid.h>
9#include <asm/crw.h>
10
11#include "ioasm.h"
12#include "orb.h"
13#include "cio.h"
14
15int stsch(struct subchannel_id schid, struct schib *addr)
16{
17 register struct subchannel_id reg1 asm ("1") = schid;
18 int ccode = -EIO;
19
20 asm volatile(
21 " stsch 0(%3)\n"
22 "0: ipm %0\n"
23 " srl %0,28\n"
24 "1:\n"
25 EX_TABLE(0b, 1b)
26 : "+d" (ccode), "=m" (*addr)
27 : "d" (reg1), "a" (addr)
28 : "cc");
29 trace_s390_cio_stsch(schid, addr, ccode);
30
31 return ccode;
32}
33EXPORT_SYMBOL(stsch);
34
35int msch(struct subchannel_id schid, struct schib *addr)
36{
37 register struct subchannel_id reg1 asm ("1") = schid;
38 int ccode = -EIO;
39
40 asm volatile(
41 " msch 0(%2)\n"
42 "0: ipm %0\n"
43 " srl %0,28\n"
44 "1:\n"
45 EX_TABLE(0b, 1b)
46 : "+d" (ccode)
47 : "d" (reg1), "a" (addr), "m" (*addr)
48 : "cc");
49 trace_s390_cio_msch(schid, addr, ccode);
50
51 return ccode;
52}
53
54int tsch(struct subchannel_id schid, struct irb *addr)
55{
56 register struct subchannel_id reg1 asm ("1") = schid;
57 int ccode;
58
59 asm volatile(
60 " tsch 0(%3)\n"
61 " ipm %0\n"
62 " srl %0,28"
63 : "=d" (ccode), "=m" (*addr)
64 : "d" (reg1), "a" (addr)
65 : "cc");
66 trace_s390_cio_tsch(schid, addr, ccode);
67
68 return ccode;
69}
70
71int ssch(struct subchannel_id schid, union orb *addr)
72{
73 register struct subchannel_id reg1 asm("1") = schid;
74 int ccode = -EIO;
75
76 asm volatile(
77 " ssch 0(%2)\n"
78 "0: ipm %0\n"
79 " srl %0,28\n"
80 "1:\n"
81 EX_TABLE(0b, 1b)
82 : "+d" (ccode)
83 : "d" (reg1), "a" (addr), "m" (*addr)
84 : "cc", "memory");
85 trace_s390_cio_ssch(schid, addr, ccode);
86
87 return ccode;
88}
89EXPORT_SYMBOL(ssch);
90
91int csch(struct subchannel_id schid)
92{
93 register struct subchannel_id reg1 asm("1") = schid;
94 int ccode;
95
96 asm volatile(
97 " csch\n"
98 " ipm %0\n"
99 " srl %0,28"
100 : "=d" (ccode)
101 : "d" (reg1)
102 : "cc");
103 trace_s390_cio_csch(schid, ccode);
104
105 return ccode;
106}
107EXPORT_SYMBOL(csch);
108
109int tpi(struct tpi_info *addr)
110{
111 int ccode;
112
113 asm volatile(
114 " tpi 0(%2)\n"
115 " ipm %0\n"
116 " srl %0,28"
117 : "=d" (ccode), "=m" (*addr)
118 : "a" (addr)
119 : "cc");
120 trace_s390_cio_tpi(addr, ccode);
121
122 return ccode;
123}
124
125int chsc(void *chsc_area)
126{
127 typedef struct { char _[4096]; } addr_type;
128 int cc;
129
130 asm volatile(
131 " .insn rre,0xb25f0000,%2,0\n"
132 " ipm %0\n"
133 " srl %0,28\n"
134 : "=d" (cc), "=m" (*(addr_type *) chsc_area)
135 : "d" (chsc_area), "m" (*(addr_type *) chsc_area)
136 : "cc");
137 trace_s390_cio_chsc(chsc_area, cc);
138
139 return cc;
140}
141EXPORT_SYMBOL(chsc);
142
143int rchp(struct chp_id chpid)
144{
145 register struct chp_id reg1 asm ("1") = chpid;
146 int ccode;
147
148 asm volatile(
149 " lr 1,%1\n"
150 " rchp\n"
151 " ipm %0\n"
152 " srl %0,28"
153 : "=d" (ccode) : "d" (reg1) : "cc");
154 trace_s390_cio_rchp(chpid, ccode);
155
156 return ccode;
157}
158
159int rsch(struct subchannel_id schid)
160{
161 register struct subchannel_id reg1 asm("1") = schid;
162 int ccode;
163
164 asm volatile(
165 " rsch\n"
166 " ipm %0\n"
167 " srl %0,28"
168 : "=d" (ccode)
169 : "d" (reg1)
170 : "cc", "memory");
171 trace_s390_cio_rsch(schid, ccode);
172
173 return ccode;
174}
175
176int hsch(struct subchannel_id schid)
177{
178 register struct subchannel_id reg1 asm("1") = schid;
179 int ccode;
180
181 asm volatile(
182 " hsch\n"
183 " ipm %0\n"
184 " srl %0,28"
185 : "=d" (ccode)
186 : "d" (reg1)
187 : "cc");
188 trace_s390_cio_hsch(schid, ccode);
189
190 return ccode;
191}
192
193int xsch(struct subchannel_id schid)
194{
195 register struct subchannel_id reg1 asm("1") = schid;
196 int ccode;
197
198 asm volatile(
199 " xsch\n"
200 " ipm %0\n"
201 " srl %0,28"
202 : "=d" (ccode)
203 : "d" (reg1)
204 : "cc");
205 trace_s390_cio_xsch(schid, ccode);
206
207 return ccode;
208}
209
210int stcrw(struct crw *crw)
211{
212 int ccode;
213
214 asm volatile(
215 " stcrw 0(%2)\n"
216 " ipm %0\n"
217 " srl %0,28\n"
218 : "=d" (ccode), "=m" (*crw)
219 : "a" (crw)
220 : "cc");
221 trace_s390_cio_stcrw(crw, ccode);
222
223 return ccode;
224}
diff --git a/drivers/s390/cio/ioasm.h b/drivers/s390/cio/ioasm.h
index 11e255a4fbad..b31ee6bff1e4 100644
--- a/drivers/s390/cio/ioasm.h
+++ b/drivers/s390/cio/ioasm.h
@@ -9,214 +9,20 @@
9#include "trace.h" 9#include "trace.h"
10 10
11/* 11/*
12 * Some S390 specific IO instructions as inline 12 * Some S390 specific IO instructions
13 */ 13 */
14 14
15static inline int stsch(struct subchannel_id schid, struct schib *addr) 15int stsch(struct subchannel_id schid, struct schib *addr);
16{ 16int msch(struct subchannel_id schid, struct schib *addr);
17 register struct subchannel_id reg1 asm ("1") = schid; 17int tsch(struct subchannel_id schid, struct irb *addr);
18 int ccode = -EIO; 18int ssch(struct subchannel_id schid, union orb *addr);
19 19int csch(struct subchannel_id schid);
20 asm volatile( 20int tpi(struct tpi_info *addr);
21 " stsch 0(%3)\n" 21int chsc(void *chsc_area);
22 "0: ipm %0\n" 22int rchp(struct chp_id chpid);
23 " srl %0,28\n" 23int rsch(struct subchannel_id schid);
24 "1:\n" 24int hsch(struct subchannel_id schid);
25 EX_TABLE(0b,1b) 25int xsch(struct subchannel_id schid);
26 : "+d" (ccode), "=m" (*addr) 26int stcrw(struct crw *crw);
27 : "d" (reg1), "a" (addr)
28 : "cc");
29 trace_s390_cio_stsch(schid, addr, ccode);
30
31 return ccode;
32}
33
34static inline int msch(struct subchannel_id schid, struct schib *addr)
35{
36 register struct subchannel_id reg1 asm ("1") = schid;
37 int ccode = -EIO;
38
39 asm volatile(
40 " msch 0(%2)\n"
41 "0: ipm %0\n"
42 " srl %0,28\n"
43 "1:\n"
44 EX_TABLE(0b,1b)
45 : "+d" (ccode)
46 : "d" (reg1), "a" (addr), "m" (*addr)
47 : "cc");
48 trace_s390_cio_msch(schid, addr, ccode);
49
50 return ccode;
51}
52
53static inline int tsch(struct subchannel_id schid, struct irb *addr)
54{
55 register struct subchannel_id reg1 asm ("1") = schid;
56 int ccode;
57
58 asm volatile(
59 " tsch 0(%3)\n"
60 " ipm %0\n"
61 " srl %0,28"
62 : "=d" (ccode), "=m" (*addr)
63 : "d" (reg1), "a" (addr)
64 : "cc");
65 trace_s390_cio_tsch(schid, addr, ccode);
66
67 return ccode;
68}
69
70static inline int ssch(struct subchannel_id schid, union orb *addr)
71{
72 register struct subchannel_id reg1 asm("1") = schid;
73 int ccode = -EIO;
74
75 asm volatile(
76 " ssch 0(%2)\n"
77 "0: ipm %0\n"
78 " srl %0,28\n"
79 "1:\n"
80 EX_TABLE(0b, 1b)
81 : "+d" (ccode)
82 : "d" (reg1), "a" (addr), "m" (*addr)
83 : "cc", "memory");
84 trace_s390_cio_ssch(schid, addr, ccode);
85
86 return ccode;
87}
88
89static inline int csch(struct subchannel_id schid)
90{
91 register struct subchannel_id reg1 asm("1") = schid;
92 int ccode;
93
94 asm volatile(
95 " csch\n"
96 " ipm %0\n"
97 " srl %0,28"
98 : "=d" (ccode)
99 : "d" (reg1)
100 : "cc");
101 trace_s390_cio_csch(schid, ccode);
102
103 return ccode;
104}
105
106static inline int tpi(struct tpi_info *addr)
107{
108 int ccode;
109
110 asm volatile(
111 " tpi 0(%2)\n"
112 " ipm %0\n"
113 " srl %0,28"
114 : "=d" (ccode), "=m" (*addr)
115 : "a" (addr)
116 : "cc");
117 trace_s390_cio_tpi(addr, ccode);
118
119 return ccode;
120}
121
122static inline int chsc(void *chsc_area)
123{
124 typedef struct { char _[4096]; } addr_type;
125 int cc;
126
127 asm volatile(
128 " .insn rre,0xb25f0000,%2,0\n"
129 " ipm %0\n"
130 " srl %0,28\n"
131 : "=d" (cc), "=m" (*(addr_type *) chsc_area)
132 : "d" (chsc_area), "m" (*(addr_type *) chsc_area)
133 : "cc");
134 trace_s390_cio_chsc(chsc_area, cc);
135
136 return cc;
137}
138
139static inline int rchp(struct chp_id chpid)
140{
141 register struct chp_id reg1 asm ("1") = chpid;
142 int ccode;
143
144 asm volatile(
145 " lr 1,%1\n"
146 " rchp\n"
147 " ipm %0\n"
148 " srl %0,28"
149 : "=d" (ccode) : "d" (reg1) : "cc");
150 trace_s390_cio_rchp(chpid, ccode);
151
152 return ccode;
153}
154
155static inline int rsch(struct subchannel_id schid)
156{
157 register struct subchannel_id reg1 asm("1") = schid;
158 int ccode;
159
160 asm volatile(
161 " rsch\n"
162 " ipm %0\n"
163 " srl %0,28"
164 : "=d" (ccode)
165 : "d" (reg1)
166 : "cc", "memory");
167 trace_s390_cio_rsch(schid, ccode);
168
169 return ccode;
170}
171
172static inline int hsch(struct subchannel_id schid)
173{
174 register struct subchannel_id reg1 asm("1") = schid;
175 int ccode;
176
177 asm volatile(
178 " hsch\n"
179 " ipm %0\n"
180 " srl %0,28"
181 : "=d" (ccode)
182 : "d" (reg1)
183 : "cc");
184 trace_s390_cio_hsch(schid, ccode);
185
186 return ccode;
187}
188
189static inline int xsch(struct subchannel_id schid)
190{
191 register struct subchannel_id reg1 asm("1") = schid;
192 int ccode;
193
194 asm volatile(
195 " xsch\n"
196 " ipm %0\n"
197 " srl %0,28"
198 : "=d" (ccode)
199 : "d" (reg1)
200 : "cc");
201 trace_s390_cio_xsch(schid, ccode);
202
203 return ccode;
204}
205
206static inline int stcrw(struct crw *crw)
207{
208 int ccode;
209
210 asm volatile(
211 " stcrw 0(%2)\n"
212 " ipm %0\n"
213 " srl %0,28\n"
214 : "=d" (ccode), "=m" (*crw)
215 : "a" (crw)
216 : "cc");
217 trace_s390_cio_stcrw(crw, ccode);
218
219 return ccode;
220}
221 27
222#endif 28#endif