| .. | .. |
|---|
| 37 | 37 | { |
|---|
| 38 | 38 | u64 timer; |
|---|
| 39 | 39 | |
|---|
| 40 | | - asm volatile("stpt %0" : "=m" (timer)); |
|---|
| 40 | + asm volatile("stpt %0" : "=Q" (timer)); |
|---|
| 41 | 41 | return timer; |
|---|
| 42 | 42 | } |
|---|
| 43 | 43 | |
|---|
| .. | .. |
|---|
| 48 | 48 | asm volatile( |
|---|
| 49 | 49 | " stpt %0\n" /* Store current cpu timer value */ |
|---|
| 50 | 50 | " spt %1" /* Set new value imm. afterwards */ |
|---|
| 51 | | - : "=m" (timer) : "m" (expires)); |
|---|
| 51 | + : "=Q" (timer) : "Q" (expires)); |
|---|
| 52 | 52 | S390_lowcore.system_timer += S390_lowcore.last_update_timer - timer; |
|---|
| 53 | 53 | S390_lowcore.last_update_timer = expires; |
|---|
| 54 | 54 | } |
|---|
| .. | .. |
|---|
| 69 | 69 | u64 delta, fac, mult, div; |
|---|
| 70 | 70 | int i; |
|---|
| 71 | 71 | |
|---|
| 72 | | - stcctm5(smp_cpu_mtid + 1, cycles_new); |
|---|
| 72 | + stcctm(MT_DIAG, smp_cpu_mtid + 1, cycles_new); |
|---|
| 73 | 73 | cycles_old = this_cpu_ptr(mt_cycles); |
|---|
| 74 | 74 | fac = 1; |
|---|
| 75 | 75 | mult = div = 0; |
|---|
| .. | .. |
|---|
| 124 | 124 | */ |
|---|
| 125 | 125 | static int do_account_vtime(struct task_struct *tsk) |
|---|
| 126 | 126 | { |
|---|
| 127 | | - u64 timer, clock, user, guest, system, hardirq, softirq, steal; |
|---|
| 127 | + u64 timer, clock, user, guest, system, hardirq, softirq; |
|---|
| 128 | 128 | |
|---|
| 129 | 129 | timer = S390_lowcore.last_update_timer; |
|---|
| 130 | 130 | clock = S390_lowcore.last_update_clock; |
|---|
| .. | .. |
|---|
| 135 | 135 | #else |
|---|
| 136 | 136 | " stck %1" /* Store current tod clock value */ |
|---|
| 137 | 137 | #endif |
|---|
| 138 | | - : "=m" (S390_lowcore.last_update_timer), |
|---|
| 139 | | - "=m" (S390_lowcore.last_update_clock)); |
|---|
| 138 | + : "=Q" (S390_lowcore.last_update_timer), |
|---|
| 139 | + "=Q" (S390_lowcore.last_update_clock) |
|---|
| 140 | + : : "cc"); |
|---|
| 140 | 141 | clock = S390_lowcore.last_update_clock - clock; |
|---|
| 141 | 142 | timer -= S390_lowcore.last_update_timer; |
|---|
| 142 | 143 | |
|---|
| .. | .. |
|---|
| 182 | 183 | if (softirq) |
|---|
| 183 | 184 | account_system_index_scaled(tsk, softirq, CPUTIME_SOFTIRQ); |
|---|
| 184 | 185 | |
|---|
| 185 | | - steal = S390_lowcore.steal_timer; |
|---|
| 186 | | - if ((s64) steal > 0) { |
|---|
| 187 | | - S390_lowcore.steal_timer = 0; |
|---|
| 188 | | - account_steal_time(cputime_to_nsecs(steal)); |
|---|
| 189 | | - } |
|---|
| 190 | | - |
|---|
| 191 | 186 | return virt_timer_forward(user + guest + system + hardirq + softirq); |
|---|
| 192 | 187 | } |
|---|
| 193 | 188 | |
|---|
| .. | .. |
|---|
| 213 | 208 | */ |
|---|
| 214 | 209 | void vtime_flush(struct task_struct *tsk) |
|---|
| 215 | 210 | { |
|---|
| 211 | + u64 steal, avg_steal; |
|---|
| 212 | + |
|---|
| 216 | 213 | if (do_account_vtime(tsk)) |
|---|
| 217 | 214 | virt_timer_expire(); |
|---|
| 215 | + |
|---|
| 216 | + steal = S390_lowcore.steal_timer; |
|---|
| 217 | + avg_steal = S390_lowcore.avg_steal_timer / 2; |
|---|
| 218 | + if ((s64) steal > 0) { |
|---|
| 219 | + S390_lowcore.steal_timer = 0; |
|---|
| 220 | + account_steal_time(cputime_to_nsecs(steal)); |
|---|
| 221 | + avg_steal += steal; |
|---|
| 222 | + } |
|---|
| 223 | + S390_lowcore.avg_steal_timer = avg_steal; |
|---|
| 218 | 224 | } |
|---|
| 219 | 225 | |
|---|
| 220 | 226 | /* |
|---|
| .. | .. |
|---|
| 242 | 248 | } |
|---|
| 243 | 249 | EXPORT_SYMBOL_GPL(vtime_account_irq_enter); |
|---|
| 244 | 250 | |
|---|
| 245 | | -void vtime_account_system(struct task_struct *tsk) |
|---|
| 251 | +void vtime_account_kernel(struct task_struct *tsk) |
|---|
| 246 | 252 | __attribute__((alias("vtime_account_irq_enter"))); |
|---|
| 247 | | -EXPORT_SYMBOL_GPL(vtime_account_system); |
|---|
| 253 | +EXPORT_SYMBOL_GPL(vtime_account_kernel); |
|---|
| 248 | 254 | |
|---|
| 249 | 255 | /* |
|---|
| 250 | 256 | * Sorted add to a list. List is linear searched until first bigger |
|---|
| .. | .. |
|---|
| 432 | 438 | __this_cpu_write(mt_scaling_jiffies, jiffies); |
|---|
| 433 | 439 | __this_cpu_write(mt_scaling_mult, 1); |
|---|
| 434 | 440 | __this_cpu_write(mt_scaling_div, 1); |
|---|
| 435 | | - stcctm5(smp_cpu_mtid + 1, this_cpu_ptr(mt_cycles)); |
|---|
| 441 | + stcctm(MT_DIAG, smp_cpu_mtid + 1, this_cpu_ptr(mt_cycles)); |
|---|
| 436 | 442 | } |
|---|
| 437 | 443 | } |
|---|