qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 1/2] Add Interrupt Source Override Structure to BIOS


From: Beth Kon
Subject: [Qemu-devel] [PATCH 1/2] Add Interrupt Source Override Structure to BIOS
Date: Mon, 27 Oct 2008 14:20:23 -0400

Looking into a problem with getting the HPET to work for both Windows
and Linux revealed what appears to be a problem with QEMU's interrupt
generation.  

Since QEMU supports both APIC and dual 8259 mode (as indicated by bit 0
of the MADT flags - PCAT COMPAT), the BIOS should include the Interrupt
Source Override structure to inform the OS that IRQ0 is mapped to
interrupt 2 in APIC mode, which is the standard scheme for the PIT.

What must be happening is that Linux is abiding by what the BIOS says
and expecting INTI0 from the APIC (since there is no Interrupt Source
Override). Windows must be ignoring the Interrupt Source Override
information and just expecting to see the timer interrupt on INTI2. So
the HPET had to raise both 0 and 2 to keep them both happy.

Patch 1 adds the Interrupt Source Override to BIOS, and Patch 2 modifies
ioapic_set_irq to change vector 0 to 2.

Making this change allowed Windows and Linux to both work with HPET code
that just raised IRQ0. 

That said, I don't understand why the PIT was working with the code as
it was in the case of Windows, unless in that case windows was honoring
the Interrupt Source Override (or the lack of one, I should say). I'm
not sure these patches are the right solution for all cases, but they
work for the HPET. I should add that KVM does have an Interrupt Source
Override structure in their BIOS but they do not remap 0 to 2, so maybe
I'm missing something here. Comments appreciated.

-- 
Elizabeth Kon (Beth)
IBM Linux Technology Center
Open Hypervisor Team
email: address@hidden

Attachment: bios_int_override.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]