Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4674765img; Tue, 26 Mar 2019 14:23:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEiA/c7djyr3VDDRwW6Ui07hhHekEq8ck5gGO20WyJB8I3Jj3xAypppd8Htkp/cvBvwmqY X-Received: by 2002:a63:115c:: with SMTP id 28mr4121665pgr.270.1553635410747; Tue, 26 Mar 2019 14:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553635410; cv=none; d=google.com; s=arc-20160816; b=jZmr3TopVJR+jcg5+U631rQ3yoCOrtxBMcWpXBLpGKl3yTMQxHI5crGrOsXN6RoiB+ 7pwA4f2TqbZOVTQJd5vKdAIExQScSksQBnQjkbOf0rY5s1oUxe2leCobcQnXTsGdmY4K XIWzs9nNqfnynN1oJDiW/SlbPgHNtjKOf5IXHAmcxtjba6yBMRxP7yDfzRqqPuqk8cEd gNNJxjFLMrHlBxAmEpDmOyq5DmWuhwGW1YC2OStDvVA6zXcrFotfRaZP1Dna2nnvMopx dGsU8P3306DT1DRDLjbHaH3mEHNcyFqk7SJ9X4i5MH1S5ut9hfFNlu4S21YZVY4+o3hi 8Plw== 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=iikoHT0ekd9+YZybF4KtUkvlJ8OfHSTBc2WY9Ys504w=; b=sf3KYtcCAad9vfQkThiUYZtjWR/aphmUV5Dy9Oxpt5qaFw4tFSBXFSqIRLj0mrcWk7 l1z43yqFG6Ica8mXtZp4bwybp1NweBBjg65k4dRa6j30KPEU6qsukMlvCYjd3hp5NuER bMpvLjBAT5UuU86cv+7P3gs4XtGEaSZilftj8Q6C09/1e0YOPaDtVN9zdGT74sZUw1s6 2WdVg1g3AfjckdrpPD1AVoUPt1i/COTI09R9zE4cXgCOgXasVZgNKQabAZaTaVm5SpNL t3K+NSuYezB3kBzrnyEf/5+DmoPG3a3YbjVE0Cx4z83pvDsY8ZurUeecnfuv6/ttUuGq uHuA== 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 r4si16941588plo.416.2019.03.26.14.23.15; Tue, 26 Mar 2019 14:23:30 -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 S1732164AbfCZVWg (ORCPT + 99 others); Tue, 26 Mar 2019 17:22:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22806 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726207AbfCZVWf (ORCPT ); Tue, 26 Mar 2019 17:22:35 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AE3AF30718C1; Tue, 26 Mar 2019 21:22:35 +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 A6E9960160; Tue, 26 Mar 2019 21:22:34 +0000 (UTC) Message-ID: <580c6c604d3915c105f076fc7f22ab5da98598fc.camel@redhat.com> Subject: Re: [PATCH 03/17] fpga: dfl: fme: support 512bit data width PR From: Scott Wood To: Alan Tull Cc: Wu Hao , Moritz Fischer , linux-fpga@vger.kernel.org, linux-kernel , linux-api@vger.kernel.org, Ananda Ravuri , Xu Yilun Date: Tue, 26 Mar 2019 16:22:34 -0500 In-Reply-To: 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> 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 26 Mar 2019 21:22:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-03-26 at 14:33 -0500, Alan Tull wrote: > 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: > > > > +#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. That just indicates that binutils supports it. Plus, the code does not check for CONFIG_AS_AVX512 when deciding whether to set pr_datawidth to 64 (and thus call copy512), so you'll get a WARN_ON rather than falling back to 32-bit. > What boot option are you referring to? clearcpuid=304 -Scott