From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934091AbbELVx1 (ORCPT ); Tue, 12 May 2015 17:53:27 -0400 Received: from mail.skyhub.de ([78.46.96.112]:50058 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753904AbbELVxY (ORCPT ); Tue, 12 May 2015 17:53:24 -0400 Date: Tue, 12 May 2015 23:53:20 +0200 From: Borislav Petkov To: Linus Torvalds Cc: Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Andy Lutomirski , Denys Vlasenko , lkml Subject: Re: [RFC PATCH] Drop some asm from copy_user_64.S Message-ID: <20150512215320.GK3497@pd.tnic> References: <20150512205750.GJ3497@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 12, 2015 at 02:13:33PM -0700, Linus Torvalds wrote: > On Tue, May 12, 2015 at 1:57 PM, Borislav Petkov wrote: > > > > I want to get rid of the asm glue in arch/x86/lib/copy_user_64.S which > > prepares the copy_user* alternatives calls. And replace it with nice and > > clean C. > > Ack. I'm not a fan of the x86-64 usercopy funmctions. > > That said, I think you should uninline those things, and move them > from a header file to a C file (arch/x86/lib/uaccess.c?). Ok. > Move all the copy_user_generic_unrolled/string garbage there too, and > keep the header file simple. Those are just forward declarations for the asm functions in arch/x86/lib/copy_user_64.S but yeah, I'll do some experimenting. Just to make sure - I'm not getting rid of the different asm string copy versions in copy_user_64.S - just the _copy_from_user/_copy_to_user stubs at the beginning of that file as that gunk can be replaced with calls with inlined copy_user_generic() workhorse. The alternatives give us directly then CALL which is as optimal as it gets. > Because I think that we would actually be better off trying to inline > the copy_user_generic_string() thing into the various versions (in > that uaccess.c file) than try to inline the access_ok() check into the > caller. Right. Thanks. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --