lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 29 Oct 2008 20:54:58 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Jike Song <albcamus@...il.com>
CC:	Ingo Molnar <mingo@...e.hu>, tglx@...utronix.de, mingo@...hat.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86: fix inline assembly constraints

Jike Song wrote:
> 
> Besides, by looking at the inline assembly in kernel,  I found lots of
> codes like this:
> 
>         static inline void atomic_add(int i, atomic_t *v)
>         {
> 	        asm volatile(LOCK_PREFIX "addl %1,%0"
> 		             : "=m" (v->counter)
> 		             : "ir" (i), "m" (v->counter));
>         }
> 
> 
> Yes, it works. But a little ugly..  Should this be cleaned-up with the
> following?
> 
>         : "+m" (v->counter)
>         : "ir" (i)
> 
> If you agrees, I'll send out the patch; otherwise I won't wasting your time ;-)
> 

Please don't change them just to change them, if there is no actual
error.  You never know when you're going to trigger a new bug in some
weird version of gcc.

	-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ