Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4102913rwd; Tue, 30 May 2023 00:01:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5CUjZBoSj1iRpshFvmntOIpK9wNK8xwCY1YbNRwDbT7ZOTgOmLhyf57jsM5aBh8PUKiwZI X-Received: by 2002:a05:6a21:6d8e:b0:105:fd78:cb41 with SMTP id wl14-20020a056a216d8e00b00105fd78cb41mr1486645pzb.54.1685430075222; Tue, 30 May 2023 00:01:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685430075; cv=none; d=google.com; s=arc-20160816; b=oUtR3na/COXbkOiZ5LN7HB3ya7uoFxAYJPRqgCavi1EeaeTStYF/6L2HoIABgckymF iLzheupfGJU4SHIKDyub3rD43XgjxMbTwsgmImUTOyH3TvHwry0Lkjflz6N2oYtrWCSM Yi5vXtRZMMf+mu8c9RfrEwVTU0yP9w3ACui325MoxFvMFUO2gfsoqWARvRwMyM7o+Jna 51XoFypkF6nyDuufU5Z5B4LGJ4Gpbmyp42jpAucWTXP0o3DQ8yFL/Fa/nPnyUVSbODxF zUIOcObbDuz4XcUNarMVz1ZkIX4mbwkQTFXBHYEI96ZGvrHJxdM3F794mNJ61owZcDxI 0vFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Lrs2xzQSWd/B17pykOzXdPrpmwDH8yng+WXG9SlZYa8=; b=hb2n2c6KXk8sU1cY9o5gFRDikInxQnBJuSIDXkO13Ch92GC8ar94hcRnymzZyJtW3q V5dz1tLSn78NPPoMHnZMs/AAMFOJoqf9DJSGfmRuJP7nRKvrSXG5U7mMXzARSGFenTGH 6ldTS4/S3bbG3aOBTNELer8MHNVD/jn9GlaymNpaodxQEhtIGHRc/9fkTAduczhnk86J ou5TEDj5oVmRm3Hulvt12YHnpQUCvt3XwMiX1PPG9ObGKc1FCg31HSqvMbnYBAM9vMsQ xgVk6LGt5197xEB0uULZB3NJCBgnQenVt/vfCLOrhR9VvjbAvRxY/3pADQqjs+hBgHMM 64dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hjuWY8Xz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020a637b0d000000b004fc39adf481si10793833pgc.381.2023.05.30.00.01.02; Tue, 30 May 2023 00:01:15 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=hjuWY8Xz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229934AbjE3Gw3 (ORCPT + 99 others); Tue, 30 May 2023 02:52:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjE3Gw1 (ORCPT ); Tue, 30 May 2023 02:52:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70153107 for ; Mon, 29 May 2023 23:52:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F01EB62AC2 for ; Tue, 30 May 2023 06:52:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D7B8C433A0 for ; Tue, 30 May 2023 06:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685429542; bh=siy9Ko3UbHkih669rTBXTrvvQJb6+6k5h7kksul6NjI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=hjuWY8Xz1RNVPltId3hJptIderckVfGZUOze/C01KfNLTniS/9JvZq2ZLrX62m+HX EP8gdcj04gBtPPWvc9nwSGzRvfmKo0HA9WC7hNmtkBldqQyq3DGgLLvFO3BWlo2O9R uAY0MOAIxcm/zSAvPsDy+tqReP/Qe2/TX+NraxQbqG7mhubXOytt1d8UjzkZMBWNil h7iQqH3U8EKBI9YuUDTXf6jPR8tGkQSolZ8YcyWYnohyrWQegVohXQnwKZpug06zU5 jIlCETnkZ/11wjn4aC3gXIJJmgxTjUO3H68E3sZsyUw6WMApoWhKyKg7decYv1/0JK CBW7gFicrQBNQ== Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5149aafef44so3153549a12.0 for ; Mon, 29 May 2023 23:52:22 -0700 (PDT) X-Gm-Message-State: AC+VfDyLT5Wg597PcO6kdK/LxZ4Tei//QJA3yrfP9xZQOl/QKVG+UpLQ 5KK7721VU3uTv8veyevEzTRWOVOuvohiE+bXq+8= X-Received: by 2002:aa7:c504:0:b0:504:b228:878d with SMTP id o4-20020aa7c504000000b00504b228878dmr878888edq.25.1685429540598; Mon, 29 May 2023 23:52:20 -0700 (PDT) MIME-Version: 1.0 References: <20230529073845.2859178-1-guoren@kernel.org> <20230529-jasmine-amigo-6d01f6852b35@wendy> In-Reply-To: From: Guo Ren Date: Tue, 30 May 2023 14:52:09 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] riscv: vector: Fixup modules compile error To: Conor Dooley Cc: greentime.hu@sifive.com, vincent.chen@sifive.com, andy.chiu@sifive.com, paul.walmsley@sifive.com, palmer@rivosinc.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Guo Ren Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Tue, May 30, 2023 at 10:59=E2=80=AFAM Guo Ren wrote: > > On Mon, May 29, 2023 at 9:43=E2=80=AFPM Conor Dooley wrote: > > > > On Mon, May 29, 2023 at 03:38:45AM -0400, guoren@kernel.org wrote: > > > From: Guo Ren > > > > > > Some .ko also need the riscv_v_user_allowed symbol. > > > > > > ERROR: modpost: "riscv_v_user_allowed" [arch/riscv/kvm/kvm.ko] > > > undefined! > > > make[3]: *** > > > [/home/guoren/source/kernel/linux/scripts/Makefile.modpost:136: > > > Module.symvers] Error 1 > > > > > > Signed-off-by: Guo Ren > > > Signed-off-by: Guo Ren > > > --- > > > arch/riscv/kernel/vector.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/arch/riscv/kernel/vector.c b/arch/riscv/kernel/vector.c > > > index 1c4ac821e008..3ae08816d608 100644 > > > --- a/arch/riscv/kernel/vector.c > > > +++ b/arch/riscv/kernel/vector.c > > > @@ -129,6 +129,7 @@ bool riscv_v_user_allowed(void) > > > { > > > return riscv_v_get_cur_ctrl(current) =3D=3D PR_RISCV_V_VSTATE_C= TRL_ON; > > > } > > > +EXPORT_SYMBOL(riscv_v_user_allowed); > > > > Is there a reason that this should not be EXPORT_SYMBOL_GPL()? > Good question, but I just follow our arch/riscv habbit, maybe we > should change all of that in another patch. > > =E2=9E=9C linux-s64ilp32 git:(s64ilp32) =E2=9C=97 grep EXPORT_SYMBOL ar= ch/riscv -r | wc -l > 66 > =E2=9E=9C linux-s64ilp32 git:(s64ilp32) =E2=9C=97 grep EXPORT_SYMBOL_GPL= arch/riscv -r | wc -l > 15 Why !MODULE_LICENSE(GPL) modules couldn't use riscv_v_user_allowed? Seems EXPORT_SYMBOL_GPL has more limitations. :c:func:`EXPORT_SYMBOL_GPL()` ----------------------------- Defined in ``include/linux/export.h`` Similar to :c:func:`EXPORT_SYMBOL()` except that the symbols exported by :c:func:`EXPORT_SYMBOL_GPL()` can only be seen by modules with a :c:func:`MODULE_LICENSE()` that specifies a GPL compatible license. It implies that the function is considered an internal implementation issue, and not really an interface. Some maintainers and developers may however require EXPORT_SYMBOL_GPL() when adding any new APIs or functionality. For kvm is okay: MODULE_AUTHOR("Qumranet"); MODULE_LICENSE("GPL"); So, I would leave the decition to Andy. If he didn't want it used with other non-gpl modules, choose the EXPORT_SYMBOL_GPL. > > > > > I figure Andy will roll this into this next revision. > > > > Cheers, > > Conor. > > > > -- > Best Regards > Guo Ren --=20 Best Regards Guo Ren