[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH] pcnet: Fix sign extension: make ipxe work with
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] Re: [PATCH] pcnet: Fix sign extension: make ipxe work with >2G RAM |
Date: |
Thu, 17 Mar 2011 09:08:02 +0000 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Tue, Mar 15, 2011 at 10:47:22AM -0600, Alex Williamson wrote:
> From: Michael Brown <address@hidden>
>
> 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 <address@hidden>
> Signed-off-by: Alex Williamson <address@hidden>
> ---
>
> hw/pcnet.c | 30 +++++++++++++++---------------
> 1 files changed, 15 insertions(+), 15 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>