]> xenbits.xensource.com Git - qemu-xen-4.2-testing.git/commitdiff
hw/piix4acpi: Make writes to ACPI_DBG_IO_ADDR actually work.
authorKonrad Rzeszutek Wilk <konrad@kernel.org>
Mon, 11 Nov 2013 18:42:56 +0000 (13:42 -0500)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 25 Nov 2013 13:53:09 +0000 (13:53 +0000)
The ACPI AML code has little snippets where it uses two
memory locations to stash debug information when doing PCI
hotplug, such as:

Device (S20)
{
    Name (_ADR, 0x00040000)
    Name (_SUN, 0x04)
    Method (_EJ0, 1, NotSerialized)
    {
Store (0x20, \_GPE.DPT1)
Store (0x88, \_GPE.DPT2)
Store (One, \_GPE.PH20)
    }

    Method (_STA, 0, NotSerialized)
    {
Store (0x20, \_GPE.DPT1)
Store (0x89, \_GPE.DPT2)
    }
}

and DPT1 (and DPT2) is defined as:

OperationRegion ( DG1, SystemIO, 0xb044, 0x04 )
Field ( DG1, ByteAcc, NoLock, Preserve ) {
    DPT1, 8, DPT2, 8
}

But unfortunately when we do the writes they are done
as byte writes, not as 4-byte writes (long). Hence
any debug values are never show in QEMU.

This fixes it so that we can see them in the log file.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
(cherry picked from commit 832f9bde25542961ea4f768be6e00e4801484e3a)
(cherry picked from commit 147f83f9b7d87a698c200c4f3eb2d36a0e4fe54b)

hw/piix4acpi.c

index bf916d9560b085ae95da0b35e61ff69dd38f14e0..ddbe8e064d24dfeb251aede41b9b92a339475711 100644 (file)
@@ -284,7 +284,7 @@ static inline void clear_bit(uint8_t *map, int bit)
     map[bit / 8] &= ~(1 << (bit % 8));
 }
 
-static void acpi_dbg_writel(void *opaque, uint32_t addr, uint32_t val)
+static void acpi_dbg_writeb(void *opaque, uint32_t addr, uint32_t val)
 {
     PIIX4ACPI_LOG(PIIX4ACPI_LOG_DEBUG, "ACPI: DBG: 0x%08x\n", val);
     PIIX4ACPI_LOG(PIIX4ACPI_LOG_INFO, "ACPI:debug: write addr=0x%x, val=0x%x.\n", addr, val);
@@ -776,7 +776,7 @@ i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
 #ifdef CONFIG_PASSTHROUGH
     php_devfn_init();
 #endif
-    register_ioport_write(ACPI_DBG_IO_ADDR, 4, 4, acpi_dbg_writel, d);
+    register_ioport_write(ACPI_DBG_IO_ADDR, 4, 1, acpi_dbg_writeb, d);
 
     register_savevm("piix4acpi", 0, 2, piix4acpi_save, piix4acpi_load, d);