aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/vtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/vtime.c')
-rw-r--r--arch/s390/kernel/vtime.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index 3479f1b0d4e0..2d6228f60cd6 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -19,11 +19,13 @@
19#include <linux/kernel_stat.h> 19#include <linux/kernel_stat.h>
20#include <linux/rcupdate.h> 20#include <linux/rcupdate.h>
21#include <linux/posix-timers.h> 21#include <linux/posix-timers.h>
22#include <linux/cpu.h>
23#include <linux/kprobes.h>
22 24
23#include <asm/s390_ext.h>
24#include <asm/timer.h> 25#include <asm/timer.h>
25#include <asm/irq_regs.h> 26#include <asm/irq_regs.h>
26#include <asm/cputime.h> 27#include <asm/cputime.h>
28#include <asm/irq.h>
27 29
28static DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer); 30static DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer);
29 31
@@ -42,7 +44,7 @@ static inline void set_vtimer(__u64 expires)
42 __u64 timer; 44 __u64 timer;
43 45
44 asm volatile (" STPT %0\n" /* Store current cpu timer value */ 46 asm volatile (" STPT %0\n" /* Store current cpu timer value */
45 " SPT %1" /* Set new value immediatly afterwards */ 47 " SPT %1" /* Set new value immediately afterwards */
46 : "=m" (timer) : "m" (expires) ); 48 : "=m" (timer) : "m" (expires) );
47 S390_lowcore.system_timer += S390_lowcore.last_update_timer - timer; 49 S390_lowcore.system_timer += S390_lowcore.last_update_timer - timer;
48 S390_lowcore.last_update_timer = expires; 50 S390_lowcore.last_update_timer = expires;
@@ -121,7 +123,7 @@ void account_system_vtime(struct task_struct *tsk)
121} 123}
122EXPORT_SYMBOL_GPL(account_system_vtime); 124EXPORT_SYMBOL_GPL(account_system_vtime);
123 125
124void vtime_start_cpu(__u64 int_clock, __u64 enter_timer) 126void __kprobes vtime_start_cpu(__u64 int_clock, __u64 enter_timer)
125{ 127{
126 struct s390_idle_data *idle = &__get_cpu_var(s390_idle); 128 struct s390_idle_data *idle = &__get_cpu_var(s390_idle);
127 struct vtimer_queue *vq = &__get_cpu_var(virt_cpu_timer); 129 struct vtimer_queue *vq = &__get_cpu_var(virt_cpu_timer);
@@ -161,7 +163,7 @@ void vtime_start_cpu(__u64 int_clock, __u64 enter_timer)
161 idle->sequence++; 163 idle->sequence++;
162} 164}
163 165
164void vtime_stop_cpu(void) 166void __kprobes vtime_stop_cpu(void)
165{ 167{
166 struct s390_idle_data *idle = &__get_cpu_var(s390_idle); 168 struct s390_idle_data *idle = &__get_cpu_var(s390_idle);
167 struct vtimer_queue *vq = &__get_cpu_var(virt_cpu_timer); 169 struct vtimer_queue *vq = &__get_cpu_var(virt_cpu_timer);
@@ -314,13 +316,15 @@ static void do_callbacks(struct list_head *cb_list)
314/* 316/*
315 * Handler for the virtual CPU timer. 317 * Handler for the virtual CPU timer.
316 */ 318 */
317static void do_cpu_timer_interrupt(__u16 error_code) 319static void do_cpu_timer_interrupt(unsigned int ext_int_code,
320 unsigned int param32, unsigned long param64)
318{ 321{
319 struct vtimer_queue *vq; 322 struct vtimer_queue *vq;
320 struct vtimer_list *event, *tmp; 323 struct vtimer_list *event, *tmp;
321 struct list_head cb_list; /* the callback queue */ 324 struct list_head cb_list; /* the callback queue */
322 __u64 elapsed, next; 325 __u64 elapsed, next;
323 326
327 kstat_cpu(smp_processor_id()).irqs[EXTINT_TMR]++;
324 INIT_LIST_HEAD(&cb_list); 328 INIT_LIST_HEAD(&cb_list);
325 vq = &__get_cpu_var(virt_cpu_timer); 329 vq = &__get_cpu_var(virt_cpu_timer);
326 330
@@ -565,6 +569,23 @@ void init_cpu_vtimer(void)
565 __ctl_set_bit(0,10); 569 __ctl_set_bit(0,10);
566} 570}
567 571
572static int __cpuinit s390_nohz_notify(struct notifier_block *self,
573 unsigned long action, void *hcpu)
574{
575 struct s390_idle_data *idle;
576 long cpu = (long) hcpu;
577
578 idle = &per_cpu(s390_idle, cpu);
579 switch (action) {
580 case CPU_DYING:
581 case CPU_DYING_FROZEN:
582 idle->nohz_delay = 0;
583 default:
584 break;
585 }
586 return NOTIFY_OK;
587}
588
568void __init vtime_init(void) 589void __init vtime_init(void)
569{ 590{
570 /* request the cpu timer external interrupt */ 591 /* request the cpu timer external interrupt */
@@ -573,5 +594,6 @@ void __init vtime_init(void)
573 594
574 /* Enable cpu timer interrupts on the boot cpu. */ 595 /* Enable cpu timer interrupts on the boot cpu. */
575 init_cpu_vtimer(); 596 init_cpu_vtimer();
597 cpu_notifier(s390_nohz_notify, 0);
576} 598}
577 599