Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp477889imm; Fri, 28 Sep 2018 01:32:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV60CohaNsqL83dEgvmzKh8fRh1CmDILyPIHx061Swjiuw/MYQtoLmaCO37PB0DLYsvDPe72l X-Received: by 2002:a62:45d2:: with SMTP id n79-v6mr15564611pfi.137.1538123536651; Fri, 28 Sep 2018 01:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538123536; cv=none; d=google.com; s=arc-20160816; b=yunuOA0ji4z1svo5FqVxTQy1lyPGGWGHBO9IFm2k/l0OvPATqxNJvACl5I++l0MIeK 3pU9WfhQp/vrws3bgP/kPRlMlUrbNATTK5qlUfmJj0nB4qTPf1hxF/9kso6347JyOife xqpX9vobKECKfEGLJZjvSSovkMfjn23H164/uQdTjH7m7VHFoOr4utKR79UJgdig5/7U t3N4oISd1k4pMs4EDFaiH9iTIFFrdlnK8ghFv8m3c+J+X2HZFqgmbEb7FjvvhSKIQBrt RyJQ8oci+/qggA70S69/71JLJBe+S1bDt8ejh9l3fY47BkLYb7nwmL2XWUIt7PclVkQn gT+A== 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=TgE7H94shXhL5/lTmfi9TMv5Lrxj6rdBLgvaZtvn0Yw=; b=GUdA2gpi7l20lVkLZdCTMiTe9yKhm9Rj6V6ZZEDP6MfL4Racx5K2afL6rOjokP0iUU oUBkUlP7sHROEoZkDONdPStuplu/AfBTk74KXJms6V7WL4Sa2nCQ5Ahuq/oT1LVgcAmF +tTjFDPzREHAueiAKmQ+KfTH3HutXV9Inqa/A9881/+SWUkpMn5BPCZr1hxhgmej3xl2 NNX6iyvT8DbD0boyyTpLvXk8WIadUgEYmKcCjUYU71FtWsOIts3IY387LyoPM1T+kkls NqnLAcsxatjvPYbcVvXBoJ9GA0sEop/ONBIHe5zLQEAJVUjAjbwajZ2aX65dzioKIkHb Bo5w== 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 p1-v6si4272582plb.197.2018.09.28.01.31.59; Fri, 28 Sep 2018 01:32:16 -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 S1728995AbeI1OyQ (ORCPT + 99 others); Fri, 28 Sep 2018 10:54:16 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53651 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726291AbeI1OyP (ORCPT ); Fri, 28 Sep 2018 10:54:15 -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 1g5oBP-0003CG-2f; Fri, 28 Sep 2018 10:31:31 +0200 Date: Fri, 28 Sep 2018 10:31:27 +0200 (CEST) From: Thomas Gleixner To: Geert Uytterhoeven cc: Andy Lutomirski , the arch/x86 maintainers , Peter Zijlstra , Ingo Molnar , Darren Hart , Linux Kernel Mailing List , linux-s390 , Martin Schwidefsky , Heiko Carstens , Finn Thain Subject: Re: [PATCH] futex: Set USER_DS for the futex_detect_cmpxchg() test In-Reply-To: Message-ID: References: <74fb6ce22f62e0fb48b91ca9918b74cedbcecaf1.1538096323.git.luto@kernel.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 28 Sep 2018, Geert Uytterhoeven wrote: > > On Fri, Sep 28, 2018 at 8:21 AM Thomas Gleixner wrote: > > On Thu, 27 Sep 2018, Andy Lutomirski wrote: > > > I have a couple questions here: > > > > > > - Is this actually okay on all architectures? That is, are there > > > cases where we'll screw up if we fail a USER_DS access this early? > > > s390 stands out as the obvious special case (where USER_DS is not > > > than just a subset of KERNEL_DS), but s390 opts out. > > > > > > - Why doesn't x86 set HAVE_FUTEX_CMPXCHG? Or do we still support > > > some 32-bit configurations that don't have cmpxchg and don't know > > > about it at compile time? > > > > I'm not entirely sure. Have to dig into the details. I assume S390 just can > > set it though. > > Not sure. My "[PATCH] futex: Switch to USER_DS for futex test" > (https://www.spinics.net/lists/stable/msg28846.html), which is > basically the same > as this patch, broke s390, so it was never merged. > > See "[BUG -next] "futex: switch to USER_DS for futex test" breaks s390" > (https://www.spinics.net/lists/linux-next/msg27902.html) > > Heiko said: > | Martin and I discussed this today and we will change the s390 code so that > | it will also survive very early USER_DS accesses (without valid current->mm) > | since we also discovered a couple of other oddities in our code. > > I don't know if that has happened, and whether it would work on s390 now. Duh yes, forgot about that one. But as S390 always has cmpxchg it simply can set HAVE_FUTEX_CMPXCHG which avoids the check completely. Surely they want to fix the other oddities or have done so already :) Thanks, tglx