Skip to contentSkip to conversation

io_apic disable_8254_timer

PATCH In review Woller, Thomas 2 participants 2 messages Mar 2, 2006 – Mar 3, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_apic disable_8254_timer

Attached/included patch partially implements the recent disable_8254_timer linux solution. Applies cleanly to c/s 9098. We are seeing the following error messages
(XEN) APIC Error on CPU:0 (00) (40)
(XEN) APIC Error on CPU:0 (40) (40)
when using an AMD machine with ATI chipset.
Not calling enable_8259A_irq(0) in io_apic.c check_timer() alleviates the error.

Here is link to linux discussion and signoff by linux/andik, indication is that 2.6.17 will resolve further.
Better ATI Timer fix
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=c
ommit;h=ab9b32ee626e9b6df4ce2560a70ae15e62423cf4

This patch only adds "disable_8254_timer" and leaves the default as enabled - ie. There is no "enable_8254_timer" in this patch. The linux solution provides more detailed determination of whether to enable/disable using timer_over_8254, including determining if ATI chipset is present. Most of which is most likely not necessary with xen hv at this time.

The added code in this patch could be ifdef 64bit, as the linux solution is only implemented in the x86_64 io_apic.c code.
Tom

xen/arch/x86/io_apic.c +3 -1
diff -r 4dd325c1d87d xen/arch/x86/io_apic.c
@@ -50,6 +50,7 @@
 static DEFINE_SPINLOCK(ioapic_lock);
 
 int skip_ioapic_setup;
+int disable_timer_over_8254 = 0;
 
 /*
  * # of IRQ routing registers
@@ -1549,7 +1550,8 @@
     apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
     init_8259A(1);
     timer_ack = 1;
-    enable_8259A_irq(0);
+    if(!disable_timer_over_8254)
+        enable_8259A_irq(0);
 
     pin1  = find_isa_irq_pin(0, mp_INT);
     apic1 = find_isa_irq_apic(0, mp_INT);
xen/arch/x86/setup.c +5 -0
diff -r 4dd325c1d87d xen/arch/x86/setup.c
@@ -67,6 +67,11 @@
 extern int skip_ioapic_setup;
 boolean_param("noapic", skip_ioapic_setup);
 
+/* disable_8254_timer: if true, disable interrupt 0 timer routing 
+ * over the 8254 in addition to over the IO-APIC. */
+extern int disable_timer_over_8254;
+boolean_param("disable_8254_timer", disable_timer_over_8254);
+
 int early_boot = 1;
 
 cpumask_t cpu_present_map;
xen/arch/x86/io_apic.c +3 -1
diff -r 4dd325c1d87d xen/arch/x86/io_apic.c
@@ -50,6 +50,7 @@
 static DEFINE_SPINLOCK(ioapic_lock);
 
 int skip_ioapic_setup;
+int disable_timer_over_8254 = 0;
 
 /*
  * # of IRQ routing registers
@@ -1549,7 +1550,8 @@
     apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
     init_8259A(1);
     timer_ack = 1;
-    enable_8259A_irq(0);
+    if(!disable_timer_over_8254)
+        enable_8259A_irq(0);
 
     pin1  = find_isa_irq_pin(0, mp_INT);
     apic1 = find_isa_irq_apic(0, mp_INT);
xen/arch/x86/setup.c +5 -0
diff -r 4dd325c1d87d xen/arch/x86/setup.c
@@ -67,6 +67,11 @@
 extern int skip_ioapic_setup;
 boolean_param("noapic", skip_ioapic_setup);
 
+/* disable_8254_timer: if true, disable interrupt 0 timer routing 
+ * over the 8254 in addition to over the IO-APIC. */
+extern int disable_timer_over_8254;
+boolean_param("disable_8254_timer", disable_timer_over_8254);
+
 int early_boot = 1;
 
 cpumask_t cpu_present_map;

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

#1 lore raw
Quoted 10 lines · Thomas

This patch only adds "disable_8254_timer" and leaves the default as enabled - ie. There is no "enable_8254_timer" in this patch. The linux solution provides more detailed determination of whether to enable/disable using timer_over_8254, including determining if ATI chipset is present. Most of which is most likely not necessary with xen hv at this time.

The added code in this patch could be ifdef 64bit, as the linux solution is only implemented in the x86_64 io_apic.c code.
Tom

Actually this gives me an excuse to pick a scab and get rid of the 'missed tick' logic that relies on that code altogether. So I just deleted the line instead of making it conditional. I'm pretty sure that won't break anything.

Thanks,
Keir