Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3691351img; Mon, 25 Mar 2019 15:59:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzo76tGYYAf92iGkfe5O6T8OhRT6fK66ltM82vVLAK5gna/1q4iOfBQJtEtxwNprsMJ5KUJ X-Received: by 2002:a17:902:8a96:: with SMTP id p22mr27112163plo.113.1553554767439; Mon, 25 Mar 2019 15:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553554767; cv=none; d=google.com; s=arc-20160816; b=lTG8ezelfPf2J7F0Cqx5nDmwNUfI6sRd3i49fBGlP7sPhkm15fBVcGgOBMccj2G1uD oOpknh+NnQ6FRi8RA1C7KMjw6r//pNWkifwIMv7ITRrCVTKy2Qix4z1wcK3UoIXQTxIO DRrkz/eKOTsxUrmKVhPYrDcFItvfElPxSlK9BKIQ9kUNrSiQghub1p9oda4Al2WWlK28 kGhr2s7g5U53qwFWBUD0EOCNx3kQGEZh0Y12EZTSroo3y6wiHyj8C8bhWqUmWhs6QtSB nU7cvczxx9i/slzSpKYLC0jXB4Gl/5XdgxZOC+96m4tsIIDfEE+3GD7LYPNvIWUVlGhO ApSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=ekAnATJTdmfUg0DcEkmrbjY+vvJNTDUxRikWUWpkohc=; b=it6Ko39/WtRqr2hN2alOppFGZtV0YE2PNrYcEmgYYH9a0HUMPat8dnw7yH7PhYReiy Lk4AL46Ue8rYK1FdRBg/8Ub4F52urr/t+N/u1Vtfw1AhYyfPkDg5YdHQKCl37aAd3x+E YSIXXdQskrx4IJz/UJZnpZAsdMia6BbapxWTq1vVftuJSp4/zI/udZyTkXnAXrYIDcOX YG6LQgimPseySqRc9ZuMq4WUq2MdR8J4O9cx2ogSuFihKARBf9KBYHWDBiYAX3wiN4P0 YViclaxHKqwapTAyn+fus0bB8zOXy76WhrU6lZkb0WDjTigDrju5Q39iVUbo+nvzUb7T SzQA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j35si15805636plb.61.2019.03.25.15.59.12; Mon, 25 Mar 2019 15:59:27 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730570AbfCYW6j (ORCPT + 99 others); Mon, 25 Mar 2019 18:58:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48954 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbfCYW6i (ORCPT ); Mon, 25 Mar 2019 18:58:38 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 644554E916; Mon, 25 Mar 2019 22:58:38 +0000 (UTC) Received: from ovpn-118-18.phx2.redhat.com (ovpn-118-18.phx2.redhat.com [10.3.118.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84DF719C56; Mon, 25 Mar 2019 22:58:37 +0000 (UTC) Message-ID: <655bf2991a4f8bf6a473c91218d6dba7748520aa.camel@redhat.com> Subject: Re: [PATCH 03/17] fpga: dfl: fme: support 512bit data width PR From: Scott Wood To: Wu Hao , atull@kernel.org, mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-api@vger.kernel.org, Ananda Ravuri , Xu Yilun Date: Mon, 25 Mar 2019 17:58:36 -0500 In-Reply-To: <127a9356a7bf597d35dd361f2b16bf80460f0370.camel@redhat.com> References: <1553483264-5379-1-git-send-email-hao.wu@intel.com> <1553483264-5379-4-git-send-email-hao.wu@intel.com> <127a9356a7bf597d35dd361f2b16bf80460f0370.camel@redhat.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 25 Mar 2019 22:58:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-03-25 at 17:53 -0500, Scott Wood wrote: > On Mon, 2019-03-25 at 11:07 +0800, Wu Hao wrote: > > In early partial reconfiguration private feature, it only > > supports 32bit data width when writing data to hardware for > > PR. 512bit data width PR support is an important optimization > > for some specific solutions (e.g. XEON with FPGA integrated), > > it allows driver to use AVX512 instruction to improve the > > performance of partial reconfiguration. e.g. programming one > > 100MB bitstream image via this 512bit data width PR hardware > > only takes ~300ms, but 32bit revision requires ~3s per test > > result. > > > > Please note now this optimization is only done on revision 2 > > of this PR private feature which is only used in integrated > > solution that AVX512 is always supported. > > > > Signed-off-by: Ananda Ravuri > > Signed-off-by: Xu Yilun > > Signed-off-by: Wu Hao > > --- > > drivers/fpga/dfl-fme-main.c | 3 ++ > > drivers/fpga/dfl-fme-mgr.c | 75 +++++++++++++++++++++++++++++++++++++- > > -- > > ----- > > drivers/fpga/dfl-fme-pr.c | 45 ++++++++++++++++----------- > > drivers/fpga/dfl-fme.h | 2 ++ > > drivers/fpga/dfl.h | 5 +++ > > 5 files changed, 99 insertions(+), 31 deletions(-) > > > > diff --git a/drivers/fpga/dfl-fme-main.c b/drivers/fpga/dfl-fme-main.c > > index 086ad24..076d74f 100644 > > --- a/drivers/fpga/dfl-fme-main.c > > +++ b/drivers/fpga/dfl-fme-main.c > > @@ -21,6 +21,8 @@ > > #include "dfl.h" > > #include "dfl-fme.h" > > > > +#define DRV_VERSION "0.8" > > What is this going to be used for? Under what circumstances will the > driver version be bumped? What does it have to do with 512-bit writes? > > > +#if defined(CONFIG_X86) && defined(CONFIG_AS_AVX512) > > + > > +#include > > + > > +static inline void copy512(void *src, void __iomem *dst) > > +{ > > + kernel_fpu_begin(); > > + > > + asm volatile("vmovdqu64 (%0), %%zmm0;" > > + "vmovntdq %%zmm0, (%1);" > > + : > > + : "r"(src), "r"(dst)); > > + > > + kernel_fpu_end(); > > +} > > Shouldn't there be some sort of check that AVX512 is actually supported > on the running system? > > Also, src should be const, and the asm statement should have a memory > clobber. > > > +#else > > +static inline void copy512(void *src, void __iomem *dst) > > +{ > > + WARN_ON_ONCE(1); > > +} > > +#endif > > Likewise, this will be called if a revision 2 device is used on non-x86 > (or on x86 with an old binutils). The driver should fall back to 32-bit > in such cases. Sorry, I missed the comment about revision 2 only being on integrated devices -- but will that always be the case? Seems worthwhile to check for AVX512 support anyway. And there's still the possibility of being built with an old binutils such that CONFIG_AS_AVX512 is not set, or running on a kernel where avx512 was disabled via a boot option. What about future revisions >= 2? Currently the driver will treat them as if they were revision < 2. Is that intended? -Scott