Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp148890ybz; Thu, 30 Apr 2020 18:22:42 -0700 (PDT) X-Google-Smtp-Source: APiQypKJuzsugT+Qqhmc11NO0bbWCMWfXx07ROH9ESteOIv8y5OivF6OSdR+IZWRz/tMB31573Qs X-Received: by 2002:a50:9f23:: with SMTP id b32mr1497127edf.183.1588296162695; Thu, 30 Apr 2020 18:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588296162; cv=none; d=google.com; s=arc-20160816; b=HANH/tLubX3ymrrSfoaKUget94bAECywMPeQnWpcc72ZLuxovKCoQfEQ3Ukax+K/fR jjzSthUpMuc229/KU9KP0SQvKD+vTjX1x7l+AoayFbJdZLI4omUNLsQLnCYOpT/ovOjI uVeucSqmF9fLYIeHGoveFQMVHeNYyXZWs/tgyDNXvVIwy0BE4nvZXmzSG6oeOS0qw8hI ZpoWeainN5XLWlefYzj6QJQjyY7W2PqiD5Tadcy78vFE+YAj4RuZxyJ+HgQYmXT/URqK 6LT4XZG4IYPdO7oAC8S+tK+mVg/2AeqwqbM/vjGvPBUGsUWyfdqs4lze0Th4ueODJhZi tuDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=+ob/X0QXFpxvmr3EWB8fQOJcF1u/V0cTtMVpIs2p45o=; b=nIK1aLFK/Gp7ShXPQUuoNolwMxiP4hW3cA2LxSaoEAWyghRln2iSNU7WO60i/Asv1R ZvLrLyO1OFuKOJfJyNrBpsz9z3UKwRf5neNakv6XTjbaxUaiIFQAlGGsCECDbB6CHQDt jI+UjjMAcDMngeXc4ei/VOk5ay0/9xXegR+vPGSzwnoGWwFFV0TTV3QNMIMq4xRDdjqY p3IKqZ1eg1P2pHFjX0dzQQ3pSQkxfyQFSI7OXcUPn346M7zPLmxyIV9gBuBGDCfcF9tU oCDXaI0LrFoiIiNT/K0NTyFBUHFc1GFK88eGbQyXYPvcztHkTb8uhIe9SCArua1pqig7 d5OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b="JWz/HNe9"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di17si711784edb.593.2020.04.30.18.22.19; Thu, 30 Apr 2020 18:22:42 -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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b="JWz/HNe9"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728025AbgEABUn (ORCPT + 99 others); Thu, 30 Apr 2020 21:20:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727920AbgEABUn (ORCPT ); Thu, 30 Apr 2020 21:20:43 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34725C035495 for ; Thu, 30 Apr 2020 18:20:43 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id p25so890177pfn.11 for ; Thu, 30 Apr 2020 18:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=+ob/X0QXFpxvmr3EWB8fQOJcF1u/V0cTtMVpIs2p45o=; b=JWz/HNe9QVe3KpMe6Fx9Bq2GqkBQAoBVa8iqrJqTOXH9HIZzwUCDZU8rE102fg1z7o 0kalZERJUV6gw/xA8MPaoOfaHwYAbAANimUog9Hm676+TIjcO+dBY89FjUJ4wcMs975/ SKm9CbmjdES6fxlHT0h2/dzk9hxGqC1/y06ZPZMjk0uNY0N5EoJ6K6sn0qt6pUf2eCuJ jgwqP5f32gdTlY0FX3Gs1FAz+ZOhcRu86YggMsjZ1RdG5yNctLB6+vmapn45gRamTYGp fRbPwUxOjDOzHfI5AUlpxdC9aNAaFqoSCkIZ/PKmcj6qIrFM96yFQKqxFpwDUaMHMKf7 yvLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=+ob/X0QXFpxvmr3EWB8fQOJcF1u/V0cTtMVpIs2p45o=; b=ZDYnR6gW4jmsNoZ5cjDmt7KT4l2W2MdNE2PQmgdpywoL9qZhtBNw482TlMCbbhoQEi y47xgqUxsZ8NTIbpvpUiKBapTwEJJ04gTSSF9vIhkD2bBbLPfqGcvd7qBJ8MztKmMPHX zaEf8/fzAJT6sxRoZ0Lv6qBcWT5+Qb1p/WHq3HZLkyYKnktp0DraGAay5oWVKHlPMKi2 UXRoc9ndZdQBE5nUqEjgUAfqMaPQRrpWWLlSH7uV/vRbdpkIu+TcKiBqPl38jw89wqTA GtV0r9Id0GhfD57edxn7n08TMpO8XU1sad3IFob+wtdTNKLLc+fi/CDLfeFez+ZOB/D1 4hYQ== X-Gm-Message-State: AGi0PuaEfl9dsf4KmnL053sC7ys/LbnTgQxx48kZFuJ84s1fnlykHz5Z 8Au8M9qkqc1dNFbXhq3asqH0OA== X-Received: by 2002:aa7:819a:: with SMTP id g26mr1723584pfi.193.1588296042609; Thu, 30 Apr 2020 18:20:42 -0700 (PDT) Received: from ?IPv6:2601:646:c200:1ef2:d495:581b:d692:e814? ([2601:646:c200:1ef2:d495:581b:d692:e814]) by smtp.gmail.com with ESMTPSA id h31sm784779pjb.33.2020.04.30.18.20.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Apr 2020 18:20:41 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v2 0/2] Replace and improve "mcsafe" with copy_safe() Date: Thu, 30 Apr 2020 18:20:39 -0700 Message-Id: References: Cc: Dan Williams , "Luck, Tony" , Andy Lutomirski , 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 In-Reply-To: To: Linus Torvalds X-Mailer: iPhone Mail (17E262) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Apr 30, 2020, at 5:25 PM, Linus Torvalds wrote: >=20 >=20 > It wasn't clear how "copy_to_mc()" could ever fault. Poisoning > after-the-fact? Why would that be preferable to just mapping a dummy > page? If the kernel gets an async memory error and maps a dummy page, then subsequ= ent reads will subsequently succeed and return garbage when they should fail= . If x86 had write-only pages, we could map a dummy write-only page. But we= don=E2=80=99t, so I think we=E2=80=99re stuck. As for naming the kind of memory we=E2=80=99re taking about, ISTM there are t= wo classes: DAX and monstrous memory-mapped non-persistent cache devices. B= oth could be Optane, I suppose. But I also think it=E2=80=99s legitimate to use these accessors to increase t= he chance of surviving a failure of normal memory. If a normal page happens t= o be page cache when it fails and if page cache access use these fancy acces= sors, then we might actually survive a failure. We could be ambitious: declare that all page cache and all get_user_page=E2=80= =99d memory should use the new accessors. I doubt we=E2=80=99ll ever really= succeed due to magical things like rseq and anything that thinks that users= can set up their own memory as a kernel-accessed ring buffer, but I suppose= we could try.