Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

From
H. Peter Anvin <hpa@zytor.com>
Date
2016-04-20 22:30:31
Also in
linux-arch, linux-s390, linux-sh, lkml, sparclinux
Reply to
Borislav Petkov, 2016-04-20
On April 20, 2016 2:36:37 PM PDT, Borislav Petkov [off-list ref] wrote:
On Wed, Apr 20, 2016 at 02:06:33PM -0700, H. Peter Anvin wrote:
quoted
Setting ret to sem doesn't make any sense.  Just use "=a" and "a".
Yeah, that's what Michal's patch ontop does.

And to answer my own question: we need the "a" (sem) input for the fast
path.

I guess we can still move "1" (RWSEM_ACTIVE_WRITE_BIAS) before the
asm():

long tmp = RWSEM_ACTIVE_WRITE_BIAS;

One thing I'm still not clear on is why we need the output tmp operand:
"=d" (tmp) ?
Since it is a fixed register we could just mark edx clobbered, but with more flexible register constraints it can permit gcc to allocate a temp resister for us.
-- 
Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.
Thread (35 messages) 35 messages, 6 authors, last reply 2016-04-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help