Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp852280imm; Fri, 28 Sep 2018 07:54:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV60c8ffSbbYOvLso/rL69vBmdwNiwvb2a/92tofi/XGf6x3kMWeknGPl6Wi891WfKGKvrINc X-Received: by 2002:a63:7f0e:: with SMTP id a14-v6mr6290725pgd.296.1538146467178; Fri, 28 Sep 2018 07:54:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538146467; cv=none; d=google.com; s=arc-20160816; b=zA5n5Y0IQpjLtwkitvrfzBJooirVsmiBHrUPpYaNhy6cXm9KXosH94Ihl1Df/Q9Uhz /W0cuK58WVoT2Q1i0bRmhPP1h7ZP9pPOfaaZfhpbFbbVEjNCsCGuWC7K5yo6bFU8R6wL MN2en+iYO+i+wT1+gzg15sYgzGTQFsmIxdpx6lMzY7hnbPyEeTccUuCGWNkLBBYPiO9E B/3Vo5YCeuQ9zM2PqceWp5+0qRlDAEqudrQJvd4fzWP25AwXXxULSKufiDiRl/D17Jrf Fi+zY1XDGN1vaSu9hFCdmVHc10+JDBXPutgyVEm49Ae2Li+b783YKGTzkZScOglY4Brx YPdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :message-id:references:in-reply-to:subject:cc:to:from:date; bh=tVGNkzBoOyx0Xn50u66q5wIWmHeD4sSXXYEusxgF8pU=; b=IYYmI71OIsIjKRg8l3z6nXO7yXKqc3lparRv6NltZfmIT8ewWiaM+etx7MfHm/71Mo IHn3xjoYeUwb3QkhB3NGiptvXsk8v/2sun1w1S114wzRzHWSaUsi5sZ8wwDgn8K45r93 L75Yd3TpWg3SCvfCM/nekMcFd5qa51dzxuLCR6enii9AxLKEkdgV7BgLn8nRNsTfGs0M +m84QeWhKSeUKtDS1ezY565ZTxm7gISOem76+590yZ5iktFtXpRzsyI8Xy2b/bJR6XnX A0pAMH0f13JrpRqd29obiFmF2FcY2dT1BguPSf/GdIWXhZN9xOD4yH1svtPGDJZ+bLGQ yZBQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c17-v6si4848576pgc.158.2018.09.28.07.54.11; Fri, 28 Sep 2018 07:54:27 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729187AbeI1VRl convert rfc822-to-8bit (ORCPT + 99 others); Fri, 28 Sep 2018 17:17:41 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40006 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726867AbeI1VRl (ORCPT ); Fri, 28 Sep 2018 17:17:41 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8SEmiTU065057 for ; Fri, 28 Sep 2018 10:53:32 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2msnhqaupv-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Sep 2018 10:53:31 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Sep 2018 15:53:29 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 28 Sep 2018 15:53:24 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8SErNXN61866094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 28 Sep 2018 14:53:23 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 56DCD11C058; Fri, 28 Sep 2018 17:53:03 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E7BCF11C050; Fri, 28 Sep 2018 17:53:02 +0100 (BST) Received: from mschwideX1 (unknown [9.152.212.164]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 28 Sep 2018 17:53:02 +0100 (BST) Date: Fri, 28 Sep 2018 16:53:21 +0200 From: Martin Schwidefsky To: Andy Lutomirski Cc: Thomas Gleixner , 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> References: <74fb6ce22f62e0fb48b91ca9918b74cedbcecaf1.1538096323.git.luto@kernel.org> <20180928103726.07761672@mschwideX1> <0B38810F-3E22-45A8-9D5D-EDEABD214148@amacapital.net> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) X-TM-AS-GCONF: 00 x-cbid: 18092814-0016-0000-0000-0000020BDFEC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18092814-0017-0000-0000-000032630CBD Message-Id: <20180928165321.0ddaf948@mschwideX1> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-28_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809280150 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 28 Sep 2018 07:11:44 -0700 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? No, I don't remember. To use a valid kernel pointer with KERNEL_DS and then test for == 0 (vs -ENOSYS) imho should work. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.