[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Questions on vpic, vlapic, vioapic and line 0 (aka timer)

>>> On 19.02.14 at 16:14, Don Slutz <dslutz@xxxxxxxxxxx> wrote:
> 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
> ...
> 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).

Not really - the code above suggests the LAPIC emulation is
prepared for the IOAPIC emulation to support that mode, not
that the IOAPIC one supports it. At present only LAPIC LVT0
really supports that delivery mode.

> 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.

Adding this to __vlapic_accept_pic_intr() would be contrary to
the purpose of the function afaict - fixed delivery mode is
unrelated to delivering PIC interrupts.

> 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.)

But in the end I think you're barking up the wrong tree: All of this
code would be of no interest at all if Linux didn't for some reason go
into that fallback code. And with that fallback code existing mainly
(if not exclusively) to deal with (half-)broken hardware/firmware, we
should really make sure our emulation isn't broken (i.e. the fallback
never being made use of). So finding the "TBD reason" is what is
really needed.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.