mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: <mingo@elte.hu>, "Jeremy Fitzhardinge" <jeremy@goop.org>,
	<tglx@linutronix.de>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] x86: enlightenment for ticket spinlocks - remove  NOPs from unlock path
Date: Tue, 02 Feb 2010 08:30:52 +0000	[thread overview]
Message-ID: <4B67F0CC020000780002D200@vpn.id2.novell.com> (raw)
In-Reply-To: <4B675BBB.20303@zytor.com>

>>> "H. Peter Anvin" <hpa@zytor.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


      reply	other threads:[~2010-02-02  8:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-29  8:02 Jan Beulich
2010-02-01 22:54 ` H. Peter Anvin
2010-02-02  8:30   ` Jan Beulich [this message]

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=4B67F0CC020000780002D200@vpn.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®