From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ross Philipson Subject: Re: [PATCH] hw/piix4acpi: Make writes to ACPI_DBG_IO_ADDR actually work. Date: Mon, 11 Nov 2013 14:24:43 -0500 Message-ID: <52812EFB.6010200@citrix.com> References: <1384195376-9971-1-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vfx84-0000NE-Ja for xen-devel@lists.xenproject.org; Mon, 11 Nov 2013 19:26:32 +0000 In-Reply-To: <1384195376-9971-1-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Konrad Rzeszutek Wilk , ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 11/11/2013 01:42 PM, Konrad Rzeszutek Wilk wrote: > 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 > } Just as a note for the sake of correctness, that Field only defines 2 bytes but the OpRegion is defined as 4 bytes (and doesn't need to be). > > 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. > > CC: ian.jackson@eu.citrix.com > Signed-off-by: Konrad Rzeszutek Wilk > --- > hw/piix4acpi.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/piix4acpi.c b/hw/piix4acpi.c > index bf916d9..ddbe8e0 100644 > --- a/hw/piix4acpi.c > +++ b/hw/piix4acpi.c > @@ -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); > >