From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2209C2D0DB for ; Thu, 23 Jan 2020 18:02:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6343322464 for ; Thu, 23 Jan 2020 18:02:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="R8rUnlTA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6343322464 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 906176B0003; Thu, 23 Jan 2020 13:02:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 88EEC6B0006; Thu, 23 Jan 2020 13:02:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7586F6B0007; Thu, 23 Jan 2020 13:02:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0184.hostedemail.com [216.40.44.184]) by kanga.kvack.org (Postfix) with ESMTP id 5BC416B0003 for ; Thu, 23 Jan 2020 13:02:55 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 069FB2492 for ; Thu, 23 Jan 2020 18:02:55 +0000 (UTC) X-FDA: 76409669910.27.jump58_5398ff47b1d14 X-HE-Tag: jump58_5398ff47b1d14 X-Filterd-Recvd-Size: 4939 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Thu, 23 Jan 2020 18:02:54 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id z22so4626695ljg.1 for ; Thu, 23 Jan 2020 10:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eDGhNOsnfRqZ1FkvFFgvc9AjFE5Ddur1Pg9CKAfnAxU=; b=R8rUnlTAVJ23suSGKIAk3x/NWMyIV1571Zyk795MWw02ibpxnwpaVKBgIpemglXFyP UyAn/M4pPrtxudOzb1Yimjimwf7PBh+D79Avp2N7YtdpAxKItUKS5GifZRNjNI8G6ljo pty5cnSbJVgpFW0/1axLB6FvRc4gFKR+F0mc8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eDGhNOsnfRqZ1FkvFFgvc9AjFE5Ddur1Pg9CKAfnAxU=; b=hj56twJ671JhuQl66/xcrwZ5woOl2qhPVMNwZSxVJDvlXb/T30sdCox/xvBoD7sAg4 yGllqGTy2hGkvQx5ZkBIhwcRDzpahGglPT54QxKE/95xyAa0CqyHBML9QHkdWq6yXMl+ DY1+JQTj6arBbC9aBviyYH5DqQ9n35NiO1kDgdL1aFiN2krZ8NuL6QlBlui5bMGbblee 7FnnA0tZCTCBsfRrV9B0Br/VqMZuZQ5ZcD57m3rJsZ9TdHbQ78nLeB0JO9VoSQ7U9gwI AsiPmqpLUHFR30BPDb86M111P+xIX1aypDcfGdtQRv+K1UPLktxHPh5GYVnura+T+qMa y72w== X-Gm-Message-State: APjAAAUaKpmEGAIemArsYWHWNKSjoSuZQJtDq2Jzfx4dxcZffHkHVhs2 eEOxqeMPzDh1G5N42XmR1x/xNL1eYNE= X-Google-Smtp-Source: APXvYqzVjdvHP19JkAYbzO13L2gMJsEM8lLAHmUheqxXPrXdLFAbmsd0f5s9O/bzsHzTyylw8NjbTw== X-Received: by 2002:a2e:9e43:: with SMTP id g3mr11448555ljk.37.1579802571316; Thu, 23 Jan 2020 10:02:51 -0800 (PST) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com. [209.85.208.179]) by smtp.gmail.com with ESMTPSA id g15sm1680046ljn.32.2020.01.23.10.02.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Jan 2020 10:02:50 -0800 (PST) Received: by mail-lj1-f179.google.com with SMTP id m26so4542154ljc.13 for ; Thu, 23 Jan 2020 10:02:50 -0800 (PST) X-Received: by 2002:a05:651c:282:: with SMTP id b2mr23878285ljo.41.1579802569766; Thu, 23 Jan 2020 10:02:49 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Thu, 23 Jan 2020 10:02:33 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/7] uaccess: Tell user_access_begin() if it's for a write or not To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Alexander Viro , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Jani Nikula , Linux Kernel Mailing List , linuxppc-dev , linux-fsdevel , Linux-MM , dri-devel , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jan 23, 2020 at 4:59 AM Christophe Leroy wrote: > > On 32 bits powerPC (book3s/32), only write accesses to user are > protected and there is no point spending time on unlocking for reads. Honestly, I'm starting to think that 32-bit ppc just needs to look more like everybody else, than make these changes. We used to have a read/write argument to the old "verify_area()" and "access_ok()" model, and it was a mistake. It was due to odd i386 user access issues. We got rid of it. I'm not convinced this is any better - it looks very similar and for odd ppc access issues. But if we really do want to do this, then: > Add an argument to user_access_begin() to tell when it's for write and > return an opaque key that will be used by user_access_end() to know > what was done by user_access_begin(). You should make it more opaque than "unsigned long". Also, it shouldn't be a "is this a write". What if it's a read _and_ a write? Only a write? Only a read? Linus