qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] rtl8139: Fix invalid IO access alignment


From: Julian Pidancet
Subject: Re: [Qemu-devel] [PATCH] rtl8139: Fix invalid IO access alignment
Date: Mon, 14 Nov 2011 14:46:27 +0000

On Mon, Nov 14, 2011 at 2:38 PM, Stefan Hajnoczi <address@hidden> wrote:
> On Sun, Nov 13, 2011 at 6:13 PM, Julian Pidancet
> <address@hidden> wrote:
>> 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 <address@hidden>
>> ---
>>  hw/rtl8139.c |   10 +++++-----
>>  1 files changed, 5 insertions(+), 5 deletions(-)
>
> I checked the datasheet and the register byte at 0x38, after ChipCmd,
> is undocumented.  iPXE is being weird, I don't see the reason for the
> inw().
>

I agree, changing this inw() to an inb() in iPXE also fixes the issue.
But this patch makes more sense because it reflects how real hardware
would behave.

>> @@ -2800,7 +2800,7 @@ static void rtl8139_io_writew(void *opaque, uint8_t 
>> addr, uint32_t val)
>>  {
>>     RTL8139State *s = opaque;
>>
>> -    addr &= 0xfe;
>> +    addr &= 0xff;
>
> You can simply drop the masking since
> rtl8139_ioport_readw()/rtl8139_mmio_readw() already do addr & 0xFF.
> Same applies for the other hunks in this patch.
>

Right, I will send an v2 shortly.

-- 
Julian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]