diff options
Diffstat (limited to 'arch/s390/oprofile/hwsampler.c')
-rw-r--r-- | arch/s390/oprofile/hwsampler.c | 67 |
1 files changed, 3 insertions, 64 deletions
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c index 231cecafc2f1..bbca76ad6e1b 100644 --- a/arch/s390/oprofile/hwsampler.c +++ b/arch/s390/oprofile/hwsampler.c | |||
@@ -26,9 +26,6 @@ | |||
26 | #define MAX_NUM_SDB 511 | 26 | #define MAX_NUM_SDB 511 |
27 | #define MIN_NUM_SDB 1 | 27 | #define MIN_NUM_SDB 1 |
28 | 28 | ||
29 | #define ALERT_REQ_MASK 0x4000000000000000ul | ||
30 | #define BUFFER_FULL_MASK 0x8000000000000000ul | ||
31 | |||
32 | DECLARE_PER_CPU(struct hws_cpu_buffer, sampler_cpu_buffer); | 29 | DECLARE_PER_CPU(struct hws_cpu_buffer, sampler_cpu_buffer); |
33 | 30 | ||
34 | struct hws_execute_parms { | 31 | struct hws_execute_parms { |
@@ -65,43 +62,6 @@ static unsigned long interval; | |||
65 | static unsigned long min_sampler_rate; | 62 | static unsigned long min_sampler_rate; |
66 | static unsigned long max_sampler_rate; | 63 | static unsigned long max_sampler_rate; |
67 | 64 | ||
68 | static int ssctl(void *buffer) | ||
69 | { | ||
70 | int cc; | ||
71 | |||
72 | /* set in order to detect a program check */ | ||
73 | cc = 1; | ||
74 | |||
75 | asm volatile( | ||
76 | "0: .insn s,0xB2870000,0(%1)\n" | ||
77 | "1: ipm %0\n" | ||
78 | " srl %0,28\n" | ||
79 | "2:\n" | ||
80 | EX_TABLE(0b, 2b) EX_TABLE(1b, 2b) | ||
81 | : "+d" (cc), "+a" (buffer) | ||
82 | : "m" (*((struct hws_ssctl_request_block *)buffer)) | ||
83 | : "cc", "memory"); | ||
84 | |||
85 | return cc ? -EINVAL : 0 ; | ||
86 | } | ||
87 | |||
88 | static int qsi(void *buffer) | ||
89 | { | ||
90 | int cc; | ||
91 | cc = 1; | ||
92 | |||
93 | asm volatile( | ||
94 | "0: .insn s,0xB2860000,0(%1)\n" | ||
95 | "1: lhi %0,0\n" | ||
96 | "2:\n" | ||
97 | EX_TABLE(0b, 2b) EX_TABLE(1b, 2b) | ||
98 | : "=d" (cc), "+a" (buffer) | ||
99 | : "m" (*((struct hws_qsi_info_block *)buffer)) | ||
100 | : "cc", "memory"); | ||
101 | |||
102 | return cc ? -EINVAL : 0; | ||
103 | } | ||
104 | |||
105 | static void execute_qsi(void *parms) | 65 | static void execute_qsi(void *parms) |
106 | { | 66 | { |
107 | struct hws_execute_parms *ep = parms; | 67 | struct hws_execute_parms *ep = parms; |
@@ -113,7 +73,7 @@ static void execute_ssctl(void *parms) | |||
113 | { | 73 | { |
114 | struct hws_execute_parms *ep = parms; | 74 | struct hws_execute_parms *ep = parms; |
115 | 75 | ||
116 | ep->rc = ssctl(ep->buffer); | 76 | ep->rc = lsctl(ep->buffer); |
117 | } | 77 | } |
118 | 78 | ||
119 | static int smp_ctl_ssctl_stop(int cpu) | 79 | static int smp_ctl_ssctl_stop(int cpu) |
@@ -214,17 +174,6 @@ static int smp_ctl_qsi(int cpu) | |||
214 | return ep.rc; | 174 | return ep.rc; |
215 | } | 175 | } |
216 | 176 | ||
217 | static inline unsigned long *trailer_entry_ptr(unsigned long v) | ||
218 | { | ||
219 | void *ret; | ||
220 | |||
221 | ret = (void *)v; | ||
222 | ret += PAGE_SIZE; | ||
223 | ret -= sizeof(struct hws_trailer_entry); | ||
224 | |||
225 | return (unsigned long *) ret; | ||
226 | } | ||
227 | |||
228 | static void hws_ext_handler(struct ext_code ext_code, | 177 | static void hws_ext_handler(struct ext_code ext_code, |
229 | unsigned int param32, unsigned long param64) | 178 | unsigned int param32, unsigned long param64) |
230 | { | 179 | { |
@@ -256,16 +205,6 @@ static void init_all_cpu_buffers(void) | |||
256 | } | 205 | } |
257 | } | 206 | } |
258 | 207 | ||
259 | static int is_link_entry(unsigned long *s) | ||
260 | { | ||
261 | return *s & 0x1ul ? 1 : 0; | ||
262 | } | ||
263 | |||
264 | static unsigned long *get_next_sdbt(unsigned long *s) | ||
265 | { | ||
266 | return (unsigned long *) (*s & ~0x1ul); | ||
267 | } | ||
268 | |||
269 | static int prepare_cpu_buffers(void) | 208 | static int prepare_cpu_buffers(void) |
270 | { | 209 | { |
271 | int cpu; | 210 | int cpu; |
@@ -353,7 +292,7 @@ static int allocate_sdbt(int cpu) | |||
353 | } | 292 | } |
354 | *sdbt = sdb; | 293 | *sdbt = sdb; |
355 | trailer = trailer_entry_ptr(*sdbt); | 294 | trailer = trailer_entry_ptr(*sdbt); |
356 | *trailer = ALERT_REQ_MASK; | 295 | *trailer = SDB_TE_ALERT_REQ_MASK; |
357 | sdbt++; | 296 | sdbt++; |
358 | mutex_unlock(&hws_sem_oom); | 297 | mutex_unlock(&hws_sem_oom); |
359 | } | 298 | } |
@@ -829,7 +768,7 @@ static void worker_on_interrupt(unsigned int cpu) | |||
829 | 768 | ||
830 | trailer = trailer_entry_ptr(*sdbt); | 769 | trailer = trailer_entry_ptr(*sdbt); |
831 | /* leave loop if no more work to do */ | 770 | /* leave loop if no more work to do */ |
832 | if (!(*trailer & BUFFER_FULL_MASK)) { | 771 | if (!(*trailer & SDB_TE_BUFFER_FULL_MASK)) { |
833 | done = 1; | 772 | done = 1; |
834 | if (!hws_flush_all) | 773 | if (!hws_flush_all) |
835 | continue; | 774 | continue; |