Skip to contentSkip to conversation

Adding another GPE section to an HVM, causes the original GPE to stop functioning

DISCUSSION Tom Rotenberg 2 participants 3 messages Oct 18, 2009

lore
Share & tools
lore
#0 lore raw

Hi all,

I am working with Xen 3.4, and i'm using a Windows XP HVM. The problem i'm experiencing is as follows:
I'm trying to add another GPE section, (for my own ACPI events), and i'm using the following patch:

--- a/tools/firmware/hvmloader/acpi/static_tables.c Wed Oct 14
16:58:16 2009 +0200
+++ b/tools/firmware/hvmloader/acpi/static_tables.c Wed Oct 14
16:58:16 2009 +0200
@@ -65,6 +66,20 @@

    .pm_tmr_len = ACPI_PM_TMR_BLK_BIT_WIDTH / 8,
    .gpe0_blk_len = ACPI_GPE0_BLK_LEN,

/* ----- */
/* My own new GPE block, for my own ACPI events */
+ .gpe1_blk = ACPI_GPE0_BLK_ADDRESS + ACPI_GPE0_BLK_LEN,
+ .gpe1_blk_len = ACPI_GPE0_BLK_LEN,
+
+ .x_gpe1_blk = {

+        .address_space_id    = ACPI_SYSTEM_IO,
+        .register_bit_width  = ACPI_GPE0_BLK_LEN * 8,
+        .register_bit_offset = 0,
+        .address             = ACPI_GPE0_BLK_ADDRESS + ACPI_GPE0_BLK_LEN,
+    },
+    /* ---- */
+
      .p_lvl2_lat = 0x0fff, /* >100,  means we do not support C2 state */
      .p_lvl3_lat = 0x0fff, /* >1000, means we do not support C3 state */
      .iapc_boot_arch = ACPI_8042,

Since i have inserted this new GPE block, the outcome is, that my new GPE block is responding OK, however, the old GPE block (the regular Xen gpe0 block), isn't responding anymore - thus i can't hot-plugqhot-unplug PT devices.

I have analyzed the qemu logs a little bit, and it looks like, since the addition of the new GPE block, Windows for some reason, only enables the new gpe block (gpe1 block), and disables the old gpe block (regular Xen gpe0 block).

Can someone please assist me with this issue?

Tom

#1 lore raw
Quoted 11 lines · Tom Rotenberg

Since i have inserted this new GPE block, the outcome is, that my new GPE block is responding OK, however, the old GPE block (the regular Xen gpe0 block), isn't responding anymore - thus i can't hot-plugqhot-unplug PT devices.

I have analyzed the qemu logs a little bit, and it looks like, since the addition of the new GPE block, Windows for some reason, only enables the new gpe block (gpe1 block), and disables the old gpe block (regular Xen gpe0 block).

Can someone please assist me with this issue?

Since you do not set Fadt.gpe1_base, gpe1's events are precisely overlapping with gpe0's. This is actually a bug, and Windows is interpreting the broken tables as best it can, by assuming that GPE1 overrides GPE0. Probably you mean to set Fadt.gpe1_base=(ACPI_GPE0_LEN/2)*8 or something like that.

-- Keir

#2 lore raw

Keir,

You are right! I just set gpe1_base, and it's working like a charm!

Thanks a lot!

Tom

Quoted 23 lines · Keir Fraser
Quoted 11 lines · Tom Rotenberg

Since i have inserted this new GPE block, the outcome is, that my new GPE block is responding OK, however, the old GPE block (the regular Xen gpe0 block), isn't responding anymore - thus i can't hot-plugqhot-unplug PT devices.

I have analyzed the qemu logs a little bit, and it looks like, since the addition of the new GPE block, Windows for some reason, only enables the new gpe block (gpe1 block), and disables the old gpe block (regular Xen gpe0 block).

Can someone please assist me with this issue?

Since you do not set Fadt.gpe1_base, gpe1's events are precisely overlapping with gpe0's. This is actually a bug, and Windows is interpreting the broken tables as best it can, by assuming that GPE1 overrides GPE0. Probably you mean to set Fadt.gpe1_base=(ACPI_GPE0_LEN/2)*8 or something like that.

 -- Keir