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.9 required=3.0 tests=DKIMWL_WL_HIGH,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 79EDFC33CAF for ; Thu, 23 Jan 2020 18:02:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F09624655 for ; Thu, 23 Jan 2020 18:02:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579802576; bh=QlTBNP6TZNzi2X5VtLqQmjrH8iIvqT1D0WMVKVLJ0Q4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=iOHCTfsBBIxfXe5q7jCZ2YegepuxT+Xq40vGyxTWljtfLnAk7l3VG+tAdAuzaY+oR XD1pW5VlewjdxfLN02CiwAPV3mxhPjhstqT5kwX4KEVu+wEujiUNWefQCgu7feDeBo oZmvhLNDGJRQiL/Wk3jMILAsaQwyemzP05FO0rqU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728928AbgAWSCz (ORCPT ); Thu, 23 Jan 2020 13:02:55 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:38151 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728665AbgAWSCy (ORCPT ); Thu, 23 Jan 2020 13:02:54 -0500 Received: by mail-lj1-f195.google.com with SMTP id w1so4601924ljh.5 for ; Thu, 23 Jan 2020 10:02:53 -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=F8z74mr/Rcl1/mUAcTcKSeeifiOXqVWfAnTXAT44BLiFk3nvOTHVlAAyvMAj+I4Vh9 RUOHmtV332CarnXZfQB1/10b4SFxH8+FGM2oGAO1YSKd1ckOUuaEBgvXyuko/pWV8S6Z GuhZdRAMnVCe8ruC0/h8eoRFTaZwm6GwjrUOrL9aXkYgIJqKXsNQZPNPxLQKUxl1gND2 FmX3QzZZFUNtoW67BinZj6vSZIcEeFPIDaRBdMS0kbPIBRxEfXlPGgRsZ8ezgyD1Fsz+ UG+3tJ0eX39IZStdY+kQqsqjLklJcpw2J6SHwdeigot+A+2xrfpZIRefC8d0+V9qqR8o 5mrA== X-Gm-Message-State: APjAAAWihUOvf0a63KDitTdNt2Mi+oa1pWbq1e95mHvoYKi7oH+/uy/3 z1kG1HGXqa23Mk1silNQ9+iGGH9Rws8= X-Google-Smtp-Source: APXvYqw+6uLLR8MqOx+EGvqOjfuMTYpF98lYZBp3jqq9zH4vTvCceVRBF/5hld1RyyYfAjrI9KGuwA== X-Received: by 2002:a2e:94c8:: with SMTP id r8mr24299472ljh.28.1579802571087; Thu, 23 Jan 2020 10:02:51 -0800 (PST) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com. [209.85.208.171]) by smtp.gmail.com with ESMTPSA id r21sm1700435ljn.64.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-f171.google.com with SMTP id y6so4636965lji.0 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 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.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 C0F69C2D0DB for ; Thu, 23 Jan 2020 18:17:46 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1BD062077C for ; Thu, 23 Jan 2020 18:17:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (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 1BD062077C 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=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 483Vqp3JbjzDqND for ; Fri, 24 Jan 2020 05:17:42 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=2a00:1450:4864:20::142; helo=mail-lf1-x142.google.com; envelope-from=torvalds@linuxfoundation.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=google header.b=R8rUnlTA; dkim-atps=neutral Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 483VgF1yvrzDqX7 for ; Fri, 24 Jan 2020 05:10:15 +1100 (AEDT) Received: by mail-lf1-x142.google.com with SMTP id 203so3011502lfa.12 for ; Thu, 23 Jan 2020 10:10:15 -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=V2jt041hnzEHCBCPM88Phdl5nLmotLMoidQ8m1tvrKZeOn/UvI0FMKGxRazx5tp6PI cIF0JiAOXGspinbTD4qfpwKUvZiV1DlJs86+vGvNHAHmASScQJMQy0kK6KKitP2Z2Hwf 3P6Kde9gY05KDpzSv69a4CGqpacTyVSByX1eqnnu5GVPFUwQ+P6cQsX0xZGCQZ966yLQ cMnK9Z3qqy9JVUXcMYcOj/m894BzzCjS/Qo74xyM4yWKkxj0QyaB78qpo2BduHe0Bvor ipkd2SPFlE349lKPe1zDvlbB8HOhHAQ1V6aGh2uo0KFVZFFZoD4phIRgs5SUb1CA18D7 a91Q== X-Gm-Message-State: APjAAAUHwql+pKu+dLjCWyuNZUTOcZWu8b6gGMseRt2RV+73yAipF5Z9 DuRFv/92nSTm4znyu/StcVyx28589GQ= X-Google-Smtp-Source: APXvYqx/CFaWSKVnzXlpK1+qO4ubCS9oYBQnexIdJkDYB/ASVBX1HdBP20YnSfmkT4M6+QZFPCcz5Q== X-Received: by 2002:ac2:5964:: with SMTP id h4mr5291092lfp.213.1579803011713; Thu, 23 Jan 2020 10:10:11 -0800 (PST) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com. [209.85.208.180]) by smtp.gmail.com with ESMTPSA id s4sm1742074ljd.94.2020.01.23.10.10.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Jan 2020 10:10:11 -0800 (PST) Received: by mail-lj1-f180.google.com with SMTP id j1so4659270lja.2 for ; Thu, 23 Jan 2020 10:10:11 -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 Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: the arch/x86 maintainers , dri-devel , "H. Peter Anvin" , Linux Kernel Mailing List , Jani Nikula , Linux-MM , Ingo Molnar , Paul Mackerras , Alexander Viro , linux-fsdevel , Borislav Petkov , Andrew Morton , linuxppc-dev , Thomas Gleixner Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 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.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 76732C33CB6 for ; Thu, 23 Jan 2020 18:02:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5235422522 for ; Thu, 23 Jan 2020 18:02:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (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 5235422522 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BDCE16E039; Thu, 23 Jan 2020 18:02:54 +0000 (UTC) Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id E473E6E039 for ; Thu, 23 Jan 2020 18:02:53 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id h23so4589742ljc.8 for ; Thu, 23 Jan 2020 10:02:53 -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=ICtvPu+gIvtXaAQPbJ0Y8MLZZzMuIdicx71dyHsghGAJKUJP93Y82vxxM3K9PIZVQp 1bZbzmiktRWoVfQjZBRDbV4jEna8KX0z03YR80IluZhRp1JwLOuHzgKKueFOV+7Nuf1I cruTE27YPLmv+06nye6XgstakHBYI5PysmGpaDiINeSKpSVUrLLZabs4w5s8y6IEK5O8 /PiEj/flRGbBRXR/53+kwZDTFiIPnv9HN8I3YwkKci1cEW8P6i32R3Q5CMXbL0TF70IE uxWdnfZRIpvZT4GmPGESr0NkIzYpyphAgsLoWlaJYlOSaDA5tbaREnhvOTlRgsLwEykg Umsg== X-Gm-Message-State: APjAAAWRJspvygFaUuUvv8Nm2TAyjoJ0oBWMpUTQni0neC9tbbq1/REJ ATKe0/c3/p27nI5bufBRx2VESkFubZA= X-Google-Smtp-Source: APXvYqz9Q+Ne/q1ov1TcQYdBOEwq9RC6w13AuP98Il4LxinvcDsBGdUSW34Op35rOZySKESDH+VTBg== X-Received: by 2002:a2e:9999:: with SMTP id w25mr24220063lji.142.1579802571264; Thu, 23 Jan 2020 10:02:51 -0800 (PST) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com. [209.85.208.182]) by smtp.gmail.com with ESMTPSA id q186sm1721099ljq.14.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-f182.google.com with SMTP id a13so4570707ljm.10 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: the arch/x86 maintainers , dri-devel , "H. Peter Anvin" , Linux Kernel Mailing List , Linux-MM , Ingo Molnar , Paul Mackerras , Alexander Viro , Michael Ellerman , linux-fsdevel , Borislav Petkov , Andrew Morton , linuxppc-dev , Thomas Gleixner Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel