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 *) saved_env_reg; >>>> >> >> Is this sufficient? >> I see __asm__ __volatile__("": : :"memory") in virtio. >> Is memory clobber implied? What about volatile? > > All asms without colons ("old-style") are volatile. 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 asm wrt assignments? > (hostregs_helper.h wasn't > clobbering memory either). Maybe it was buggy :) > Paolo