linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Oskolkov <posk@posk.io>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	 Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	linux-mm@kvack.org,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-api@vger.kernel.org
Cc: Paul Turner <pjt@google.com>, Ben Segall <bsegall@google.com>,
	Peter Oskolkov <posk@google.com>,
	 Andrei Vagin <avagin@google.com>, Jann Horn <jannh@google.com>,
	 Thierry Delisle <tdelisle@uwaterloo.ca>
Subject: Re: [PATCH v0.7 2/5] mm, x86/uaccess: add userspace atomic helpers
Date: Tue, 26 Oct 2021 16:21:55 -0700	[thread overview]
Message-ID: <CAFTs51V8c3vuw-hFHWuxJDnvr2t-tNs8SC7syFOVvVSm8JdKKQ@mail.gmail.com> (raw)
In-Reply-To: <20211012232522.714898-3-posk@google.com>

On Tue, Oct 12, 2021 at 4:25 PM Peter Oskolkov <posk@posk.io> wrote:

[...]

> +static inline int __try_xchg_user_32(u32 *oval, u32 __user *uaddr, u32 newval)
> +{
> +       u32 oldval = 0;
> +       int ret = 0;
> +
> +       asm volatile("\n"
> +               "1:\txchgl %0, %2\n"
> +               "2:\n"
> +               "\t.section .fixup, \"ax\"\n"
> +               "3:\tmov     %3, %0\n"

I believe the line above should be "mov %3, %1", not "mov %3, %0".
I'll fix this in the next patchset mailing.

> +               "\tjmp     2b\n"
> +               "\t.previous\n"
> +               _ASM_EXTABLE_UA(1b, 3b)
> +               : "=r" (oldval), "=r" (ret), "+m" (*uaddr)
> +               : "i" (-EFAULT), "0" (newval), "1" (0)
> +       );
> +
> +       if (ret)
> +               return ret;
> +
> +       *oval = oldval;
> +       return 0;
> +}
> +
> +static inline int __try_xchg_user_64(u64 *oval, u64 __user *uaddr, u64 newval)
> +{> +> +
> +       u64 oldval = 0;
> +       int ret = 0;
> +
> +       asm volatile("\n"
> +               "1:\txchgq %0, %2\n"
> +               "2:\n"
> +               "\t.section .fixup, \"ax\"\n"
> +               "3:\tmov     %3, %0\n"

Same here.

[...]


  reply	other threads:[~2021-10-26 23:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12 23:25 [PATCH v0.7 0/5] sched,mm,x86/uaccess: implement User Managed Concurrency Groups Peter Oskolkov
2021-10-12 23:25 ` [PATCH v0.7 1/5] sched/umcg: add WF_CURRENT_CPU and externise ttwu Peter Oskolkov
2021-10-12 23:25 ` [PATCH v0.7 2/5] mm, x86/uaccess: add userspace atomic helpers Peter Oskolkov
2021-10-26 23:21   ` Peter Oskolkov [this message]
2021-10-12 23:25 ` [PATCH v0.7 3/5] sched/umcg: implement UMCG syscalls Peter Oskolkov
2021-10-13 19:43   ` kernel test robot
2021-10-13 21:47   ` kernel test robot
2021-10-15 21:40   ` kernel test robot
2021-10-18 15:23   ` Tao Zhou
2021-10-12 23:25 ` [PATCH v0.7 4/5] sched/umcg: add Documentation/userspace-api/umcg.rst Peter Oskolkov
2021-10-12 23:25 ` [PATCH v0.7 5/5] sched/umcg: add Documentation/userspace-api/umcg.txt Peter Oskolkov
2021-10-18 14:50   ` Tao Zhou

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=CAFTs51V8c3vuw-hFHWuxJDnvr2t-tNs8SC7syFOVvVSm8JdKKQ@mail.gmail.com \
    --to=posk@posk.io \
    --cc=akpm@linux-foundation.org \
    --cc=avagin@google.com \
    --cc=bsegall@google.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=jannh@google.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=posk@google.com \
    --cc=tdelisle@uwaterloo.ca \
    --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;
as well as URLs for NNTP newsgroup(s).