From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPdkA-0001iP-Rj for qemu-devel@nongnu.org; Sun, 13 Nov 2011 12:21:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPdk9-0004Wd-Fr for qemu-devel@nongnu.org; Sun, 13 Nov 2011 12:21:22 -0500 Received: from mail-wy0-f173.google.com ([74.125.82.173]:42033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPdk9-0004WW-B1 for qemu-devel@nongnu.org; Sun, 13 Nov 2011 12:21:21 -0500 Received: by wyh22 with SMTP id 22so5890253wyh.4 for ; Sun, 13 Nov 2011 09:21:19 -0800 (PST) From: Julian Pidancet Date: Sun, 13 Nov 2011 18:13:32 +0000 Message-Id: <18d8a7431850a16a7b49ce4fac4b34606c963f47.1321207953.git.julian.pidancet@gmail.com> Subject: [Qemu-devel] [PATCH] rtl8139: Fix invalid IO access alignment List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Julian Pidancet This patch makes iPXE work with the rtl8139 emulation. The rtl8139 driver in iPXE issues a 16bit access on the ChipCmd register (offset 0x37) to check the status of the rx buffer. The offset of the ioport access was getting fixed up to 0x36 in qemu, causing the value read in iPXE to be invalid. This fixes an issue with iPXE reporting timeouts during TFTP transfers. Signed-off-by: Julian Pidancet --- hw/rtl8139.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index 4c37993..0ff06da 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -1971,7 +1971,7 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s) cplus_tx_ring_desc += 16 * descriptor; DPRINTF("+++ C+ mode reading TX descriptor %d from host memory at " - "%08x0x%08x = 0x"DMA_ADDR_FMT"\n", descriptor, s->TxAddr[1], + "%08x %08x = 0x"DMA_ADDR_FMT"\n", descriptor, s->TxAddr[1], s->TxAddr[0], cplus_tx_ring_desc); uint32_t val, txdw0,txdw1,txbufLO,txbufHI; @@ -2800,7 +2800,7 @@ static void rtl8139_io_writew(void *opaque, uint8_t addr, uint32_t val) { RTL8139State *s = opaque; - addr &= 0xfe; + addr &= 0xff; switch (addr) { @@ -2900,7 +2900,7 @@ static void rtl8139_io_writel(void *opaque, uint8_t addr, uint32_t val) { RTL8139State *s = opaque; - addr &= 0xfc; + addr &= 0xff; switch (addr) { @@ -3043,7 +3043,7 @@ static uint32_t rtl8139_io_readw(void *opaque, uint8_t addr) RTL8139State *s = opaque; uint32_t ret; - addr &= 0xfe; /* mask lower bit */ + addr &= 0xff; switch (addr) { @@ -3120,7 +3120,7 @@ static uint32_t rtl8139_io_readl(void *opaque, uint8_t addr) RTL8139State *s = opaque; uint32_t ret; - addr &= 0xfc; /* also mask low 2 bits */ + addr &= 0xff; switch (addr) { -- Julian Pidancet