Re: [PATCH 2/4] kvm-unit-tests: VMX: Add test cases for CR0/4 shadowing

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

 




在 2013-8-18,22:07,Paolo Bonzini <pbonzini@xxxxxxxxxx> 写道:

> Il 15/08/2013 09:59, Arthur Chunqi Li ha scritto:
>>>> volatile u32 stage? And we have barrier() to avoid reordering.
>> Reordering here is not a big deal here, though it is actually needed
>> here. I occurred the following problem:
>> 
>> stage = 1;
>> do something that causes vmexit;
>> stage = 2;
>> 
>> Then the compiler will optimize "stage = 1" and "stage = 2" to one
>> instruction "stage =2", since instructions between them don't use
>> "stage". Can volatile solve this problem?
> 
> I'm not sure if volatile stores are reordered against non-volatile stores.
> 
> Better keep set_stage() but write it as
> 
>    barrier();
>    stage = s;
>    barrier();
Yep. I have done it like this in the 2nd version.

Arthur
> 
> Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux