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] [day] [month] [year] [list]
Date:	Tue, 02 Feb 2010 08:30:52 +0000
From:	"Jan Beulich" <JBeulich@...ell.com>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	<mingo@...e.hu>, "Jeremy Fitzhardinge" <jeremy@...p.org>,
	<tglx@...utronix.de>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] x86: enlightenment for ticket spinlocks -
	 remove  NOPs from unlock path

>>> "H. Peter Anvin" <hpa@...or.com> 01.02.10 23:54 >>>
>> --- 2.6.33-rc5-virt-spinlocks.orig/arch/x86/include/asm/alternative-asm.h
>> +++ 2.6.33-rc5-virt-spinlocks/arch/x86/include/asm/alternative-asm.h
>> @@ -1,3 +1,7 @@
>> +#if 0 /* Hide this from compiler. */
>> +	.if 0 # Hide assembly source stuff when assembling compiler output.
>> +#endif
>> +
>>  #ifdef __ASSEMBLY__
>>  
>>  #include <asm/asm.h>
>> @@ -16,3 +20,58 @@
>>  #endif
>>  
>>  #endif  /*  __ASSEMBLY__  */
>> +
>> +#if 0 /* Hide this from compiler. */
>> +	.else # Code to be used in compiler output:
>> +
>> +	.weak _$.zero
>> +
>> +	.macro unary opc arg1 arg2 arg3
>...
>> +	.endm
>> +
>> +	.endif
>> +#endif
>
>Okay, I have absolutely no idea what this macro either *does* or what
>it's *supposed to do* nor if it matches... you kind of forgot to
>describe that.

It does what the patch description says - extend the (memory) operand
of a unary opcode (inc in the case where it's being used) to maximum
width (i.e. to include a 32-bit displacement regardless of whether one
really is needed). It just needs to consider the different cases of what
operands gcc may output. And it gets more complicated because
commas in the operand are being treated as macro operand separators.

>The other bit is that this whole handling with .if and
>#if is just too ugly to live.  Create two include files at the very minimum.

The new one ought to use the same construct then anyway, as inclusion
of the file visible to gcc is desirable for dependency tracking, while
wrapping the whole construct in an __asm__() doesn't seem desirable
to me due to it making the whole thing even less readable.

Jan

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