WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] Bug in timer interrupt crashed dom0

To: "Li, Xin B" <xin.b.li@xxxxxxxxx>, "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
Subject: RE: [Xen-devel] Bug in timer interrupt crashed dom0
From: "Li, Xin B" <xin.b.li@xxxxxxxxx>
Date: Sat, 10 Sep 2005 13:20:34 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sat, 10 Sep 2005 05:18:32 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcW1xggiZH9VMVGpSFmmv+1MXKjViwAAHTxw
Thread-topic: [Xen-devel] Bug in timer interrupt crashed dom0
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@xxxxxxxxx>

-Xin


diff -r 5c49ed1145cc linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c  Fri Sep  9
23:11:18 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c  Sat Sep 10
13:14:07 2005
@@ -543,7 +543,7 @@
 irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs
*regs)
 {
        s64 delta, delta_cpu;
-       int cpu = smp_processor_id();
+       int i, cpu = smp_processor_id();
        struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);

        write_seqlock(&xtime_lock);
@@ -566,9 +566,9 @@
                       (s64)get_nsec_offset(shadow),
                       processed_system_time,
                       per_cpu(processed_system_time, cpu));
-               for (cpu = 0; cpu < num_online_cpus(); cpu++)
-                       printk(" %d: %lld\n", cpu,
-                              per_cpu(processed_system_time, cpu));
+               for (i = 0; i < num_online_cpus(); i++)
+                       printk(" %d: %lld\n", i,
+                              per_cpu(processed_system_time, i));
        }

        /* System-wide jiffy work. */

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>