ia64/xen-unstable

changeset 6739:20b6be0e1fa1

This patch fixes xenlinux timer interrupt.

In xenlinux timer interrupt variable cpu is sometimes uesd in a for
loop, but later it is used to access per cpu data i.e.
per_cpu(processed_system_time, cpu), which causes an invalid pointer.

Signed-off-by: Xin Li <xin.b.li@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Sep 10 14:22:12 2005 +0000 (2005-09-10)
parents 8fc210e6a588
children aa1adbeecfcd
files linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Sat Sep 10 14:20:29 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Sat Sep 10 14:22:12 2005 +0000
     1.3 @@ -543,7 +543,7 @@ EXPORT_SYMBOL(profile_pc);
     1.4  irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
     1.5  {
     1.6  	s64 delta, delta_cpu;
     1.7 -	int cpu = smp_processor_id();
     1.8 +	int i, cpu = smp_processor_id();
     1.9  	struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
    1.10  
    1.11  	write_seqlock(&xtime_lock);
    1.12 @@ -566,9 +566,9 @@ irqreturn_t timer_interrupt(int irq, voi
    1.13  		       (s64)get_nsec_offset(shadow),
    1.14  		       processed_system_time,
    1.15  		       per_cpu(processed_system_time, cpu));
    1.16 -		for (cpu = 0; cpu < num_online_cpus(); cpu++)
    1.17 -			printk(" %d: %lld\n", cpu,
    1.18 -			       per_cpu(processed_system_time, cpu));
    1.19 +		for (i = 0; i < num_online_cpus(); i++)
    1.20 +			printk(" %d: %lld\n", i,
    1.21 +			       per_cpu(processed_system_time, i));
    1.22  	}
    1.23  
    1.24  	/* System-wide jiffy work. */