From: Paolo Bonzini <pbonzini@redhat.com>
To: Andrew Jones <drjones@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH 1/2] arm/arm64: spinlock-test fixup
Date: Tue, 7 Jul 2015 13:25:25 +0200 [thread overview]
Message-ID: <559BB725.8050204@redhat.com> (raw)
In-Reply-To: <20150707112434.GA3381@hawk.localdomain>
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
next prev parent reply other threads:[~2015-07-07 11:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-06 13:31 [kvm-unit-tests PATCH 0/2] one fix, one resend Andrew Jones
2015-07-06 13:31 ` [kvm-unit-tests PATCH 1/2] arm/arm64: spinlock-test fixup Andrew Jones
2015-07-06 17:51 ` Paolo Bonzini
2015-07-07 11:24 ` Andrew Jones
2015-07-07 11:25 ` Paolo Bonzini [this message]
2015-07-06 13:31 ` [kvm-unit-tests PATCH 2/2] arm/arm64: allow building a single test Andrew Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=559BB725.8050204@redhat.com \
--to=pbonzini@redhat.com \
--cc=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.