From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932852AbdC2Uij (ORCPT ); Wed, 29 Mar 2017 16:38:39 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:35427 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753549AbdC2Uhc (ORCPT ); Wed, 29 Mar 2017 16:37:32 -0400 MIME-Version: 1.0 In-Reply-To: <20170329202939.GI29622@ZenIV.linux.org.uk> References: <20170329055706.GH29622@ZenIV.linux.org.uk> <3399faa9-795e-39db-42f5-7d1e10bbff9c@synopsys.com> <20170329202939.GI29622@ZenIV.linux.org.uk> From: Linus Torvalds Date: Wed, 29 Mar 2017 13:37:30 -0700 X-Google-Sender-Auth: TuOgVp75LPKsz8TNHzGRGGYR_e0 Message-ID: Subject: Re: [RFC][CFT][PATCHSET v1] uaccess unification To: Al Viro Cc: Vineet Gupta , "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Richard Henderson , Russell King , Will Deacon , Haavard Skinnemoen , Steven Miao , Jesper Nilsson , Mark Salter , Yoshinori Sato , Richard Kuo , Tony Luck , Geert Uytterhoeven , James Hogan , Michal Simek , David Howells , Ley Foon Tan , Jonas Bonn , Helge Deller , Martin Schwidefsky , Ralf Baechle , Benjamin Herrenschmidt , Chen Liqin , "David S. Miller" , Chris Metcalf , Richard Weinberger , Guan Xuetao , Thomas Gleixner , Chris Zankel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 29, 2017 at 1:29 PM, Al Viro wrote: > > BTW, I wonder if inlining all of the copy_{to,from}_user() is actually a win. I would suggest against it. The only part I think is worth inlining is the compile time size checks for kasan - and that only because of the obvious "sizes are constant only when inlining" issue. We used to inline a *lot* of user accesses historically, pretty much all of them were bogus. The only ones that really want inlining are the non-checking ones that people should never use directly, but that are just helper things used by other routines (ie the "unsafe_copy_from_user()" kind of things that are designed for strncpy_from_user()). Once you start checking access ranges, and have might_fault debugging etc, it shouldn't be inlined. Linus