qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: qemu-devel@nongnu.org, mcb30@ipxe.org
Subject: [Qemu-devel] Re: [PATCH] pcnet: Fix sign extension: make ipxe work with >2G RAM
Date: Thu, 17 Mar 2011 09:08:02 +0000	[thread overview]
Message-ID: <20110317090802.GA4692@stefanha-thinkpad.localdomain> (raw)
In-Reply-To: <20110315164705.11742.86706.stgit@s20.home>

On Tue, Mar 15, 2011 at 10:47:22AM -0600, Alex Williamson wrote:
> From: Michael Brown <mcb30@ipxe.org>
> 
> The problem is with definitions in hw/pcnet.c such as:
> 
>   #define CSR_CRDA(S)      ((S)->csr[28] | ((S)->csr[29] << 16))
> 
> "(S)->csr[29]" is a uint16_t, but "(S)->csr[29] << 16" gets promoted to
> int, so the overall CSR_CRDA(s) is a (signed) int rather than a uint32_t.
> 
> This then gets assigned to a uint64_t using
> 
>   target_phys_addr_t crda = CSR_CRDA(s);
> 
> so when (S)->csr[29] has the high bit set, we end up with
> crda=0xffffffffxxxxxxxx.
> 
> From: Michael Brown <mcb30@ipxe.org>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
> 
>  hw/pcnet.c |   30 +++++++++++++++---------------
>  1 files changed, 15 insertions(+), 15 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

  reply	other threads:[~2011-03-17  9:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-15 16:47 [Qemu-devel] [PATCH] pcnet: Fix sign extension: make ipxe work with >2G RAM Alex Williamson
2011-03-17  9:08 ` Stefan Hajnoczi [this message]
2011-04-01 20:35 ` Aurelien Jarno

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=20110317090802.GA4692@stefanha-thinkpad.localdomain \
    --to=stefanha@linux.vnet.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=mcb30@ipxe.org \
    --cc=qemu-devel@nongnu.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).