Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp264458rwb; Wed, 14 Dec 2022 17:07:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf5LX4kHXn1biqk97S26gSYcwdFv/RDxAz0eumMz+PskcVrnsIcO/jCc54VlzGTMdPRjYta0 X-Received: by 2002:a17:906:eb86:b0:7c1:3472:5e75 with SMTP id mh6-20020a170906eb8600b007c134725e75mr23648897ejb.29.1671066452636; Wed, 14 Dec 2022 17:07:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671066452; cv=none; d=google.com; s=arc-20160816; b=pu5Sbfb4eGEdQJi0Gv0UwQu7UUT09Dhv6uqqds+cXXZDUIbVax0LIZItGOOlabxvRy gtLIraxVqiwrh7Vyrfv1XlZbZOw4O2Dq1WasS0nKl4Db3/VXwJ5FV1/BHFS6uLCknes6 CLbKbZPue0kEqt4a1jL6ecrYdhQ/Z30jxrOggUBKVwa0x5LrXX7NJyyAATWAjliIXEYJ rBIsULJXY6V5vlb7TBqxY3JdrzY662b2LSlYaOXnK0d62mfnOTnFEDNaxTEJmuPb2FMf rAn93eenojG83UOCjzSVwDk8m3h1pRP3VdgZIuU7y/Mhrr5H3t8MwuDBsbqO72W+Gduu yehg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=l1+9aFWIywW24+fuTbx+Qyc1HRmi+jILztX+FivWx3Q=; b=vB49gLvVppHcR3/I5aPMRb9sZM5rep74VhAEfWpwp7bM+RqiEdt4vErY/KJtw7c2fN CsqtnA7z/am2xCzTPkOAhykaCyopzH3ZxqnDJxrJYspntQS8e8ANUln+tqCvHDJGyc/j YeQJIKDktCRXZies9Ao8KpNt/uDUVjMsEyU8ZgnBOIaVaE6UNA/YZerTYuJyNULIgCAI alEdy07MqT0RO0T8UbM4QdwsEqCd0tKiKDK3v7dxaglOu/I+Y+Jz57kCy3MR2pW8wIco PA61H2LLh6XpDmJ2zKEspdRP4OMDfCwO8dutPVHjd0HnWoC3kkZ0iRvOHdlymQqQ2O5B AFyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=jb2ClHC0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc39-20020a1709071c2700b007c1052c9243si14137996ejc.15.2022.12.14.17.07.15; Wed, 14 Dec 2022 17:07:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=jb2ClHC0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229530AbiLOAlL (ORCPT + 69 others); Wed, 14 Dec 2022 19:41:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbiLOAlI (ORCPT ); Wed, 14 Dec 2022 19:41:08 -0500 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05F90511EF for ; Wed, 14 Dec 2022 16:41:05 -0800 (PST) Received: by mail-pf1-x42f.google.com with SMTP id 124so5703883pfy.0 for ; Wed, 14 Dec 2022 16:41:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=l1+9aFWIywW24+fuTbx+Qyc1HRmi+jILztX+FivWx3Q=; b=jb2ClHC0JzlU6/A7oG9wX2lIjW163wYAAsnuD7z6vHKLAJ6WCABdC0zHaJgH+vW1cJ X85wm2u0tBa3ucj4A9xYBR14n5W4lrDo4Z776KQYkYdhCQEQVA9T1mvhctnbGmU3BE4C WARNv31LD1wabhMMu+06rdt20q9faYRYxU+FQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l1+9aFWIywW24+fuTbx+Qyc1HRmi+jILztX+FivWx3Q=; b=seC/ITr2vedH4mSAcHeGOA+3OzZVsvbBSL12MZ0pwxoyOpxNjpl7gCyAB4wKHJA8NY EAJhcIb0xSUHiylewlGSErKWyfUpqIFLM+XQh0spGvS3WlAokpD5j8W/KlpfN5/vMvdl 4zeOl2lqYDYkzap/tG9YOi+3i3rZmbKGF8R0yjg2foWdqzHuLGJ+fo3iKxED76IhDL4G CKFggTdhWw7/FWJX9Rbr6vET3t6/xn0x3/TBphBtPphgXztj2ItuhDonYFTpKoqlkj2A O8vhfsoKEv5hJBIErlsff5bE+aoSqYSxmqIioSCjq1WNmvJ6VU+yxlqmDXknAJrBv5io QvFw== X-Gm-Message-State: ANoB5pnxZXMSGCVlEGQmvx4k2oVAe/kt6DTuSgd/oqhECg/czIHyfqe8 FujIzvuiGT0Ohkm9hIxdXcnDWEUMbq3hmTlcMspZ X-Received: by 2002:a63:f4b:0:b0:46f:98cf:3bb6 with SMTP id 11-20020a630f4b000000b0046f98cf3bb6mr68618832pgp.332.1671064864426; Wed, 14 Dec 2022 16:41:04 -0800 (PST) MIME-Version: 1.0 References: <20220921214439.1491510-1-stillson@rivosinc.com> <20220921214439.1491510-4-stillson@rivosinc.com> In-Reply-To: <20220921214439.1491510-4-stillson@rivosinc.com> From: Atish Patra Date: Wed, 14 Dec 2022 16:40:52 -0800 Message-ID: Subject: Re: [PATCH v12 04/17] riscv: Add vector feature to compile To: Chris Stillson Cc: Guo Ren , Greentime Hu , Paul Walmsley , Palmer Dabbelt , Albert Ou , Eric Biederman , Kees Cook , Anup Patel , Oleg Nesterov , Guo Ren , Heinrich Schuchardt , Arnaud Pouliquen , Paolo Bonzini , Qinglin Pan , Alexandre Ghiti , Vincent Chen , Arnd Bergmann , Heiko Stuebner , Jisheng Zhang , Dao Lu , "Peter Zijlstra (Intel)" , Sunil V L , Han-Kuan Chen , Changbin Du , Li Zhengyu , Alexander Graf , Ard Biesheuvel , Tsukasa OI , Yury Norov , Frederic Weisbecker , Mark Rutland , Myrtle Shah , Vitaly Wool , Mathieu Desnoyers , Catalin Marinas , Mark Brown , Will Deacon , Heiko Carstens , Huacai Chen , Alexey Dobriyan , Janosch Frank , Christian Brauner , Evgenii Stepanov , Peter Collingbourne , Eugene Syromiatnikov , Colin Cross , Andrew Morton , Suren Baghdasaryan , Barret Rhoden , Davidlohr Bueso , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 21, 2022 at 2:47 PM Chris Stillson wrote: > > From: Guo Ren > > This patch adds a new config option which could enable assembler's > vector feature. > > Signed-off-by: Guo Ren > Co-developed-by: Greentime Hu > Signed-off-by: Greentime Hu > --- > arch/riscv/Kconfig | 15 +++++++++++++-- > arch/riscv/Makefile | 1 + > 2 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index ed66c31e4655..e294d85bfb7d 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -432,7 +432,17 @@ config FPU > > If you don't know what to do here, say Y. > > -endmenu # "Platform type" > +config VECTOR > + bool "VECTOR support" > + depends on GCC_VERSION >= 120000 || CLANG_VERSION >= 130000 > + default n > + help > + Say N here if you want to disable all vector related procedure > + in the kernel. > + > + If you don't know what to do here, say Y. > + > +endmenu > > menu "Kernel features" > > @@ -556,6 +566,7 @@ config CMDLINE_EXTEND > cases where the provided arguments are insufficient and > you don't want to or cannot modify them. > > + > config CMDLINE_FORCE > bool "Always use the default kernel command string" > help > @@ -648,7 +659,7 @@ config XIP_PHYS_ADDR > be linked for and stored to. This address is dependent on your > own flash usage. > > -endmenu # "Boot options" > +endmenu > > config BUILTIN_DTB > bool > diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile > index 3fa8ef336822..1ec17f3d6d09 100644 > --- a/arch/riscv/Makefile > +++ b/arch/riscv/Makefile > @@ -50,6 +50,7 @@ riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima > riscv-march-$(CONFIG_ARCH_RV64I) := rv64ima > riscv-march-$(CONFIG_FPU) := $(riscv-march-y)fd > riscv-march-$(CONFIG_RISCV_ISA_C) := $(riscv-march-y)c > +riscv-march-$(CONFIG_VECTOR) := $(riscv-march-y)v > > # Newer binutils versions default to ISA spec version 20191213 which moves some > # instructions from the I extension to the Zicsr and Zifencei extensions. > -- > 2.25.1 > Kernel boot hangs if compiled LLVM and vector enabled. Because LLVM enables auto vectorization by default and it inserts random vector instructions. We need to add "-mno-implicit-float" for llvm builds to disable auto vectorization. Thanks Vineet and Saleem for the hint :). -- Regards, Atish