Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753338AbdFVO4Q (ORCPT ); Thu, 22 Jun 2017 10:56:16 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:54676 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752637AbdFVO4O (ORCPT ); Thu, 22 Jun 2017 10:56:14 -0400 Date: Thu, 22 Jun 2017 15:55:49 +0100 From: Alan Cox To: Kees Cook Cc: Paolo Abeni , "x86@kernel.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Al Viro , Hannes Frederic Sowa , LKML Subject: Re: [PATCH] x86/uaccess: use unrolled string copy for short strings Message-ID: <20170622155549.57dfc856@alans-desktop> In-Reply-To: References: <63d913f28bc64bd4ea66a39a532f0b59ee015382.1498039056.git.pabeni@redhat.com> Organization: Intel Corporation X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 669 Lines: 19 > > diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h > > index c5504b9..16a8871 100644 > > --- a/arch/x86/include/asm/uaccess_64.h > > +++ b/arch/x86/include/asm/uaccess_64.h > > @@ -28,6 +28,9 @@ copy_user_generic(void *to, const void *from, unsigned len) > > { > > unsigned ret; > > > > + if (len <= 64) > > + return copy_user_generic_unrolled(to, from, len); > > + Given this gets inlined surely that should bracketed with an ifdef against optimizing for space. Also you give one set of benchmarks but how do they look on different processors - AMD v Intel, Atom v Core, Ryzen v older AMD etc ? Alan