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]
Message-Id: <1197848331.3749.86.camel@brick>
Date:	Sun, 16 Dec 2007 15:38:51 -0800
From:	Harvey Harrison <harvey.harrison@...il.com>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 4/4] x86: Final unification of local_{32|64}.h

On Sun, 2007-12-16 at 14:48 -0800, H. Peter Anvin wrote:
> Ingo Molnar wrote:
> > * Harvey Harrison <harvey.harrison@...il.com> wrote:
> > 
> >> No differences except for the defintion of local_add_return on X86_64. 
> >> The X86_32 version is just fine as it is protected with ifdef 
> >> CONFIG_M386 so use it directly.
> > 
> > thanks, i've applied your 4 patches to x86.git.
> > 
> > btw., now that we have a single unified file, it might make sense to fix 
> > these checkpatch complaints:
> > 
> >   total: 10 errors, 1 warnings, 257 lines checked
> > 
> > in case you are interested ;-)
> > 
> 
> Please pull them pending revision, they're broken (macros don't expand 
> inside strings...)
> 

Do you have a stylistic preference between these two options:

Option 1) Rely on CPP string constant concatenation

// possibly include trailing space here to avoid remembering
// leading space on the register names
# define _ASM_INC "incl" 

static inline void local_inc(local_t *l)
{
	__asm__ __volatile__(
		_ASM_INC " %0"
		:"+m" (l->a.counter));
}

Option 2) Macro Expansion

# define _ASM_INC(r) \"incl\ ##r\"

static inline void local_inc(local_t *l)
{
	__asm__ __volatile__(
		_ASM_INC(%0);
		:"+m" (l->a.counter));
}

Or some other suggestion.

Harvey



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