Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp839729imm; Fri, 28 Sep 2018 07:41:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV60R483Uz1xF/YdC1ly7IOEawmcVXF4t/b4cgzqFi1ZMuzC+26Dcm6MTmMew+rwArjPMA1bZ X-Received: by 2002:a62:8a4f:: with SMTP id y76-v6mr11857257pfd.142.1538145697225; Fri, 28 Sep 2018 07:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538145697; cv=none; d=google.com; s=arc-20160816; b=yaYyKvoo17EjfkkTFxWcFUyd1+jz44ZjAr7Syu5N0Kskz9fQkiTD0COGaJJSskdJcn Rw16b6kxIcsCMl6XsVT1igcn7ND2bJzGaZRF/xPqky7YA/vl8+8/o4IVTIv4Ey6fFgEl XGK1OULwdKG6f/LADUMhol1Vq3MuIsCvdsufdqMjNu/wEv4NElFNFRom3Q1Ex0WmEv0C DYyoG/atyqDmxEXmrNRP0gafiaIo2ts5wFgKnyMu9KOcl7j+t88vvzcJZmVc/VtBtYFp mI5Maykyu60RUDmqwEsYM27bbg3A2866Fg2K08gY8QTFEHnhc89EnTqw7qH2L8OKb6jT CoaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=yq6aZdZpjMqIXI9PTUMH4NbYX6NXDyOy1RE+cBY7QVc=; b=NgrxTqtwxMcmr8WgHnt7tt4CJz+TCBELIonwUoMtQWLR7VQE2NomJGmgFXKCAQpP68 8Vq8Vpd/XkHqBbA1OryxfE/DC8SIYASHvMHeFv3Dn1gtV8CQu8mJeCyJOqcjFtnJVeos tH7Ec4IWj6gKi9Dmdo7PZCGL//5Ie5cs5hNofO9/UWQFcUDm8TMEXef80R58NsjAosQ/ TUjHdK49PLpROyr71sAJChBHH9pZs/RzluBlJkP2f/v9zDoM/efNCB35wB5eTBRuWqvW 4duy8JUa9lAB+kvM2NFCXJ3+rBJ5qkBuNAvX+p2aPmtztstx6iUqtMpsEOQbrB6+bytA 8LmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o33-v6si4768618plb.489.2018.09.28.07.41.21; Fri, 28 Sep 2018 07:41:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728889AbeI1VFT (ORCPT + 99 others); Fri, 28 Sep 2018 17:05:19 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:54607 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726473AbeI1VFT (ORCPT ); Fri, 28 Sep 2018 17:05:19 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1g5tww-0000Zg-VS; Fri, 28 Sep 2018 16:40:59 +0200 Date: Fri, 28 Sep 2018 16:40:58 +0200 (CEST) From: Thomas Gleixner To: Andy Lutomirski cc: Martin Schwidefsky , Geert Uytterhoeven , Andy Lutomirski , the arch/x86 maintainers , Peter Zijlstra , Ingo Molnar , Darren Hart , Linux Kernel Mailing List , linux-s390 , Heiko Carstens , Finn Thain Subject: Re: [PATCH] futex: Set USER_DS for the futex_detect_cmpxchg() test In-Reply-To: <0B38810F-3E22-45A8-9D5D-EDEABD214148@amacapital.net> Message-ID: References: <74fb6ce22f62e0fb48b91ca9918b74cedbcecaf1.1538096323.git.luto@kernel.org> <20180928103726.07761672@mschwideX1> <0B38810F-3E22-45A8-9D5D-EDEABD214148@amacapital.net> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1735524495-1538145658=:2004" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1735524495-1538145658=:2004 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Fri, 28 Sep 2018, Andy Lutomirski wrote: > > On Sep 28, 2018, at 1:42 AM, Thomas Gleixner wrote: > > > >> On Fri, 28 Sep 2018, Martin Schwidefsky wrote: > >> On Fri, 28 Sep 2018 09:12:10 +0200 > >> Geert Uytterhoeven wrote: > >>> I don't know if that has happened, and whether it would work on s390 now. > >> > >> commit 03b8c7b623c80af264c4c8d6111e5c6289933666 > >> Author: Heiko Carstens > >> Date: Sun Mar 2 13:09:47 2014 +0100 > >> > >> futex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test > >> > >> If an architecture has futex_atomic_cmpxchg_inatomic() implemented and there > >> is no runtime check necessary, allow to skip the test within futex_init(). > >> > >> This allows to get rid of some code which would always give the same result, > >> and also allows the compiler to optimize a couple of if statements away. > >> > >> Signed-off-by: Heiko Carstens > >> Cc: Finn Thain > >> Cc: Geert Uytterhoeven > >> Link: http://lkml.kernel.org/r/20140302120947.GA3641@osiris > >> Signed-off-by: Thomas Gleixner > >> > >> > >> Heiko created the CONFIG_HAVE_FUTEX_CMPXCHG to get around this issue. > >> We just skip the runtime check as well as arc, m68k and sh. Not sure > >> about xtensa, the set it config option only for !MMU. > > > > Duh. grep would have told me. -ENOTENOUGHCOFFEE > > > > > 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? IIRC, there was an issue with extra checks in some architectures when you handed in a kernel address spitting warnings or such. That's probably gone by now, but I can't tell for sure. At least the requirement to do runtime detection for x86 is gone. Don't know if any other architecture still has it. Thanks, tglx --8323329-1735524495-1538145658=:2004--