Skip to contentSkip to conversation

IRQ: Fix trace bug introduced by c/s 23816:7f357e1ef60a

PATCH In review Andrew Cooper 2 participants 3 messages Sep 26, 2011 – Sep 28, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IRQ: Fix trace bug introduced by c/s 23816:7f357e1ef60a

c/s 23816:7f357e1ef60a introduces cfg->old_vector and removes a loop as a result.

Outside the loop, 'vector' is set to cfg->vector, but the loop aliased 'vector' to mean cfg->old_vector at the point at which this TRACE_3D is executed.

Therefore, when the loop was removed, the code still compiled, although the trace would record incorrect information.

xen/arch/x86/irq.c +1 -1
diff -r a422e2a4451e -r 88b8953f5f5a xen/arch/x86/irq.c
@@ -235,7 +235,7 @@ static void __clear_irq_vector(int irq)
     cpus_and(tmp_mask, cfg->old_cpu_mask, cpu_online_map);
     for_each_cpu_mask(cpu, tmp_mask) {
         ASSERT( per_cpu(vector_irq, cpu)[cfg->old_vector] == irq );
-        TRACE_3D(TRC_HW_IRQ_MOVE_FINISH, irq, vector, cpu);
+        TRACE_3D(TRC_HW_IRQ_MOVE_FINISH, irq, cfg->old_vector, cpu);
         per_cpu(vector_irq, cpu)[cfg->old_vector] = -1;
      }
Acked-by on v1 1/1
#1 lore raw
Quoted 30 lines · Andrew Cooper

c/s 23816:7f357e1ef60a introduces cfg->old_vector and removes a loop as a result.

Outside the loop, 'vector' is set to cfg->vector, but the loop aliased 'vector' to mean cfg->old_vector at the point at which this TRACE_3D is executed.

Therefore, when the loop was removed, the code still compiled, although the trace would record incorrect information.

diff -r a422e2a4451e -r 88b8953f5f5a xen/arch/x86/irq.c

xen/arch/x86/irq.c        Mon Sep 26 17:31:32 2011 +0100 renamed from xen/arch/x86/irq.c        Sun Sep 18 00:26:52 2011 +0100 +1 -1
@@ -235,7 +235,7 @@ static void __clear_irq_vector(int irq)
     cpus_and(tmp_mask, cfg->old_cpu_mask, cpu_online_map);
     for_each_cpu_mask(cpu, tmp_mask) {
         ASSERT( per_cpu(vector_irq, cpu)[cfg->old_vector] == irq );
-        TRACE_3D(TRC_HW_IRQ_MOVE_FINISH, irq, vector, cpu);
+        TRACE_3D(TRC_HW_IRQ_MOVE_FINISH, irq, cfg->old_vector, cpu);
         per_cpu(vector_irq, cpu)[cfg->old_vector] = -1;
      }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

Sorry, NACK-ing this for now, since it hasn't been applied, and I'm about to post a patch that subsumes it.

-George

Quoted 35 lines · George Dunlap
Quoted 30 lines · Andrew Cooper

c/s 23816:7f357e1ef60a introduces cfg->old_vector and removes a loop as a result.

Outside the loop, 'vector' is set to cfg->vector, but the loop aliased 'vector' to mean cfg->old_vector at the point at which this TRACE_3D is executed.

Therefore, when the loop was removed, the code still compiled, although the trace would record incorrect information.

diff -r a422e2a4451e -r 88b8953f5f5a xen/arch/x86/irq.c

xen/arch/x86/irq.c        Mon Sep 26 17:31:32 2011 +0100 renamed from xen/arch/x86/irq.c        Sun Sep 18 00:26:52 2011 +0100 +1 -1
@@ -235,7 +235,7 @@ static void __clear_irq_vector(int irq)
     cpus_and(tmp_mask, cfg->old_cpu_mask, cpu_online_map);
     for_each_cpu_mask(cpu, tmp_mask) {
         ASSERT( per_cpu(vector_irq, cpu)[cfg->old_vector] == irq );
-        TRACE_3D(TRC_HW_IRQ_MOVE_FINISH, irq, vector, cpu);
+        TRACE_3D(TRC_HW_IRQ_MOVE_FINISH, irq, cfg->old_vector, cpu);
         per_cpu(vector_irq, cpu)[cfg->old_vector] = -1;
      }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel