Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4039414ybb; Mon, 23 Mar 2020 12:17:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv/JFRm17ZhWDl1Mn3iIDo7BJ5zPKqWtyjHcD39uFd1nl8e7q6cH2UzVsBascsMqe4S7+4t X-Received: by 2002:a05:6808:c8:: with SMTP id t8mr672554oic.3.1584991078900; Mon, 23 Mar 2020 12:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584991078; cv=none; d=google.com; s=arc-20160816; b=B0+2Lqu8+AomvBfvcuaKe7pReWV5vwNSISarzmumCJyZb1kLoJJ71QUWO4oSCOiCyr gUg90wBo68xlOxGX7OY9Igflg533S/Sm1qbwtSdXT7xjvz72/EUmobtsfNol9L6xgkcc Kx375oIhuPSbm6lvUy0rJ2obXSfaeXP3uCtPMb9n9xt0uqhPPqOZJNY2p3w9Y5UARD3s +rzhFw1NU0KQWS/V6dHEqUT7gx88KF9MJOOO3DIkWsMAFl50uMuz7AYDzO20MHonr0Yu aFIejcLGwCdGUX03GkucBHaEwH9wPkkmZOhQ6TVlBBqcq1XfsUKrnv38JRlswHt262ug v2Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=A8AaD7PeBM+BqQBSCUne0JC1w+8v/VR4Ruj2mnlVpoo=; b=i2seAa/zmMkeCQBmehG5rp9jl4EjjXxiohtlloppkXzNxvApdS++ds5r5v/SiVqObY N3ovfuL4m3AFapPiCYo2Abf3RCI7LPzzfF6nCR+eQCyOEFDimKY+rzJ02Pgwo6HVieoF lCK2Y7fME4z2i90r+d2YuUqIl/o/NeSJzbWbY1A+R2uXR+q34AIPnUL4eO+qVCjAZ7LE J7cMbrFT9O2sr5gG57oVrQDFd2a5pQuNbQBW8GU+rhtVD5QIWkNSdF557SZdMQVdSeQy vmRnHOO/0KRv/hFvM6AhBVLC2qRQ/vPAE1axi4ExOaMcmN0qj6tflx7ESTPS0hdhzSOi GV3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=GTL0uX2R; 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 f18si7654595oti.289.2020.03.23.12.17.39; Mon, 23 Mar 2020 12:17:58 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=GTL0uX2R; 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 S1727835AbgCWTQt (ORCPT + 99 others); Mon, 23 Mar 2020 15:16:49 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:46253 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727689AbgCWTQs (ORCPT ); Mon, 23 Mar 2020 15:16:48 -0400 Received: by mail-lj1-f196.google.com with SMTP id v16so8898292ljk.13 for ; Mon, 23 Mar 2020 12:16:47 -0700 (PDT) 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=A8AaD7PeBM+BqQBSCUne0JC1w+8v/VR4Ruj2mnlVpoo=; b=GTL0uX2RUZzoWX3xVkXy4vdTv1KaniqoDTX5wRp9EHqAlZMZLuPQc9ldFdsUGGlb/s nwJEyhR9PMSsbtw4ZVEScgYBTreSsns5Pv2thseplI+wcI36tlBLktgQtwBiD2mwd1P2 fPMXEkKXwhYLppuqhUF0ARhCrSsLxLqNI5cWA= 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=A8AaD7PeBM+BqQBSCUne0JC1w+8v/VR4Ruj2mnlVpoo=; b=PTjXRkM8jIwvEdpnI5DrdWNFaTbcJugPt5+e1nJcGt00IxTWY0DrkFou8aypYfPCkS 4u7pjxvO3lEi94pU/+C9SCGP0/1099EHmkIvKHYtTxEF6rLDuK/CgleWzJ7NJLcV1vWq vcq0YdsOvLpslZlJ+ZzdKSSQxLNJxizoaVBw6j1fRPyna7fSKjq5cr48Jvu5oSs7kELQ uoSoR6MFHa2zz4h1Ehch/ApR/hPXoRjDBBr9O4+Q6BZEsp8DXO3qE+D4UxMOGBevrWvi 3VHgU3f21mx2es4UG4hxdcE+R/4ngx+GQ75Mh+G4OohOhsuYq0rbMTEdXrlSs4x5YmYs hsFA== X-Gm-Message-State: ANhLgQ0+L9fo47k1EjS2UvD5muW91LshSDQ7a4eoinimZ/RdFwzGRlpI /2EcDc2e6LAB3ECTxPnz0fNjhXRC96U= X-Received: by 2002:a2e:85cb:: with SMTP id h11mr8122595ljj.190.1584991006015; Mon, 23 Mar 2020 12:16:46 -0700 (PDT) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id u19sm945849lfl.57.2020.03.23.12.16.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Mar 2020 12:16:45 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id g12so15956537ljj.3 for ; Mon, 23 Mar 2020 12:16:45 -0700 (PDT) X-Received: by 2002:a2e:8911:: with SMTP id d17mr3881751lji.16.1584991004925; Mon, 23 Mar 2020 12:16:44 -0700 (PDT) MIME-Version: 1.0 References: <20200323183620.GD23230@ZenIV.linux.org.uk> In-Reply-To: <20200323183620.GD23230@ZenIV.linux.org.uk> From: Linus Torvalds Date: Mon, 23 Mar 2020 12:16:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCHSET] x86 uaccess cleanups To: Al Viro Cc: Thomas Gleixner , "the arch/x86 maintainers" , Linux Kernel Mailing List 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 Mon, Mar 23, 2020 at 11:36 AM Al Viro wrote: > > Beginning of uaccess series; there's more already linearized, but > I'll be posting that separately. Ok, apart from my naming hang-up, I love how this gets rid of some of my least favorite header file crud. So big ack. One thing to look out for: have you done profiling with stack frames with this? That patch 1/22 looks obviously correct, but all those magic rules for __copy_from_user_nmi() are the scary ones. Simple test to run - just do this as root: perf record -e cycles:pp -g -a sleep 100 while you're doing a kernel build or similar. That will do the system-level profile of everything with stack trace code, which tends to trigger a lot of special stuff. Doing some basic ftrace tests might be good too. Because that callchain code is the thing that really needs to work from odd contexts, and also can't afford to have a stack frame because you get into nasty recursive issues with tracing etc. I think your patch is "obviously correct" in that you basically just expand the crazy complex inline rules anyway, but I just want to make sure it got some basic testing too.. Linus