All of lore.kernel.org
 help / color / mirror / Atom feed
* Questions on vpic, vlapic, vioapic and line 0 (aka timer)
@ 2014-02-19 15:14 Don Slutz
  2014-02-20  8:58 ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Don Slutz @ 2014-02-19 15:14 UTC (permalink / raw)
  To: xen-devel@lists.xen.org

For some TBD reason (very very rarely) the routine timer_irq_works() in linux is reporting that the timer IRQ does not work:

..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
..MP-BIOS bug: 8254 timer not connected to IO-APIC
...trying to set up timer (IRQ0) through the 8259A ...
..... (found apic 0 pin 2) ...
....... failed.
...trying to set up timer as Virtual Wire IRQ...
..... failed.
...trying to set up timer as ExtINT IRQ...

hangs and xen's console is spewing:

vioapic.c:352:d1 Unsupported delivery mode 7
vioapic.c:352:d1 Unsupported delivery mode 7
vioapic.c:352:d1 Unsupported delivery mode 7
vioapic.c:352:d1 Unsupported delivery mode 7
vioapic.c:352:d1 Unsupported delivery mode 7
vioapic.c:352:d1 Unsupported delivery mode 7
vioapic.c:352:d1 Unsupported delivery mode 7
vioapic.c:352:d1 Unsupported delivery mode 7
...



I have determined that the lines (in linux):

#ifdef CONFIG_X86_IO_APIC
         no_timer_check = 1;
#endif

that KVM has are missing for Xen.  The simple workaround is to specify "no_timer_check" on the kernel command args.

The reason for the email is that I have found the routine __vlapic_accept_pic_intr:

     /* We deliver 8259 interrupts to the appropriate CPU as follows. */
     return ((/* IOAPIC pin0 is unmasked and routing to this LAPIC? */
              ((redir0.fields.delivery_mode == dest_ExtINT) &&
               !redir0.fields.mask &&
               redir0.fields.dest_id == VLAPIC_ID(vlapic) &&
               !vlapic_disabled(vlapic)) ||
              /* LAPIC has LVT0 unmasked for ExtInts? */
              ((lvt0 & (APIC_MODE_MASK|APIC_LVT_MASKED)) == APIC_DM_EXTINT) ||
              /* LAPIC is fully disabled? */
              vlapic_hw_disabled(vlapic)));
}


Which looks to imply that the vioapic supports "delivery mode 7" (dest_ExtINT), but this case is missing (the message logged above).

Also linux and xen both set "LAPIC has LVT0" to APIC_DM_FIXED for "Virtual Wire IRQ" usage, but this code only allows for APIC_DM_EXTINT.  I have been able to get "Virtual Wire IRQ" usage to work by adding:

              /* LAPIC has LVT0 unmasked for Fixed? */
              ((lvt0 & (APIC_MODE_MASK|APIC_LVT_MASKED)) == APIC_DM_FIXED) ||

It is not clear to me if it should be added or just changed.

This code looks to state that:

...trying to set up timer (IRQ0) through the 8259A ...

is expected to fail.  Is this by design?  (QEMU does allow this case.)

    -Don Slutz

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-26 18:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-19 15:14 Questions on vpic, vlapic, vioapic and line 0 (aka timer) Don Slutz
2014-02-20  8:58 ` Jan Beulich
2014-02-26 18:32   ` Don Slutz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.