From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9C8EC47247 for ; Thu, 30 Apr 2020 19:23:04 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B6FD2072A for ; Thu, 30 Apr 2020 19:23:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B6FD2072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D94A410053E33; Thu, 30 Apr 2020 12:21:51 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=tony.luck@intel.com; receiver= Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E2AE810053E02 for ; Thu, 30 Apr 2020 12:21:48 -0700 (PDT) IronPort-SDR: 7eK7VvzhANR4pZz528zGpX0YIYTZNwVwiDxrVWlBXSIH65X/e2AmZnDlxLbUUGqwMaXpewx9To xnUyQmonPlcQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2020 12:23:00 -0700 IronPort-SDR: mmOO9TeGehW6ZKsO2AabJSyPfx1On12iSR7UbQV26uvMH5iIZWkP61nrPG6nfcG9OdZdtKTjq6 DEfOJCg3MGgg== X-IronPort-AV: E=Sophos;i="5.73,336,1583222400"; d="scan'208";a="459685832" Received: from agluck-desk2.sc.intel.com (HELO agluck-desk2.amr.corp.intel.com) ([10.3.52.68]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2020 12:22:59 -0700 Date: Thu, 30 Apr 2020 12:22:58 -0700 From: "Luck, Tony" To: Andy Lutomirski Subject: Re: [PATCH v2 0/2] Replace and improve "mcsafe" with copy_safe() Message-ID: <20200430192258.GA24749@agluck-desk2.amr.corp.intel.com> References: <158823509800.2094061.9683997333958344535.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Message-ID-Hash: YOWGLR53LKTABIJBJDWVYFGPVXTICIIH X-Message-ID-Hash: YOWGLR53LKTABIJBJDWVYFGPVXTICIIH X-MailFrom: tony.luck@intel.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: Linus Torvalds , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Borislav Petkov , stable , the arch/x86 maintainers , "H. Peter Anvin" , Paul Mackerras , Benjamin Herrenschmidt , Erwin Tsaur , Michael Ellerman , Arnaldo Carvalho de Melo , linux-nvdimm , Linux Kernel Mailing List X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Thu, Apr 30, 2020 at 11:42:20AM -0700, Andy Lutomirski wrote: > I suppose there could be a consistent naming like this: > > copy_from_user() > copy_to_user() > > copy_from_unchecked_kernel_address() [what probe_kernel_read() is] > copy_to_unchecked_kernel_address() [what probe_kernel_write() is] > > copy_from_fallible() [from a kernel address that can fail to a kernel > address that can't fail] > copy_to_fallible() [the opposite, but hopefully identical to memcpy() on x86] > > copy_from_fallible_to_user() > copy_from_user_to_fallible() > > These names are fairly verbose and could probably be improved. How about try_copy_catch(void *dst, void *src, size_t count, int *fault) returns number of bytes not-copied (like copy_to_user etc). if return is not zero, "fault" tells you what type of fault cause the early stop (#PF, #MC). -Tony _______________________________________________ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-leave@lists.01.org