From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1947192AbcBRSvV (ORCPT ); Thu, 18 Feb 2016 13:51:21 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:32778 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946703AbcBRSvU (ORCPT ); Thu, 18 Feb 2016 13:51:20 -0500 Date: Thu, 18 Feb 2016 19:51:16 +0100 From: Ingo Molnar To: Linus Torvalds Cc: Tony Luck , Linux Kernel Mailing List , Peter Zijlstra , Thomas Gleixner , "H. Peter Anvin" Subject: Re: [PATCH v11 3/4] x86, mce: Add __mcsafe_copy() Message-ID: <20160218185116.GB16753@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 * Linus Torvalds wrote: > On Wed, Feb 17, 2016 at 10:20 AM, Tony Luck wrote: > > > > If we faulted during the copy, then 'trapnr' will say which type > > of trap (X86_TRAP_PF or X86_TRAP_MC) and 'remain' says how many > > bytes were not copied. > > So apart from the naming, a couple of questions: > > - I'd like to see the actual *use* case explained, not just what it does. > > - why does this use the complex - and slower, on modern machines - > unrolled manual memory copy, when you might as well just use a single > > rep ; movsb > > which not only makes it smaller, but makes the exception fixup trivial. > > - why not make the "bytes remaining" the same as for a user-space > copy (ie return it as the return value)? > > - at that point, it ends up looking a *lot* like uaccess_try/catch, > which gets the error code from current_thread_info()->uaccess_err > > Hmm? memcpy_try()/memcpy_catch() definitely has a nice ring to it. Thanks, Ingo