Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1852025rwb; Fri, 19 Aug 2022 10:26:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR6VBHqdzRulLQ3HFK4uR7FTY5+APy8vCaMY+Jj0tJFgE5zyNReFs58GRn9ox8YIPa4yBnLo X-Received: by 2002:a17:90b:1c12:b0:1fa:e52a:bd88 with SMTP id oc18-20020a17090b1c1200b001fae52abd88mr4133449pjb.24.1660929989917; Fri, 19 Aug 2022 10:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660929989; cv=none; d=google.com; s=arc-20160816; b=QzKtJoO7CBLpq/iqEuY2Fy5MNINyD9FHtpMW7JFnFBT4c82EH+iUmrBcVQIASuTzXC WY0J0Afal1bFBGHmXhG2ynOrx4m27wWAzCRnYNJRVSxBlIMxeYSJr462UHB1plfkaZw5 yxgXWhEx5krpCX9fOxlS8luhgh4CTgyceQD04ukO0mxPydv+52QzJBh2XKK5ufpnswYu A0kwsmVHnvKzGEF+8a6QXk2GrJdCFh5oEh7o6HY4hXuRKH8Whkhy0Q3KRHzoU97DBiP5 u7r4mU7tkFF/QAgj40wuxzzl7cF9IFoR6u07thsZ4F6sws3pHRH3ktqfBTsgQBpNcEfN DBiQ== 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=C0GWzj365wE2sR7xJX1mOB/d9C1PQzA2HDwoU7ywZuE=; b=YiBYYhLvafhEwm7bS46BYxj46l86+hK+ZoKZ8uNXw4RMEkmMzu6/0Vu5G+/9s1CFTg CCGAEWnM7DiA91DA/NGtFI2467MWk8jI5POx0iwjDyp6xmdrgpMlJQG/53FrcqDrKOvA Tk75DwdPk0Lw8aJGHFAP33j6MbrJ0RAsCtBgYbmPb5jRjGGH4J/UkpdO4AZBDeG3qz7S j0O7YTr9C1dhg/T57M0/BtTmHffSNp4+3P8taCJnhLRoCm/RTU5uxx7tFmK+tbpQvrFQ zUmOiO8A+dWlz5TGVuTfBrQECWcOrcfb1gryvjC657mwTbp2CllTg3JQFshHNVVryED/ Tqog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=C8rxUGor; 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 e65-20020a636944000000b0041e1bbc16a8si4335052pgc.608.2022.08.19.10.26.18; Fri, 19 Aug 2022 10:26:29 -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=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=C8rxUGor; 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 S1354249AbiHSQtu (ORCPT + 99 others); Fri, 19 Aug 2022 12:49:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354003AbiHSQsH (ORCPT ); Fri, 19 Aug 2022 12:48:07 -0400 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35FFC12C7CE for ; Fri, 19 Aug 2022 09:12:54 -0700 (PDT) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-335624d1e26so133918707b3.4 for ; Fri, 19 Aug 2022 09:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=C0GWzj365wE2sR7xJX1mOB/d9C1PQzA2HDwoU7ywZuE=; b=C8rxUGor26d4pLtnEfWBFLrobr0zohYJN0RmYiPmeejX1B5WIjYxlIW6O6vpwvR1kl 3uyk2b69rpX1Z3KkgD3NkX1UoIyiYooWrnZ6e7S7ptV0p9zUkVWpISqr0vV4dh6XhLMo E/w7i0Od1rZfz4/HXc07NbXbPwaU3YJg3txrbrh6/mjobSJcCr/bsWdBDVEacMmKXqAR ks00PMAhxsmPvbjHWRuvDJvT0i4MbZWIBfJl6VOxH8utFU8fi+hxR2qvbZ+V3nh5ZB2Z QBUwOkvnNc6PVLu7I6vwOjRs/zkpKfYc3BrO7YAqAjfgYZFMAZ7OdpFJnQAUhunI4M92 Tv1w== 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; bh=C0GWzj365wE2sR7xJX1mOB/d9C1PQzA2HDwoU7ywZuE=; b=EMLRluLV8FU5k7xy9mqp60FPLhrCnq6Dx22dWGW9vXMy3XBuFpjjwIR2edo+crnt8X y6K1ECfEyNvrCW1wSSiCZAJe34MuSvVW+vYeXAGkrcJU4/bfhFuEuRSVVE81R/23KMik RVBhmw2paxic/4wyyrfiZTLdYesIkayReziq8EljCDpyMrmsyy+B67UtBtz+s3OUjIEg 82iqAzQ4JyHmQy0f7hcm1kyhNXWqVcuCJOLv2Auo9vNBbs4a7l8V8tcgATMgg1Zi8ofl TyGjncr5B8CfqumKZz+kfbiKSUDA1ybO6xx/hjS1MQO+pzVwMboVCo5MZOqfU3utvUnp MpaA== X-Gm-Message-State: ACgBeo12aBR9+OeHdVzSaPVApGnZaXIbUnbFPady84thTqxERD5lriXF jDNG2QR4ATeuHtU4ioGCfacorlKQYU8G02rh3ROtsA== X-Received: by 2002:a5b:850:0:b0:68c:5798:a927 with SMTP id v16-20020a5b0850000000b0068c5798a927mr8403287ybq.8.1660925547310; Fri, 19 Aug 2022 09:12:27 -0700 (PDT) MIME-Version: 1.0 References: <20220814141237.493457-1-mail@conchuod.ie> <20220814141237.493457-3-mail@conchuod.ie> In-Reply-To: <20220814141237.493457-3-mail@conchuod.ie> From: Anup Patel Date: Fri, 19 Aug 2022 21:42:15 +0530 Message-ID: Subject: Re: [PATCH 2/4] riscv: kvm: move extern sbi_ext declarations to a header To: Conor Dooley Cc: Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Guo Ren , Vincent Chen , Xianting Tian , Heiko Stuebner , Kefeng Wang , Tong Tiangen , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, 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 Sun, Aug 14, 2022 at 7:42 PM Conor Dooley wrote: > > From: Conor Dooley > > Sparse complains about missing statics in the declarations of several > variables: > arch/riscv/kvm/vcpu_sbi_replace.c:38:37: warning: symbol 'vcpu_sbi_ext_time' was not declared. Should it be static? > arch/riscv/kvm/vcpu_sbi_replace.c:73:37: warning: symbol 'vcpu_sbi_ext_ipi' was not declared. Should it be static? > arch/riscv/kvm/vcpu_sbi_replace.c:126:37: warning: symbol 'vcpu_sbi_ext_rfence' was not declared. Should it be static? > arch/riscv/kvm/vcpu_sbi_replace.c:170:37: warning: symbol 'vcpu_sbi_ext_srst' was not declared. Should it be static? > arch/riscv/kvm/vcpu_sbi_base.c:69:37: warning: symbol 'vcpu_sbi_ext_base' was not declared. Should it be static? > arch/riscv/kvm/vcpu_sbi_base.c:90:37: warning: symbol 'vcpu_sbi_ext_experimental' was not declared. Should it be static? > arch/riscv/kvm/vcpu_sbi_base.c:96:37: warning: symbol 'vcpu_sbi_ext_vendor' was not declared. Should it be static? > arch/riscv/kvm/vcpu_sbi_hsm.c:115:37: warning: symbol 'vcpu_sbi_ext_hsm' was not declared. Should it be static? > > These variables are however used in vcpu_sbi.c where they are declared > as extern. Move them to kvm_vcpu_sbi.h which is handily already > included by the three other files. > > Fixes: a046c2d8578c ("RISC-V: KVM: Reorganize SBI code by moving SBI v0.1 to its own file") > Fixes: 5f862df5585c ("RISC-V: KVM: Add v0.1 replacement SBI extensions defined in v0.2") > Fixes: 3e1d86569c21 ("RISC-V: KVM: Add SBI HSM extension in KVM") > Signed-off-by: Conor Dooley I have queued this fix for 6.0-rc1 Thanks, Anup > --- > arch/riscv/include/asm/kvm_vcpu_sbi.h | 12 ++++++++++++ > arch/riscv/kvm/vcpu_sbi.c | 12 +----------- > 2 files changed, 13 insertions(+), 11 deletions(-) > > diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h > index 83d6d4d2b1df..26a446a34057 100644 > --- a/arch/riscv/include/asm/kvm_vcpu_sbi.h > +++ b/arch/riscv/include/asm/kvm_vcpu_sbi.h > @@ -33,4 +33,16 @@ void kvm_riscv_vcpu_sbi_system_reset(struct kvm_vcpu *vcpu, > u32 type, u64 flags); > const struct kvm_vcpu_sbi_extension *kvm_vcpu_sbi_find_ext(unsigned long extid); > > +#ifdef CONFIG_RISCV_SBI_V01 > +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01; > +#endif > +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_base; > +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_time; > +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_ipi; > +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_rfence; > +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_srst; > +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_hsm; > +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_experimental; > +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_vendor; > + > #endif /* __RISCV_KVM_VCPU_SBI_H__ */ > diff --git a/arch/riscv/kvm/vcpu_sbi.c b/arch/riscv/kvm/vcpu_sbi.c > index d45e7da3f0d3..f96991d230bf 100644 > --- a/arch/riscv/kvm/vcpu_sbi.c > +++ b/arch/riscv/kvm/vcpu_sbi.c > @@ -32,23 +32,13 @@ static int kvm_linux_err_map_sbi(int err) > }; > } > > -#ifdef CONFIG_RISCV_SBI_V01 > -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01; > -#else > +#ifndef CONFIG_RISCV_SBI_V01 > static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01 = { > .extid_start = -1UL, > .extid_end = -1UL, > .handler = NULL, > }; > #endif > -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_base; > -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_time; > -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_ipi; > -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_rfence; > -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_srst; > -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_hsm; > -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_experimental; > -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_vendor; > > static const struct kvm_vcpu_sbi_extension *sbi_ext[] = { > &vcpu_sbi_ext_v01, > -- > 2.37.1 >