mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuck Ebbert <76306.1226@compuserve.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@osdl.org>,
	Arjan van de Ven <arjan@infradead.org>,
	Ulrich Drepper <drepper@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [patch 5/6] lightweight robust futexes: i386
Date: Tue, 21 Feb 2006 10:54:20 -0500	[thread overview]
Message-ID: <200602211056_MC3-1-B8E9-59D2@compuserve.com> (raw)

In-Reply-To: <20060216094234.GF29716@elte.hu>

On Thu, 16 Feb 2006 at 10:42:34 +0100, Ingo Molnar wrote:

> --- linux-robust-list.q.orig/include/asm-i386/futex.h
> +++ linux-robust-list.q/include/asm-i386/futex.h
> @@ -107,7 +107,25 @@ futex_atomic_op_inuser (int encoded_op, 
>  static inline int
>  futex_atomic_cmpxchg_inuser(int __user *uaddr, int oldval, int newval)
>  {
> -     return -ENOSYS;
> +     __asm__ __volatile__(
> +             "1:     " LOCK_PREFIX "cmpxchgl %3, %1          \n"
> +
> +             "2:     .section .fixup, \"ax\"                 \n"
> +             "3:     mov     %2, %0                          \n"
> +             "       jmp     2b                              \n"
> +             "       .previous                               \n"
> +
> +             "       .section __ex_table, \"a\"              \n"
> +             "       .align  8                               \n"
> +             "       .long   1b,3b                           \n"
> +             "       .previous                               \n"
> +
> +             : "=a" (oldval), "=m" (*uaddr)
                                 ^^^^
   Should be "+m" because it's both read and written.

> +             : "i" (-EFAULT), "r" (newval), "0" (oldval)
> +             : "memory"
                  ^^^^^^^^
   Is this necessary? Every possible memory location that could be
affected has been listed in the operands if the above change is made.

> +     );
> +
> +     return oldval;
>  }
>  
>  #endif
-- 
Chuck
"Equations are the Devil's sentences."  --Stephen Colbert

             reply	other threads:[~2006-02-21 15:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-21 15:54 Chuck Ebbert [this message]
2006-02-21 16:38 ` Ulrich Drepper
  -- strict thread matches above, loose matches on Subject: below --
2006-02-22 21:45 Chuck Ebbert
2006-02-21  8:47 Ingo Molnar
2006-02-16  9:42 Ingo Molnar

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=200602211056_MC3-1-B8E9-59D2@compuserve.com \
    --to=76306.1226@compuserve.com \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=drepper@redhat.com \
    --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

Powered by JetHome