[Qemu-devel] Re: [PATCH v2 2/2] get rid of hostregs_helper.h

2010-02-25 Thread Paolo Bonzini
On 02/25/2010 02:04 PM, Michael S. Tsirkin wrote: Clobbering memory > is not necessary since we are only caring about blocking assignments of > "env", which is by definition in a register Then I think you should add that as a clobber. Otherwise what prevents the compiler from reordering this

[Qemu-devel] Re: [PATCH v2 2/2] get rid of hostregs_helper.h

2010-02-25 Thread Michael S. Tsirkin
On Thu, Feb 25, 2010 at 01:50:56PM +0100, Paolo Bonzini wrote: > On 02/25/2010 12:40 PM, Michael S. Tsirkin wrote: >> On Thu, Feb 18, 2010 at 11:28:14PM +0200, Blue Swirl wrote: /* restore global registers */ -#include "hostregs_helper.h" +asm(""); +env = (void *) s

[Qemu-devel] Re: [PATCH v2 2/2] get rid of hostregs_helper.h

2010-02-25 Thread Paolo Bonzini
On 02/25/2010 12:40 PM, Michael S. Tsirkin wrote: On Thu, Feb 18, 2010 at 11:28:14PM +0200, Blue Swirl wrote: /* restore global registers */ -#include "hostregs_helper.h" +asm(""); +env = (void *) saved_env_reg; Is this sufficient? I see __asm__ __volatile__("": : :"memory") in v

[Qemu-devel] Re: [PATCH v2 2/2] get rid of hostregs_helper.h

2010-02-25 Thread Michael S. Tsirkin
On Thu, Feb 18, 2010 at 11:28:14PM +0200, Blue Swirl wrote: > >     /* restore global registers */ > > -#include "hostregs_helper.h" > > +    asm(""); > > +    env = (void *) saved_env_reg; > > Is this sufficient? I see __asm__ __volatile__("": : :"memory") in virtio. Is memory clobber implied? Wh

[Qemu-devel] Re: [PATCH v2 2/2] get rid of hostregs_helper.h

2010-02-18 Thread Blue Swirl
Thanks, applied both. On Thu, Feb 18, 2010 at 10:25 PM, Paolo Bonzini wrote: > Since b567b38 (target-arm: remove T0 and T1, 2009-10-16) the only global > register that is used is AREG0, so the complexity of hostregs_helper.h > is unused.  Use regular assignments and a compiler optimization barrie