Received: by 10.213.65.68 with SMTP id h4csp256129imn; Tue, 20 Mar 2018 02:42:53 -0700 (PDT) X-Google-Smtp-Source: AG47ELtCUl0YP6Vn1eCu7frwcdK78q77t97hHD37ftuh9MPUZFApUvjhMsYu69rPmIFHsFpNIGFa X-Received: by 10.99.185.71 with SMTP id v7mr11781259pgo.12.1521538973066; Tue, 20 Mar 2018 02:42:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521538973; cv=none; d=google.com; s=arc-20160816; b=EGOJEuQgJrruwbJJuGmp33NghkTxHEtSPq6k3BTOGwnLUuZgWGzdU5jIJColdhHX2y +zjBRzlFrvWtHZyHxoLP8611PZA1FdVDYLTZ+Q4bFDnn3j+eWCW67yznkd9R0Jqm/lYc Xn1g25dGLYzCHpHiyWB2AI1dAcWFXBpSImUP5mkDh+oq17FCOMFM3f5aEU2rZUoB6PdC aIkN0pyBB6PsFvo2vpw41QuwxbthOXT2D58kxZC9JLmzVixitHqTOIf/x8EAQC4f2XX9 6I5/KH+O8T/cXX/9sKO5LHApSzbPhbHoeREdkk4eHrDNbdOZWth8i8NOLEtGd2s8GGpZ /IBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=YeajUQ42hHZZSqoHjiYnDc2gD25MSQZD2GiNXiTiCFk=; b=QIoLnD2WbgtVDucZVrTHSzRKBpf5yAfnS+KViG2X4iaYO9OuPbNwExb4cVmJcC58MG aJ19I668xamV6S1zvDbDXxRis7flNi/NNuTbuurVnPbykPB+DiU4nL/wOj/O41M6/Fug THiUcGQFV1PSw403QGGWmpM87i1vHS3i1z/1GT+TmuMsIDOptOKpXKwkZdJtG+oVcf4/ XCCt6iyulHtSmhDnNgUGsmANLeG2EcviHCjkZcwXwFQDcAiMZbj8mytH4Kg37YQLU0zb SC/uSUr9hKnzfmNK8LDD+X7O1TQ3dPAB99bCoETs5aKIjmPCj6uYELXSIWffJkylKVAM orrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6-v6si1299603pls.438.2018.03.20.02.42.35; Tue, 20 Mar 2018 02:42:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752229AbeCTJlS (ORCPT + 99 others); Tue, 20 Mar 2018 05:41:18 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:34118 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751459AbeCTJlR (ORCPT ); Tue, 20 Mar 2018 05:41:17 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1eyDlU-0004AF-Ha; Tue, 20 Mar 2018 10:41:08 +0100 Date: Tue, 20 Mar 2018 10:41:08 +0100 (CET) From: Thomas Gleixner To: Ingo Molnar cc: David Laight , 'Rahul Lakkireddy' , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "mingo@redhat.com" , "hpa@zytor.com" , "davem@davemloft.net" , "akpm@linux-foundation.org" , "torvalds@linux-foundation.org" , "ganeshgr@chelsio.com" , "nirranjan@chelsio.com" , "indranil@chelsio.com" , Andy Lutomirski , Peter Zijlstra , Fenghua Yu , Eric Biggers Subject: Re: [RFC PATCH 0/3] kernel: add support for 256-bit IO access In-Reply-To: <20180320090802.qw4tqjmhy6yfd6sf@gmail.com> Message-ID: References: <7f0ddb3678814c7bab180714437795e0@AcuMS.aculab.com> <7f8d811e79284a78a763f4852984eb3f@AcuMS.aculab.com> <20180320082651.jmxvvii2xvmpyr2s@gmail.com> <20180320090802.qw4tqjmhy6yfd6sf@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Mar 2018, Ingo Molnar wrote: > * Thomas Gleixner wrote: > > > > So I do think we could do more in this area to improve driver performance, if the > > > code is correct and if there's actual benchmarks that are showing real benefits. > > > > If it's about hotpath performance I'm all for it, but the use case here is > > a debug facility... > > > > And if we go down that road then we want a AVX based memcpy() > > implementation which is runtime conditional on the feature bit(s) and > > length dependent. Just slapping a readqq() at it and use it in a loop does > > not make any sense. > > Yeah, so generic memcpy() replacement is only feasible I think if the most > optimistic implementation is actually correct: > > - if no preempt disable()/enable() is required > > - if direct access to the AVX[2] registers does not disturb legacy FPU state in > any fashion > > - if direct access to the AVX[2] registers cannot raise weird exceptions or have > weird behavior if the FPU control word is modified to non-standard values by > untrusted user-space > > If we have to touch the FPU tag or control words then it's probably only good for > a specialized API. I did not mean to have a general memcpy replacement. Rather something like magic_memcpy() which falls back to memcpy when AVX is not usable or the length does not justify the AVX stuff at all. Thanks, tglx