Re: [kvm-unit-tests PATCH 1/2] arm/arm64: spinlock-test fixup

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

 




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 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