Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4596928img; Tue, 26 Mar 2019 12:35:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhvA/IFWOr3zjP2L5HGHJwE7zAkqsJMAwjF60ZEIgwOviZaSM2bOrvahKcI/0sVEsBvXk2 X-Received: by 2002:a65:64c3:: with SMTP id t3mr30305880pgv.14.1553628932502; Tue, 26 Mar 2019 12:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553628932; cv=none; d=google.com; s=arc-20160816; b=VMcMvefFy9ezBSseVqrr8CZ37HUvsKNG4zzquhMOTz42exB/RoGMcvJyXF0zN4vi/Q Z1W6fQE5+vcUpkZsevFHCB97a6wHS7xIn9jlA9qF+166Oq3aqhNkLHVp24LUDpmPLlHU +gjrCRduJTMBVI/25/L/h/mLrG70IQezVQWIGu1ae+RP8BQH6cIV238KfTlnuzcr8qNg KTvCgJXxgqw3xM+hFn5Mub4wY0qHbjtQA5JR2eclBPOfA7eBsnnpCCmT3YUPu7i23t6j GPBBvRDVVOsPnF2bJWOjZPzl/r8lGVbAhTwt2L2EEOjWVSvqCbst+s4ov9xLxUCpxg49 wRuw== 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=HogdFED049Su5sPAi1So6n5PBIBacMiaY4caCyKmlMQ=; b=VeYs0rFFpF4bmqXwXlrQoHDoDuRPQ+qd3F7Xr8tARBXDK/NvKDTbIo/mRJPBd1QWMZ Zv3yHV6zDsKeU+5YFcAgEDuNb6JDkd27yMxAzwUuOoPoNe0kpYIh0gvtQVUDtGUBO21f BKJ6BHiRwiZjB8xwaX22tU8YJsmerDoZuA/hhycdRe27mbVs9r60dclT6t4zjhqy1GUG ImqOyQiRTKeKvN285RLEyLYk/IOABPyzB6MtzgwAS2ktPM1kqRPiO7bxlHNnNqYHcfYI MvX88x7LU5UnO9nj38xj71qWiX4cnE80ewNfJVVTmgWmuEjKybg7CQIYI+pm1Ad4k0yj lCog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=enhrMGV3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si17217730plp.306.2019.03.26.12.35.14; Tue, 26 Mar 2019 12:35:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b=enhrMGV3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732019AbfCZTed (ORCPT + 99 others); Tue, 26 Mar 2019 15:34:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:53594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727492AbfCZTed (ORCPT ); Tue, 26 Mar 2019 15:34:33 -0400 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D533C20823; Tue, 26 Mar 2019 19:34:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553628872; bh=/KBG1Y6DveuMq0Zr4sxYKpDClR/xgbJ7AmXr4IPbNWI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=enhrMGV326WWllTxiJ09sa3zh041IZM1VPlz/khoxns7qHl1jVgoGSkDMJ91reGgx KIab5mm3K620BLSCvEXEvJMi+iX02jOikR3+WV6XgI00+CIEK/7jBKRY6U1oWRro1C XJKEwyZ5TgjEAgZ4B+N219+Y/NBIPsrAZcThtDyM= Received: by mail-ed1-f44.google.com with SMTP id d26so11834221ede.10; Tue, 26 Mar 2019 12:34:31 -0700 (PDT) X-Gm-Message-State: APjAAAV9KyxqTrwH8OhWjSfzO/WEeWououW21Ol7GxOIrGO4kfxGNACe CUWdVIAdcu/5w0bHyl1MHjw+bvu7dWtP2+k5tdk= X-Received: by 2002:aa7:c70a:: with SMTP id i10mr21594763edq.153.1553628870403; Tue, 26 Mar 2019 12:34:30 -0700 (PDT) MIME-Version: 1.0 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> <655bf2991a4f8bf6a473c91218d6dba7748520aa.camel@redhat.com> In-Reply-To: <655bf2991a4f8bf6a473c91218d6dba7748520aa.camel@redhat.com> From: Alan Tull Date: Tue, 26 Mar 2019 14:33:54 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 03/17] fpga: dfl: fme: support 512bit data width PR To: Scott Wood Cc: Wu Hao , Moritz Fischer , linux-fpga@vger.kernel.org, linux-kernel , linux-api@vger.kernel.org, Ananda Ravuri , Xu Yilun 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, Mar 25, 2019 at 5:58 PM Scott Wood wrote: Hi Scott, > > 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. The code checks for CONFIG_AS_AVX512 above. What boot option are you referring to? Alan > > What about future revisions >= 2? Currently the driver will treat them as > if they were revision < 2. Is that intended? > > -Scott > >