On Tue, Mar 15, 2011 at 10:47:22AM -0600, Alex Williamson wrote: > From: Michael Brown <mc...@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 <mc...@ipxe.org> > Signed-off-by: Alex Williamson <alex.william...@redhat.com> > --- > > hw/pcnet.c | 30 +++++++++++++++--------------- > 1 files changed, 15 insertions(+), 15 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefa...@linux.vnet.ibm.com>