Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2239779ybz; Thu, 30 Apr 2020 13:27:14 -0700 (PDT) X-Google-Smtp-Source: APiQypL8EV5WlmY9dypUjgDsQzcGSJHS1f/F6pNlF7EDA1P61KAVYjRMNk0HmwVR7qtpPVBK5sSY X-Received: by 2002:a17:906:11c7:: with SMTP id o7mr239844eja.108.1588278434779; Thu, 30 Apr 2020 13:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588278434; cv=none; d=google.com; s=arc-20160816; b=KV856KhFy3oqX8lB2ATfQwehHaC7WbXJcF3Qy7LM8JNvORNhW+F0Hk7uSzrtbAWCZB ikP0+m6T1jSifO7e+Usr9RuuCBLMTZ2qnVEtMeEYv/7m3NRdAGE18DFByT1Dvpiu1HGi yjJ57I4wtKRIJWOD7iK0aAOxqLnfHWkyJdMDNx/mMlj4o1XfSqxg70L6gq27i5/3n547 YoKQJi9ASm+Fb591PHkxjhr+EObEGX632p55bMR0PAh84UYmkaVLvRmNSmeFm4cGIqfy 0p+ZSL2SMmMkD2XtzHajIEqiR7oqH740pl49crQxAQheWBJ80V5o5fNyiVnOJVK1J5ka ElLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=Ce2/m0/BDSfRKF5vc1TDcQ4fF79JtNqeU5AK3S4dTGM=; b=VcoRUj9BOUCO05R/cQh44OGvLr58LyFAhbj4jR1EHvuRCNwGYUU8rWFxz2/y2LlXc6 IU8A/UoMJEangCusqMIbKWk2EmkiZLahc6+nykt55O4glwQYNMgp5rOQPLTX56l2jdfp +NVnPOuAuSBEQZMNDriMDsQfvX7HgGw8YZj4Vlcm822EReAd2nZuTYaNN51lYwpsk16l RM2jPH10CMFXIbRrrOllC4/FFdpwTG9wWLhr5DDgu26+UrJSVaIjWp8U6ZjZ3VULck0y LF2fiCYNQkm9YOk/I1hfTFRcVtPwKvOQz9rL9S5HCYJUwAT0jsL4H69x75kv0Bkthlpo f0xA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si454939ejw.314.2020.04.30.13.26.50; Thu, 30 Apr 2020 13:27:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727041AbgD3UZT (ORCPT + 99 others); Thu, 30 Apr 2020 16:25:19 -0400 Received: from mga07.intel.com ([134.134.136.100]:36651 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726377AbgD3UZT (ORCPT ); Thu, 30 Apr 2020 16:25:19 -0400 IronPort-SDR: AFzbOPrBUfbhDy0EtLj34UrI6N6CP093fGaed6PxL8ElYcOAvm9cbWv0cT33fwRQm5Qjs7rEJ5 rwj4EsW3Nwaw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2020 13:25:18 -0700 IronPort-SDR: cdfVVzrh6ngjaDBZLFBICWr5KRRav1Et0SERCoAbGfCgIsOaX0I4vgmIe0LtMc4Ae0ffdyOSxM B/T8PSwMcZVQ== X-IronPort-AV: E=Sophos;i="5.73,337,1583222400"; d="scan'208";a="249848943" Received: from agluck-desk2.sc.intel.com (HELO agluck-desk2.amr.corp.intel.com) ([10.3.52.68]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2020 13:25:17 -0700 Date: Thu, 30 Apr 2020 13:25:16 -0700 From: "Luck, Tony" To: Linus Torvalds Cc: Andy Lutomirski , Dan Williams , 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 Subject: Re: [PATCH v2 0/2] Replace and improve "mcsafe" with copy_safe() Message-ID: <20200430202516.GA26147@agluck-desk2.amr.corp.intel.com> References: <158823509800.2094061.9683997333958344535.stgit@dwillia2-desk3.amr.corp.intel.com> <20200430192258.GA24749@agluck-desk2.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 30, 2020 at 12:50:40PM -0700, Linus Torvalds wrote: I see your point about the namimg being important. I think Dan's case is indeed "copy from pmem to user" where only options for faulting are #MC on the source addresses, and #PF on the destination. > The only *fundamental* access would likely be a single read/write > operation, not a copy operation. Think "get_user()" instead of > "copy_from_user()". Even there you get combinatorial explosions with > access sizes, but you can often generate those automatically or with > simple patterns, and then you can build up the copy functions from > that if you really need to. That's maybe very clean. But it looks like it would be hard to build a high performance interface on top of that primitive. Remember that for Dan's copy 99.999999999367673%[1] of copies will not hit a machine check on the read from pmem. Dan wants (whatever the function name) to get to a "REP MOVS" with an exception table entry to handle the cases where there is a fault. -Tony [1] Likely several more '9's in there