Re: [Qemu-devel] [PATCH] rtl8139: fix regression in TxStatus/TxAddr read

2012-05-07 Thread Michael S. Tsirkin
On Mon, May 07, 2012 at 03:00:45PM +0300, Avi Kivity wrote: > 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

[Qemu-devel] [PATCH] rtl8139: fix regression in TxStatus/TxAddr read

2012-05-07 Thread Avi Kivity
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.