On 07/07/2015 13:24, Andrew Jones wrote:
>> > The reason I switched was that the non-atomic test didn't work for me.
>> > I have now debugged it, and it needs this:
>> >
>> > @@ -29,12 +29,12 @@ static void gcc_builtin_unlock(int *lock_var)
>> > }
>> > static void none_lock(int *lock_var)
>> > {
>> > - while (*lock_var != 0);
>> > - *lock_var = 1;
>> > + while (*(volatile int *)lock_var != 0);
>> > + *(volatile int *)lock_var = 1;
>> > }
>> > static void none_unlock(int *lock_var)
>> > {
>> > - *lock_var = 0;
>> > + *(volatile int *)lock_var = 0;
>> > }
>> >
>> > static int global_a, global_b;
>> >
>> > Otherwise the none_lock function does not reload lock_var.
> Good call. I'll send a v2 of this patch that puts this in.
No need to, I have already applied this patch, and my fixup on top.
Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html