xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ross Philipson <ross.philipson@citrix.com>
Cc: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com,
	Konrad Rzeszutek Wilk <konrad@kernel.org>
Subject: Re: [PATCH] hw/piix4acpi: Make writes to ACPI_DBG_IO_ADDR actually work.
Date: Mon, 11 Nov 2013 15:06:41 -0500	[thread overview]
Message-ID: <20131111200641.GA8241@phenom.dumpdata.com> (raw)
In-Reply-To: <52812EFB.6010200@citrix.com>

On Mon, Nov 11, 2013 at 02:24:43PM -0500, Ross Philipson wrote:
> 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).

Yup, I saw that too and was wondering why it was defined that way.

It probably can use some more fixes :-)
> 
> >
> >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 <konrad.wilk@oracle.com>
> >---
> >  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);
> >
> >
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  reply	other threads:[~2013-11-11 20:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 18:42 [PATCH] hw/piix4acpi: Make writes to ACPI_DBG_IO_ADDR actually work Konrad Rzeszutek Wilk
2013-11-11 19:24 ` Ross Philipson
2013-11-11 20:06   ` Konrad Rzeszutek Wilk [this message]
2013-11-12 15:42 ` Ian Jackson
2013-11-12 16:30   ` Konrad Rzeszutek Wilk
2013-11-13 18:03     ` Stefano Stabellini
2013-11-13 18:33       ` Konrad Rzeszutek Wilk
2013-11-13 18:43         ` Stefano Stabellini
2013-11-13 19:34           ` Konrad Rzeszutek Wilk
2013-11-13 19:41             ` Stefano Stabellini
2013-11-25 13:59   ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131111200641.GA8241@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=konrad@kernel.org \
    --cc=ross.philipson@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).