From: Anthony Liguori <aliguori@us.ibm.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1.0 (resend)] eepro100: Fix alignment requirement for statistical counters
Date: Mon, 28 Nov 2011 16:36:54 -0600 [thread overview]
Message-ID: <4ED40D06.1030104@us.ibm.com> (raw)
In-Reply-To: <1322083230-853-1-git-send-email-sw@weilnetz.de>
On 11/23/2011 03:20 PM, Stefan Weil wrote:
> According to Intel's Open Source Software Developer Manual,
> the dump counters address must be Dword aligned.
>
> The new code enforces this alignment, so s->statsaddr may now
> be used with stw_le_pci_dma() and stl_le_pci_dma().
>
> Signed-off-by: Stefan Weil<sw@weilnetz.de>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
> hw/eepro100.c | 10 +++++++++-
> 1 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/hw/eepro100.c b/hw/eepro100.c
> index 7d59e71..29ec5b4 100644
> --- a/hw/eepro100.c
> +++ b/hw/eepro100.c
> @@ -976,7 +976,15 @@ static void eepro100_cu_command(EEPRO100State * s, uint8_t val)
> case CU_STATSADDR:
> /* Load dump counters address. */
> s->statsaddr = e100_read_reg4(s, SCBPointer);
> - TRACE(OTHER, logout("val=0x%02x (status address)\n", val));
> + TRACE(OTHER, logout("val=0x%02x (dump counters address)\n", val));
> + if (s->statsaddr& 3) {
> + /* Memory must be Dword aligned. */
> + logout("unaligned dump counters address\n");
> + /* Handling of misaligned addresses is undefined.
> + * Here we align the address by ignoring the lower bits. */
> + /* TODO: Test unaligned dump counter address on real hardware. */
> + s->statsaddr&= ~3;
> + }
> break;
> case CU_SHOWSTATS:
> /* Dump statistical counters. */
prev parent reply other threads:[~2011-11-28 22:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-23 21:20 [Qemu-devel] [PATCH 1.0 (resend)] eepro100: Fix alignment requirement for statistical counters Stefan Weil
2011-11-23 22:26 ` Michael S. Tsirkin
2011-11-23 23:27 ` Anthony Liguori
2011-11-28 22:36 ` Anthony Liguori [this message]
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=4ED40D06.1030104@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.