Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Michael S. Tsirkin
On Thu, Oct 17, 2013 at 01:02:17PM +0200, Paolo Bonzini wrote: > Il 17/10/2013 12:58, Gleb Natapov ha scritto: > >>> > > @@ -143,14 +143,14 @@ static inline int rtc_in(u8 reg) > >>> > > { > >>> > > u8 x = reg; > >>> > > asm volatile("outb %b1, $0x70; inb $0x71, %b0" > >>> > > -

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Michael S. Tsirkin
On Thu, Oct 17, 2013 at 12:53:30PM +0200, Paolo Bonzini wrote: > Il 16/10/2013 21:46, Michael S. Tsirkin ha scritto: > > Old GCC didn't let you reference variable by > > number if it is listed with a specific register > > constraint, on the assumption you can just > > use the register name explicit

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Paolo Bonzini
Il 17/10/2013 12:58, Gleb Natapov ha scritto: >>> > > @@ -143,14 +143,14 @@ static inline int rtc_in(u8 reg) >>> > > { >>> > > u8 x = reg; >>> > > asm volatile("outb %b1, $0x70; inb $0x71, %b0" >>> > > -: "+a"(x) : "0"(x)); >>> > > +: "=a"(x) : "0"(x)); >>

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Gleb Natapov
On Thu, Oct 17, 2013 at 12:55:16PM +0200, Paolo Bonzini wrote: > Il 17/10/2013 08:27, Gleb Natapov ha scritto: > > On Wed, Oct 16, 2013 at 10:46:53PM +0300, Michael S. Tsirkin wrote: > >> Old GCC didn't let you reference variable by > >> number if it is listed with a specific register > >> constrai

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Paolo Bonzini
Il 17/10/2013 08:27, Gleb Natapov ha scritto: > On Wed, Oct 16, 2013 at 10:46:53PM +0300, Michael S. Tsirkin wrote: >> Old GCC didn't let you reference variable by >> number if it is listed with a specific register >> constraint, on the assumption you can just >> use the register name explicitly. >

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Paolo Bonzini
Il 16/10/2013 21:46, Michael S. Tsirkin ha scritto: > Old GCC didn't let you reference variable by > number if it is listed with a specific register > constraint, on the assumption you can just > use the register name explicitly. Tell us the truth, you made this up. :) Who doesn't do that for inv

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Gleb Natapov
On Thu, Oct 17, 2013 at 12:44:46PM +0300, Michael S. Tsirkin wrote: > On Thu, Oct 17, 2013 at 12:33:39PM +0300, Gleb Natapov wrote: > > > > It just papers over the problem. Compiler should either complain that it > > > > does not know what %w0 or complain that variable length does not match > > > >

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Michael S. Tsirkin
On Thu, Oct 17, 2013 at 12:33:39PM +0300, Gleb Natapov wrote: > > > It just papers over the problem. Compiler should either complain that it > > > does not know what %w0 or complain that variable length does not match > > > assembly > > > > Of course it can't. Compiler does not parse assembly at a

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Gleb Natapov
On Thu, Oct 17, 2013 at 12:28:58PM +0300, Michael S. Tsirkin wrote: > On Thu, Oct 17, 2013 at 11:34:41AM +0300, Gleb Natapov wrote: > > On Thu, Oct 17, 2013 at 11:27:37AM +0300, Michael S. Tsirkin wrote: > > > On Thu, Oct 17, 2013 at 11:20:27AM +0300, Gleb Natapov wrote: > > > > On Thu, Oct 17, 201

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Michael S. Tsirkin
On Thu, Oct 17, 2013 at 11:34:41AM +0300, Gleb Natapov wrote: > On Thu, Oct 17, 2013 at 11:27:37AM +0300, Michael S. Tsirkin wrote: > > On Thu, Oct 17, 2013 at 11:20:27AM +0300, Gleb Natapov wrote: > > > On Thu, Oct 17, 2013 at 11:12:31AM +0300, Michael S. Tsirkin wrote: > > > > On Thu, Oct 17, 201

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Gleb Natapov
On Thu, Oct 17, 2013 at 11:27:37AM +0300, Michael S. Tsirkin wrote: > On Thu, Oct 17, 2013 at 11:20:27AM +0300, Gleb Natapov wrote: > > On Thu, Oct 17, 2013 at 11:12:31AM +0300, Michael S. Tsirkin wrote: > > > On Thu, Oct 17, 2013 at 09:27:51AM +0300, Gleb Natapov wrote: > > > > On Wed, Oct 16, 201

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Michael S. Tsirkin
On Thu, Oct 17, 2013 at 09:27:51AM +0300, Gleb Natapov wrote: > On Wed, Oct 16, 2013 at 10:46:53PM +0300, Michael S. Tsirkin wrote: > > Old GCC didn't let you reference variable by > > number if it is listed with a specific register > > constraint, on the assumption you can just > > use the registe

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Michael S. Tsirkin
On Thu, Oct 17, 2013 at 11:20:27AM +0300, Gleb Natapov wrote: > On Thu, Oct 17, 2013 at 11:12:31AM +0300, Michael S. Tsirkin wrote: > > On Thu, Oct 17, 2013 at 09:27:51AM +0300, Gleb Natapov wrote: > > > On Wed, Oct 16, 2013 at 10:46:53PM +0300, Michael S. Tsirkin wrote: > > > > Old GCC didn't let

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-17 Thread Gleb Natapov
On Thu, Oct 17, 2013 at 11:12:31AM +0300, Michael S. Tsirkin wrote: > On Thu, Oct 17, 2013 at 09:27:51AM +0300, Gleb Natapov wrote: > > On Wed, Oct 16, 2013 at 10:46:53PM +0300, Michael S. Tsirkin wrote: > > > Old GCC didn't let you reference variable by > > > number if it is listed with a specific

Re: [Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-16 Thread Gleb Natapov
On Wed, Oct 16, 2013 at 10:46:53PM +0300, Michael S. Tsirkin wrote: > Old GCC didn't let you reference variable by > number if it is listed with a specific register > constraint, on the assumption you can just > use the register name explicitly. > > Build fails with errors like this: > a.c:6: erro

[Qemu-devel] [PATCH] kvm-unittest: fix build with gcc 4.3.X and older

2013-10-16 Thread Michael S. Tsirkin
Old GCC didn't let you reference variable by number if it is listed with a specific register constraint, on the assumption you can just use the register name explicitly. Build fails with errors like this: a.c:6: error: invalid 'asm': invalid operand code 'd' To fix, let's just use %eax %al etc.