Re: [PATCH] futex: Set USER_DS for the futex_detect_cmpxchg() test
From: Thomas Gleixner
Date: Fri Sep 28 2018 - 15:38:45 EST
On Fri, 28 Sep 2018, Andy Lutomirski wrote:
> On Fri, Sep 28, 2018 at 7:53 AM Martin Schwidefsky <schwidefsky@xxxxxxxxxx> wrote:
> > On Fri, 28 Sep 2018 07:11:44 -0700 Andy Lutomirski <luto@xxxxxxxxxxxxxx> 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