Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4017828ybz; Mon, 20 Apr 2020 13:59:07 -0700 (PDT) X-Google-Smtp-Source: APiQypKUdJfFpZDvpqHgb00C64H972PwpmGonX1DCtIetHRYb5c+kZQ3knxvByRYVohR87jRMVgH X-Received: by 2002:a50:d615:: with SMTP id x21mr13687969edi.62.1587416347569; Mon, 20 Apr 2020 13:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587416347; cv=none; d=google.com; s=arc-20160816; b=Y4ak9xnFJ7ClhJTgTlDR/GTIWrEtS0mmrcwr3J32qQZ0RkFkX+hoDv5Y2W6q7BIj8w BWJG628zJpWr5hroqorpld3QdWYPIU+8V/4QyuBoVKY5patysw6ovjE6DeeKWQQTl93n Fj1zWbhqvGULDkRlupfBpwzNigMbDxsuU/ScuVaqV7ER3nQEYhS8945k61XtQFu0ChMN UgAIWdJEEfReh+++2IZIrhfIuO2f/7543WndIPxFm5PsSZBRejY7Ofq3dw2XeYyqkqH8 8swF3fcOqIq24fJJaY6RMu+vpcqt4eof7sRNkrNQsKaje5cgXq8yB07goSemPwvUV7lp YZOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+YMKp9wPvX7FbDR3+6WEIzSglLbYUecdGkyUsv5KulQ=; b=uqQYyTQ1UbqdCEbe4n47pNKvZFJSUIg1EIo9cDMR4mTnRsz1JC0T5FKiec9VU81zrY kbNDFbr9RWQ/15UHSpG68SzVeMD9D6sIPFWSYBP9s1QQOwAAossv7Wz7Hr9gPur82wUC DjGA0BzqsnAwlO2iEBaiHlL72vcvsMl2gqtA2NK3TcPXNVfqIMdN8wcSeA6OOm+N1A9A GRNsTXppQdEkuKbV7XXW3PnVu9CFPOHCVif4FfE+Bb7w0tHIymsrcjPea6zi/kqq53w4 EKmIEEsPBcvZ234+ezw8SbIrSm83cy5jHFCzqoqVxdlJ1cf+bVzWafsqU/NPm4ko/IJQ T8rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="FcXT9x/j"; 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 c12si359834edr.596.2020.04.20.13.58.43; Mon, 20 Apr 2020 13:59:07 -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=@linux-foundation.org header.s=google header.b="FcXT9x/j"; 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 S1726758AbgDTU4x (ORCPT + 99 others); Mon, 20 Apr 2020 16:56:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726494AbgDTU4x (ORCPT ); Mon, 20 Apr 2020 16:56:53 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F1E0C061A0E for ; Mon, 20 Apr 2020 13:56:53 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id 131so9204296lfh.11 for ; Mon, 20 Apr 2020 13:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+YMKp9wPvX7FbDR3+6WEIzSglLbYUecdGkyUsv5KulQ=; b=FcXT9x/jUah+X0xgwFiqlUqBQvX1G3RiMhY/gwPoHmmY/XQlinet+aCVntYoTSXix0 nYnC67xrDgLTWaT5S4DrH+GUnhJL1ZtDCuTvhpZ7ZxXg/ozncV3EsUCU+SCShBpzLktB /uVd+li/PDjb4APhJ2J6DiaYwIXndtCUke1hE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+YMKp9wPvX7FbDR3+6WEIzSglLbYUecdGkyUsv5KulQ=; b=KkdVF9jv8sozE2+zcuVJNpEM4FoHjuwiwr9YRTtRqPkb3PNmhk6IBmkj5IBOVgSNOp JLKLigZB9wmlfZ/ZF9cD8U+nzn9HG1rzFm4B8aq3onthhu4vVbkKXXGiWKfYnRKgTWLl zZXr9Rz6aYUZdM9HxdlFFTVVqEdli4l9YvNMtelEozrXVt4KsqEGrMHcDuXvHiNYwDiF CdvEtNOC6F1kvD/rWWLbP9fpgfHRqjIH5PyevAx+aKI3lkWg9MedoQ/Czf4OXaG0149n bwCidxAF56ln696uQkjDYKQsnylrC+ofvD4/8MHJbVBPUHBCb7ezWS11ZlgTHqDmQTbt Wa6w== X-Gm-Message-State: AGi0PuYGF3Exy0pUjSFDKYGL56OvpOjod4alViLrO9owJeTs6N0uLWBq +0obMpp0Iqt1/8CCXnzoqPOUfR2M7rM= X-Received: by 2002:ac2:4105:: with SMTP id b5mr11799155lfi.94.1587416210679; Mon, 20 Apr 2020 13:56:50 -0700 (PDT) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id d23sm406416ljg.90.2020.04.20.13.56.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Apr 2020 13:56:49 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id l11so9265422lfc.5 for ; Mon, 20 Apr 2020 13:56:48 -0700 (PDT) X-Received: by 2002:a19:946:: with SMTP id 67mr9797282lfj.142.1587416208523; Mon, 20 Apr 2020 13:56:48 -0700 (PDT) MIME-Version: 1.0 References: <67FF611B-D10E-4BAF-92EE-684C83C9107E@amacapital.net> <20200420202332.GA30160@agluck-desk2.amr.corp.intel.com> <3908561D78D1C84285E8C5FCA982C28F7F5FB1C0@ORSMSX115.amr.corp.intel.com> In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F7F5FB1C0@ORSMSX115.amr.corp.intel.com> From: Linus Torvalds Date: Mon, 20 Apr 2020 13:56:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/memcpy: Introduce memcpy_mcsafe_fast To: "Luck, Tony" Cc: "Williams, Dan J" , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , X86 ML , stable , Borislav Petkov , "H. Peter Anvin" , Peter Zijlstra , "Tsaur, Erwin" , Linux Kernel Mailing List , linux-nvdimm Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 20, 2020 at 1:45 PM Luck, Tony wrote: > > Another X86 vendor seems to be adding something like that. See MCOMMIT > in https://www.amd.com/system/files/TechDocs/24594.pdf That sounds potentially very expensive. Particularly, as you say, something like the kernel (or virtualization) may want to at least test for it cheaply on entry or switch or whatever. I do think you want the mcommit kind of thing for writing, but I think the intel model of (no longer pcommit) using a writeback instruction with a range, and then just sfence is better than a "commit everything" thing. But that's just for writing things, and that's fundamentally very different from the read side errors. So for the read-side you'd want some kind of "lfence and report" instruction for the "did I see load errors". Very cheap like lfence, so that there wouldn't really be a cost for the people if somebody _really_ want to get notified immediately. And again, it might just be part of any serializing instruction. I don't care that much, although overloading "serializing instruction" even more sounds like a bad idea. Linus