* [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
@ 2009-04-14 0:30 Beth Kon
2009-04-14 1:10 ` Ryan Harper
2009-04-14 7:32 ` Stanislav
0 siblings, 2 replies; 10+ messages in thread
From: Beth Kon @ 2009-04-14 0:30 UTC (permalink / raw)
To: qemu-devel, bochs-developers; +Cc: eswierk, herbszt
[-- Attachment #1: Type: text/plain, Size: 109 bytes --]
Replicate ACPI irq0->inti2 override in mp table for non-acpi case.
Signed-off-by: Beth Kon <eak@us.ibm.com>
[-- Attachment #2: non_acpi_irqrouting.patch --]
[-- Type: text/x-diff, Size: 1310 bytes --]
diff --git a/bios/BIOS-bochs-latest b/bios/BIOS-bochs-latest
index ebec71b..82d7792 100644
Binary files a/bios/BIOS-bochs-latest and b/bios/BIOS-bochs-latest differ
diff --git a/bios/rombios32.c b/bios/rombios32.c
index 7be4216..bc17118 100644
--- a/bios/rombios32.c
+++ b/bios/rombios32.c
@@ -1,4 +1,4 @@
-/////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
// $Id$
/////////////////////////////////////////////////////////////////////////
//
@@ -1168,6 +1168,10 @@ static void mptable_init(void)
/* irqs */
for(i = 0; i < 16; i++) {
+#ifdef BX_QEMU
+ if (i == 2)
+ continue;
+#endif
putb(&q, 3); /* entry type = I/O interrupt */
putb(&q, 0); /* interrupt type = vectored interrupt */
putb(&q, 0); /* flags: po=0, el=0 */
@@ -1175,7 +1179,11 @@ static void mptable_init(void)
putb(&q, 0); /* source bus ID = ISA */
putb(&q, i); /* source bus IRQ */
putb(&q, ioapic_id); /* dest I/O APIC ID */
+#ifdef BX_QEMU
+ putb(&q, i == 0 ? 2 : i); /* dest I/O APIC interrupt in */
+#else
putb(&q, i); /* dest I/O APIC interrupt in */
+#endif
}
/* patch length */
len = q - mp_config_table;
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
2009-04-14 0:30 [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing Beth Kon
@ 2009-04-14 1:10 ` Ryan Harper
2009-04-14 13:43 ` Beth Kon
2009-04-14 7:32 ` Stanislav
1 sibling, 1 reply; 10+ messages in thread
From: Ryan Harper @ 2009-04-14 1:10 UTC (permalink / raw)
To: Beth Kon; +Cc: bochs-developers, eswierk, qemu-devel, herbszt
* Elizabeth Kon <eak@us.ibm.com> [2009-04-13 19:35]:
> Replicate ACPI irq0->inti2 override in mp table for non-acpi case.
>
> Signed-off-by: Beth Kon <eak@us.ibm.com>
> diff --git a/bios/BIOS-bochs-latest b/bios/BIOS-bochs-latest
> index ebec71b..82d7792 100644
> Binary files a/bios/BIOS-bochs-latest and b/bios/BIOS-bochs-latest differ
> diff --git a/bios/rombios32.c b/bios/rombios32.c
> index 7be4216..bc17118 100644
> --- a/bios/rombios32.c
> +++ b/bios/rombios32.c
> @@ -1,4 +1,4 @@
> -/////////////////////////////////////////////////////////////////////////
> +////////////////////////////////////////////////////////////////////////
Did you mean to change the number of slashs? =)
> // $Id$
> /////////////////////////////////////////////////////////////////////////
> //
> @@ -1168,6 +1168,10 @@ static void mptable_init(void)
>
> /* irqs */
> for(i = 0; i < 16; i++) {
> +#ifdef BX_QEMU
> + if (i == 2)
> + continue;
> +#endif
I'd think that deserves a comment on why we're skipping i==2.
> putb(&q, 3); /* entry type = I/O interrupt */
> putb(&q, 0); /* interrupt type = vectored interrupt */
> putb(&q, 0); /* flags: po=0, el=0 */
> @@ -1175,7 +1179,11 @@ static void mptable_init(void)
> putb(&q, 0); /* source bus ID = ISA */
> putb(&q, i); /* source bus IRQ */
> putb(&q, ioapic_id); /* dest I/O APIC ID */
> +#ifdef BX_QEMU
> + putb(&q, i == 0 ? 2 : i); /* dest I/O APIC interrupt in */
> +#else
> putb(&q, i); /* dest I/O APIC interrupt in */
> +#endif
> }
> /* patch length */
> len = q - mp_config_table;
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh@us.ibm.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
2009-04-14 0:30 [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing Beth Kon
2009-04-14 1:10 ` Ryan Harper
@ 2009-04-14 7:32 ` Stanislav
2009-04-14 14:20 ` Beth Kon
1 sibling, 1 reply; 10+ messages in thread
From: Stanislav @ 2009-04-14 7:32 UTC (permalink / raw)
To: qemu-devel, bochs-developers; +Cc: eswierk, herbszt
Hi,
Could you explain why you doing these changes for QEMU only (with ifdef
QEMU) ?
Thanks,
Stanislav
-----Original Message-----
From: qemu-devel-bounces+stlintel=gmail.com@nongnu.org
[mailto:qemu-devel-bounces+stlintel=gmail.com@nongnu.org] On Behalf Of Beth
Kon
Sent: Tuesday, April 14, 2009 3:30 AM
To: qemu-devel; bochs-developers@lists.sourceforge.net
Cc: eswierk@artisanetworks.com; herbszt@gmx.de
Subject: [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
Replicate ACPI irq0->inti2 override in mp table for non-acpi case.
Signed-off-by: Beth Kon <eak@us.ibm.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
2009-04-14 1:10 ` Ryan Harper
@ 2009-04-14 13:43 ` Beth Kon
0 siblings, 0 replies; 10+ messages in thread
From: Beth Kon @ 2009-04-14 13:43 UTC (permalink / raw)
To: Ryan Harper; +Cc: bochs-developers, qemu-devel, herbszt
Ryan Harper wrote:
> * Elizabeth Kon <eak@us.ibm.com> [2009-04-13 19:35]:
>
>> Replicate ACPI irq0->inti2 override in mp table for non-acpi case.
>>
>> Signed-off-by: Beth Kon <eak@us.ibm.com>
>>
>
>
>> diff --git a/bios/BIOS-bochs-latest b/bios/BIOS-bochs-latest
>> index ebec71b..82d7792 100644
>> Binary files a/bios/BIOS-bochs-latest and b/bios/BIOS-bochs-latest differ
>> diff --git a/bios/rombios32.c b/bios/rombios32.c
>> index 7be4216..bc17118 100644
>> --- a/bios/rombios32.c
>> +++ b/bios/rombios32.c
>> @@ -1,4 +1,4 @@
>> -/////////////////////////////////////////////////////////////////////////
>> +////////////////////////////////////////////////////////////////////////
>>
>
> Did you mean to change the number of slashs? =)
>
I guess the significance of it isn't clear, huh? I'll add a comment. :-)
>
>> // $Id$
>> /////////////////////////////////////////////////////////////////////////
>> //
>> @@ -1168,6 +1168,10 @@ static void mptable_init(void)
>>
>> /* irqs */
>> for(i = 0; i < 16; i++) {
>> +#ifdef BX_QEMU
>> + if (i == 2)
>> + continue;
>> +#endif
>>
>
> I'd think that deserves a comment on why we're skipping i==2.
>
Ok.
>
>> putb(&q, 3); /* entry type = I/O interrupt */
>> putb(&q, 0); /* interrupt type = vectored interrupt */
>> putb(&q, 0); /* flags: po=0, el=0 */
>> @@ -1175,7 +1179,11 @@ static void mptable_init(void)
>> putb(&q, 0); /* source bus ID = ISA */
>> putb(&q, i); /* source bus IRQ */
>> putb(&q, ioapic_id); /* dest I/O APIC ID */
>> +#ifdef BX_QEMU
>> + putb(&q, i == 0 ? 2 : i); /* dest I/O APIC interrupt in */
>> +#else
>> putb(&q, i); /* dest I/O APIC interrupt in */
>> +#endif
>> }
>> /* patch length */
>> len = q - mp_config_table;
>>
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
2009-04-14 7:32 ` Stanislav
@ 2009-04-14 14:20 ` Beth Kon
2009-04-14 14:56 ` Stanislav
0 siblings, 1 reply; 10+ messages in thread
From: Beth Kon @ 2009-04-14 14:20 UTC (permalink / raw)
To: qemu-devel; +Cc: bochs-developers, eswierk, herbszt
Stanislav wrote:
> Hi,
>
> Could you explain why you doing these changes for QEMU only (with ifdef
> QEMU) ?
>
>
The irq0->inti2 override is not absolutely required. Running Windows
2008 in QEMU with the emulated HPET does require it, so this is a
QEMU-only change.
> Thanks,
> Stanislav
>
> -----Original Message-----
> From: qemu-devel-bounces+stlintel=gmail.com@nongnu.org
> [mailto:qemu-devel-bounces+stlintel=gmail.com@nongnu.org] On Behalf Of Beth
> Kon
> Sent: Tuesday, April 14, 2009 3:30 AM
> To: qemu-devel; bochs-developers@lists.sourceforge.net
> Cc: eswierk@artisanetworks.com; herbszt@gmx.de
> Subject: [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
>
> Replicate ACPI irq0->inti2 override in mp table for non-acpi case.
>
> Signed-off-by: Beth Kon <eak@us.ibm.com>
>
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
2009-04-14 14:20 ` Beth Kon
@ 2009-04-14 14:56 ` Stanislav
2009-04-14 16:19 ` Beth Kon
0 siblings, 1 reply; 10+ messages in thread
From: Stanislav @ 2009-04-14 14:56 UTC (permalink / raw)
To: qemu-devel; +Cc: bochs-developers, eswierk, herbszt
>The irq0->inti2 override is not absolutely required. Running Windows
>2008 in QEMU with the emulated HPET does require it, so this is a
>QEMU-only change.
Non-absolutely required is not good answer :)
Is anything will be broken if the change is merged for Bochs as well ?
I think it will not.
And as bonus, Windows 7 32-bit is not booting under Bochs without this
change.
Stanislav
-----Original Message-----
From: qemu-devel-bounces+stlintel=gmail.com@nongnu.org
[mailto:qemu-devel-bounces+stlintel=gmail.com@nongnu.org] On Behalf Of Beth
Kon
Sent: Tuesday, April 14, 2009 5:20 PM
To: qemu-devel@nongnu.org
Cc: bochs-developers@lists.sourceforge.net; eswierk@aristanetworks.com;
herbszt@gmx.de
Subject: Re: [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
Stanislav wrote:
> Hi,
>
> Could you explain why you doing these changes for QEMU only (with ifdef
> QEMU) ?
>
>
The irq0->inti2 override is not absolutely required. Running Windows
2008 in QEMU with the emulated HPET does require it, so this is a
QEMU-only change.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
2009-04-14 14:56 ` Stanislav
@ 2009-04-14 16:19 ` Beth Kon
2009-04-19 21:23 ` Sebastian Herbszt
0 siblings, 1 reply; 10+ messages in thread
From: Beth Kon @ 2009-04-14 16:19 UTC (permalink / raw)
To: qemu-devel; +Cc: bochs-developers, eswierk, herbszt
Stanislav wrote:
>> The irq0->inti2 override is not absolutely required. Running Windows
>> 2008 in QEMU with the emulated HPET does require it, so this is a
>> QEMU-only change.
>>
>
> Non-absolutely required is not good answer :)
> Is anything will be broken if the change is merged for Bochs as well ?
> I think it will not.
> And as bonus, Windows 7 32-bit is not booting under Bochs without this
> change.
>
>
This is part of a bigger change for QEMU, incorporating irq0->inti2
override for ACPI, and non-ACPI, driven by addition of the HPET. It
required BIOS changes as well as QEMU changes to route irq0 to inti2 of
the IOAPIC. This patch alone is not complete. I have tested the complete
solution in QEMU, thus the guards.
The complete solution would require the madt_int_override portions of
this patch:
http://lists.gnu.org/archive/html/qemu-devel/2008-11/txtSbJwxwQwiT.txt
and the Bochs equivalent of the QEMU irq0->inti2 routing (see changes to
ioapic_set_irq) in this patch:
http://lists.gnu.org/archive/html/qemu-devel/2008-11/txtswJIdPnCbr.txt
> Stanislav
>
> -----Original Message-----
> From: qemu-devel-bounces+stlintel=gmail.com@nongnu.org
> [mailto:qemu-devel-bounces+stlintel=gmail.com@nongnu.org] On Behalf Of Beth
> Kon
> Sent: Tuesday, April 14, 2009 5:20 PM
> To: qemu-devel@nongnu.org
> Cc: bochs-developers@lists.sourceforge.net; eswierk@aristanetworks.com;
> herbszt@gmx.de
> Subject: Re: [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
>
> Stanislav wrote:
>
>> Hi,
>>
>> Could you explain why you doing these changes for QEMU only (with ifdef
>> QEMU) ?
>>
>>
>>
>
>
> The irq0->inti2 override is not absolutely required. Running Windows
> 2008 in QEMU with the emulated HPET does require it, so this is a
> QEMU-only change.
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
2009-04-14 16:19 ` Beth Kon
@ 2009-04-19 21:23 ` Sebastian Herbszt
2009-04-20 18:06 ` Beth Kon
0 siblings, 1 reply; 10+ messages in thread
From: Sebastian Herbszt @ 2009-04-19 21:23 UTC (permalink / raw)
To: Beth Kon, qemu-devel; +Cc: bochs-developers, eswierk
Beth Kon wrote:
> This is part of a bigger change for QEMU, incorporating irq0->inti2
> override for ACPI, and non-ACPI, driven by addition of the HPET. It
> required BIOS changes as well as QEMU changes to route irq0 to inti2 of
> the IOAPIC. This patch alone is not complete. I have tested the complete
> solution in QEMU, thus the guards.
I just tested qemu r7185 with bochs bios (without your patch) and used a Linux
2.6.27.7 guest (openSUSE-11.1-NET-i586.iso). If i don't misunderstand you
this change is only needed with HPET. I have tested the following configurations
which all fail:
hpet enabled, no guest kernel parameters
hpet enabled, guest kernel with acpi=off
hpet disabled, no guest kernel parameters
hpet disabled, guest kernel with acpi=off
Since it even fails with HPET disabled, this change can't only be needed for HPET, can it?
Ed: Have you tried your Linux guest with HPET enabled or disabled in your original report / patch?
- Sebastian
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing
2009-04-19 21:23 ` Sebastian Herbszt
@ 2009-04-20 18:06 ` Beth Kon
2009-04-21 22:22 ` [Qemu-devel] " Sebastian Herbszt
0 siblings, 1 reply; 10+ messages in thread
From: Beth Kon @ 2009-04-20 18:06 UTC (permalink / raw)
To: qemu-devel; +Cc: bochs-developers, eswierk
Sebastian Herbszt wrote:
> Beth Kon wrote:
>> This is part of a bigger change for QEMU, incorporating irq0->inti2
>> override for ACPI, and non-ACPI, driven by addition of the HPET. It
>> required BIOS changes as well as QEMU changes to route irq0 to inti2
>> of the IOAPIC. This patch alone is not complete. I have tested the
>> complete solution in QEMU, thus the guards.
>
> I just tested qemu r7185 with bochs bios (without your patch) and used
> a Linux
Do you mean you used a bochs bios that doesn't include #ifdef BX_QEMU
portions? Then it wouldn't work because QEMU overrides irq0->inti2 in
its ioapic code and without the matching bios that notifies the guest of
the override, boots would likely fail. This change was put in because of
the needs of the HPET, but now it is standard procedure for QEMU. With
or without HPET, QEMU will override irq0->inti2.
If you mean that you used a QEMU Bochs (with ifdef BX_QEMU included),
please let me know what kind of errors you are seeing.
> 2.6.27.7 guest (openSUSE-11.1-NET-i586.iso). If i don't misunderstand you
> this change is only needed with HPET. I have tested the following
> configurations
> which all fail:
>
> hpet enabled, no guest kernel parameters
> hpet enabled, guest kernel with acpi=off
> hpet disabled, no guest kernel parameters
> hpet disabled, guest kernel with acpi=off
>
> Since it even fails with HPET disabled, this change can't only be
> needed for HPET, can it?
>
> Ed: Have you tried your Linux guest with HPET enabled or disabled in
> your original report / patch?
>
> - Sebastian
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] Re: [PATCH] Fix non-ACPI Timer Interrupt Routing
2009-04-20 18:06 ` Beth Kon
@ 2009-04-21 22:22 ` Sebastian Herbszt
0 siblings, 0 replies; 10+ messages in thread
From: Sebastian Herbszt @ 2009-04-21 22:22 UTC (permalink / raw)
To: qemu-devel, eak; +Cc: bochs-developers, eswierk
Beth Kon wrote:
> Sebastian Herbszt wrote:
>> Beth Kon wrote:
>>> This is part of a bigger change for QEMU, incorporating irq0->inti2
>>> override for ACPI, and non-ACPI, driven by addition of the HPET. It
>>> required BIOS changes as well as QEMU changes to route irq0 to inti2
>>> of the IOAPIC. This patch alone is not complete. I have tested the
>>> complete solution in QEMU, thus the guards.
>>
>> I just tested qemu r7185 with bochs bios (without your patch) and used
>> a Linux
> Do you mean you used a bochs bios that doesn't include #ifdef BX_QEMU
> portions?
I was indeed testing pure bochs bios.
> Then it wouldn't work because QEMU overrides irq0->inti2 in
> its ioapic code and without the matching bios that notifies the guest of
> the override, boots would likely fail. This change was put in because of
> the needs of the HPET, but now it is standard procedure for QEMU. With
> or without HPET, QEMU will override irq0->inti2.
This was the missing piece. I just looked at the change [1] and now it explains
why my testing with pure bochs bios failed. Thanks.
It's also the reason why this change is qemu only. ioapic.cc from bochs doesn't
have such override hard-coded.
> If you mean that you used a QEMU Bochs (with ifdef BX_QEMU included),
> please let me know what kind of errors you are seeing.
I did just retest with bios.bin from qemu r7055
hpet enabled, no guest kernel parameters
hpet enabled, guest kernel with acpi=off <- hang
hpet disabled, no guest kernel parameters
hpet disabled, guest kernel with acpi=off <- hang
and those two hangs with acpi=off are fixed in r7169.
[1] http://svn.savannah.gnu.org/viewvc/trunk/hw/apic.c?root=qemu&r1=5890&r2=6081
- Sebastian
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-04-21 22:23 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-14 0:30 [Qemu-devel] [PATCH] Fix non-ACPI Timer Interrupt Routing Beth Kon
2009-04-14 1:10 ` Ryan Harper
2009-04-14 13:43 ` Beth Kon
2009-04-14 7:32 ` Stanislav
2009-04-14 14:20 ` Beth Kon
2009-04-14 14:56 ` Stanislav
2009-04-14 16:19 ` Beth Kon
2009-04-19 21:23 ` Sebastian Herbszt
2009-04-20 18:06 ` Beth Kon
2009-04-21 22:22 ` [Qemu-devel] " Sebastian Herbszt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).