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=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 5C2EBC4724C for ; Thu, 30 Apr 2020 16:52:00 +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 32269208DB for ; Thu, 30 Apr 2020 16:52:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="QQERtHd2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32269208DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 3DE57110EC732; Thu, 30 Apr 2020 09:50:48 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=luto@kernel.org; receiver= Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 4DA9C110EAE28 for ; Thu, 30 Apr 2020 09:50:46 -0700 (PDT) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8B51D208DB for ; Thu, 30 Apr 2020 16:51:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588265517; bh=Qh9yGfu7EKu8YBjyZn57LidMIeIdE9hqIfI7Nfz5zto=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QQERtHd2tvFSzKdIw7cibcdVNaSdmyG20LzUeHLE/Rd8Ra4MIYEURm5Tv//rSLTV3 Ek6VFKay/KjG3PAgO0ceXHc5n3oywEIqZ8rPWxNojM3LY+jscNuyhwVbvMuYomubRe 4UlthhnQYnlVlPE86wP9+rVbZLbym61P7wrGwo7c= Received: by mail-wm1-f43.google.com with SMTP id g12so2764252wmh.3 for ; Thu, 30 Apr 2020 09:51:57 -0700 (PDT) X-Gm-Message-State: AGi0PubSwDc/dT26Ol7JAWeDq+15+3xVQT7DjbBK5tpG32RGMcyb3mU3 OnKTWMKuvImObLSiW6zH1ACZ+J5ULTgtvs1xm7Qvhg== X-Google-Smtp-Source: APiQypIwzIih6qzG1E5/i+OpsglU4R3LqlrtKcQTjqR7B2k+mg5tCDSXpdynOS/JVqaM9P2DnRTopkyMsvqVuCFJ0bE= X-Received: by 2002:a1c:23d4:: with SMTP id j203mr4175179wmj.49.1588265515945; Thu, 30 Apr 2020 09:51:55 -0700 (PDT) MIME-Version: 1.0 References: <158823509800.2094061.9683997333958344535.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: From: Andy Lutomirski Date: Thu, 30 Apr 2020 09:51:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/2] Replace and improve "mcsafe" with copy_safe() To: Linus Torvalds Message-ID-Hash: 6I7527PR7POVUVYY7ZN2LJUO26237EM4 X-Message-ID-Hash: 6I7527PR7POVUVYY7ZN2LJUO26237EM4 X-MailFrom: luto@kernel.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: Thomas Gleixner , Ingo Molnar , Tony Luck , 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 7:03 AM Linus Torvalds wrote: > > On Thu, Apr 30, 2020 at 1:41 AM Dan Williams wrote: > > > > With the above realizations the name "mcsafe" is no longer accurate and > > copy_safe() is proposed as its replacement. x86 grows a copy_safe_fast() > > implementation as a default implementation that is independent of > > detecting the presence of x86-MCA. > > How is this then different from "probe_kernel_read()" and > "probe_kernel_write()"? Other than the obvious "it does it for both > reads and writes"? > > IOW, wouldn't it be sensible to try to match the naming and try to > find some unified model for all these things? > > "probe_kernel_copy()"? I don't like this whole concept. If I'm going to copy from memory that might be bad but is at least a valid pointer, I want a function to do this. If I'm going to copy from memory that might be entirely bogus, that's a different operation. In other words, if I'm writing e.g. filesystem that is touching get_user_pages()'d persistent memory, I don't want to panic if the memory fails, but I do want at least a very loud warning if I follow a wild pointer. So I think that probe_kernel_copy() is not a valid replacement for memcpy_mcsafe(). --Andy _______________________________________________ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-leave@lists.01.org