qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Michael S. Tsirkin
Subject: [Qemu-devel] Re: [PATCH v2 2/2] get rid of hostregs_helper.h
Date: Thu, 25 Feb 2010 15:04:28 +0200
User-agent: Mutt/1.5.19 (2009-01-05)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]