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 1/3] x86: enlightenment for ticket spinlocks - base implementation
Date: Tue, 02 Feb 2010 09:04:33 +0000 [thread overview]
Message-ID: <4B67F8B1020000780002D218@vpn.id2.novell.com> (raw)
In-Reply-To: <4B675BBE.7080800@zytor.com>
>>> "H. Peter Anvin" <hpa@zytor.com> 01.02.10 23:54 >>>
>I'm really not very happy with the way the asm statement is chopped to
>bits here. It is quite frankly much cleaner to have a little bit of
>code replication and have two separate clean asm/alternative_io
>implementations.
Yeah, that's a tradeoff I wasn't sure about either. I can easily change
this, but to me it seemed more desirable to have less duplication.
>A thought, however:
>
>the sequence "rep;nop; movb %1,%b0" should be enough bytes to be able to
>overwrite it with a call instruction. I am not sure if the existing
Hmm, yes, including the branch there would be 6 bytes guaranteed.
>macros allow for overwriting part of an asm statement, but it might be
>an interesting thing to do. That should eliminate the funnies you have
They don't currently, but adding an offset shouldn't be that difficult.
The goal certainly was to avoid touching the alternative instructions
infrastructure more than absolutely necessary.
>with rip-relative addressing (which may very well be the preferred
>addressing modes.) It should also give you the return address without
>having to play games with pushing it onto the stack as anything other
>than a return address...
Yes, for the locking path. The unlocking path could also be done with
a "proper" call (even without adjustments to the alternative instructions
data structures), but would introduce more branches in the inline stub.
It's not clear to me whether that's better.
So if you want me to give that a try, I certainly will, provided the
alternative instructions adjustments needed won't increase the
resistance to the patch.
Jan
prev parent reply other threads:[~2010-02-02 9:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-29 8:00 Jan Beulich
2010-02-01 22:54 ` H. Peter Anvin
2010-02-02 9:04 ` 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=4B67F8B1020000780002D218@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®