On 11/23/2011 11:56 AM, Chris Evich wrote:
> Newer gcc is more pedantic about in-line assembler reference types.  This was 
> causing
> compile error "incorrect register %rax' used withl' suffix" with newer GCC 
> versions.
> The problem was a bug in spinlock.h in-line assembly, where references were 
> for a
> register (g - incorrect) vs. memory (m - correct). Thanks to gleb and kevin 
> from
> KVM team for finding the bug and fix.

Applied, thanks!

> Signed-off-by: Chris Evich<[email protected]>
> ---
>   client/tests/monotonic_time/src/spinlock.h |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/client/tests/monotonic_time/src/spinlock.h 
> b/client/tests/monotonic_time/src/spinlock.h
> index b70116a..2e57f25 100644
> --- a/client/tests/monotonic_time/src/spinlock.h
> +++ b/client/tests/monotonic_time/src/spinlock.h
> @@ -17,12 +17,12 @@ static inline void spin_lock(spinlock_t *lock)
>               "1: rep; nop\n"
>               " lock; btsl $0,%0\n"
>               "jc 1b\n"
> -                          : "=g"(*lock) : : "memory");
> +                          : "=m"(*lock) : : "memory");
>   }
>
>   static inline void spin_unlock(spinlock_t *lock)
>   {
> -     __asm__ __volatile__("movl $0,%0; rep; nop" : "=g"(*lock) :: "memory");
> +     __asm__ __volatile__("movl $0,%0; rep; nop" : "=m"(*lock) :: "memory");
>   }
>
>   #endif      /* SPINLOCK_H_ */

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to