Re: [kvm-devel] [PATCH] KVM: Avoid using vmx instruction directly

Jeremy Fitzhardinge
2006-11-09T23:39:04Z

Avi Kivity wrote:
>> Or gcc
>> might move the assignment of phys_addr to after the inline assembly.
>>
> "asm volatile" prevents that (and I'm not 100% sure it's necessary).

No, it won't necessarily. "asm volatile" simply forces gcc to emit the
assembler, even if it thinks its output doesn't get used. It makes no
ordering guarantees with respect to other code (or even other "asm
volatiles"). The "memory" clobbers should fix the ordering of the asms
though.

J