]> git.proxmox.com Git - mirror_qemu.git/commit
rtl8139: fix regression in TxStatus/TxAddr read
authorAvi Kivity <avi@redhat.com>
Mon, 7 May 2012 12:00:45 +0000 (15:00 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 8 May 2012 14:09:53 +0000 (17:09 +0300)
commitbdc62e62ead1a6c2a113934bf28cb5abef48618d
tree879fc26ba0fb234b1a33c85ad2e433eabbb581fc
parent847c25d01cbe8e4fe457a7426f82daaaf3287aae
rtl8139: fix regression in TxStatus/TxAddr read

Commit afe0a595356192 added byte reads for TxStatus/TxAddr, but
broke 32-bit reads; the mask generation

   (1 << (8 * size)) - 1

is unspecified in C for size >= sizeof(int), and in fact returns 0
on x86.

Fix by using a larger type.

Fixes (at least) Fedora 9 i386 with -machine kernel_irqchip=on.  I
didn't see it with the qemu APIC implementation; may be due to timing
or (more likely) a tester error.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/rtl8139.c