Re: [PATCH] futex: Set USER_DS for the futex_detect_cmpxchg() test

Thomas Gleixner
2018-09-28T19:38:37Z

[-- Attachment #1: Type: text/plain, Size: 751 bytes --]

On Fri, 28 Sep 2018, Andy Lutomirski wrote:
> On Fri, Sep 28, 2018 at 7:53 AM Martin Schwidefsky <schwidefsky@de.ibm.com> wrote:
> > On Fri, 28 Sep 2018 07:11:44 -0700 Andy Lutomirski <luto@amacapital.net> wrote:
> >
> > > There’s another way to skin this cat: keep KERNEL_DS but pass a valid pointer.
> > > I don’t suppose you remember why you didn’t do that?
> >
> > No, I don't remember. To use a valid kernel pointer with KERNEL_DS and
> > then test for == 0 (vs -ENOSYS) imho should work.
> >
>
> There may be a much nicer solution. Unless I missed something, only
> mips and xtensa even have the possibility of cmpxchg being missing.
> We could just make those arches supply a futex-detecting helper.

That makes sense.

Thanks,

tglx