The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] riscv: kvm: define vcpu_sbi_ext_pmu in header
@ 2023-06-16 11:54 Ben Dooks
  2023-06-16 12:19 ` Anup Patel
  2023-06-16 12:22 ` Conor Dooley
  0 siblings, 2 replies; 4+ messages in thread
From: Ben Dooks @ 2023-06-16 11:54 UTC (permalink / raw)
  To: linux-riscv; +Cc: kvm-riscv, kvm, linux-kernel, palmer, anup, atishp, Ben Dooks

Sparse is giving a warning about vcpu_sbi_ext_pmu not being
defined, so add a definition to the relevant header to fix
the following:

arch/riscv/kvm/vcpu_sbi_pmu.c:81:37: warning: symbol 'vcpu_sbi_ext_pmu' was not declared. Should it be static?

Fixes: 3e5e56c60a1477 ("riscv: kvm: move extern sbi_ext declarations to a header")
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 arch/riscv/include/asm/kvm_vcpu_sbi.h | 3 +++
 arch/riscv/kvm/vcpu_sbi.c             | 4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h
index 4278125a38a5..b94c7e958da7 100644
--- a/arch/riscv/include/asm/kvm_vcpu_sbi.h
+++ b/arch/riscv/include/asm/kvm_vcpu_sbi.h
@@ -66,4 +66,7 @@ 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;
 
+#ifdef CONFIG_RISCV_PMU_SBI
+extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu;
+#endif
 #endif /* __RISCV_KVM_VCPU_SBI_H__ */
diff --git a/arch/riscv/kvm/vcpu_sbi.c b/arch/riscv/kvm/vcpu_sbi.c
index e52fde504433..c973d92a0ba5 100644
--- a/arch/riscv/kvm/vcpu_sbi.c
+++ b/arch/riscv/kvm/vcpu_sbi.c
@@ -20,9 +20,7 @@ static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01 = {
 };
 #endif
 
-#ifdef CONFIG_RISCV_PMU_SBI
-extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu;
-#else
+#ifndef CONFIG_RISCV_PMU_SBI
 static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu = {
 	.extid_start = -1UL,
 	.extid_end = -1UL,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: kvm: define vcpu_sbi_ext_pmu in header
  2023-06-16 11:54 [PATCH] riscv: kvm: define vcpu_sbi_ext_pmu in header Ben Dooks
@ 2023-06-16 12:19 ` Anup Patel
  2023-06-16 12:22 ` Conor Dooley
  1 sibling, 0 replies; 4+ messages in thread
From: Anup Patel @ 2023-06-16 12:19 UTC (permalink / raw)
  To: Ben Dooks; +Cc: linux-riscv, kvm-riscv, kvm, linux-kernel, palmer, atishp

On Fri, Jun 16, 2023 at 5:24 PM Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>
> Sparse is giving a warning about vcpu_sbi_ext_pmu not being
> defined, so add a definition to the relevant header to fix
> the following:
>
> arch/riscv/kvm/vcpu_sbi_pmu.c:81:37: warning: symbol 'vcpu_sbi_ext_pmu' was not declared. Should it be static?
>
> Fixes: 3e5e56c60a1477 ("riscv: kvm: move extern sbi_ext declarations to a header")
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

Looks good to me.

Reviewed-by: Anup Patel <anup@brainfault.org>

Thanks,
Anup

> ---
>  arch/riscv/include/asm/kvm_vcpu_sbi.h | 3 +++
>  arch/riscv/kvm/vcpu_sbi.c             | 4 +---
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h
> index 4278125a38a5..b94c7e958da7 100644
> --- a/arch/riscv/include/asm/kvm_vcpu_sbi.h
> +++ b/arch/riscv/include/asm/kvm_vcpu_sbi.h
> @@ -66,4 +66,7 @@ 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;
>
> +#ifdef CONFIG_RISCV_PMU_SBI
> +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu;
> +#endif
>  #endif /* __RISCV_KVM_VCPU_SBI_H__ */
> diff --git a/arch/riscv/kvm/vcpu_sbi.c b/arch/riscv/kvm/vcpu_sbi.c
> index e52fde504433..c973d92a0ba5 100644
> --- a/arch/riscv/kvm/vcpu_sbi.c
> +++ b/arch/riscv/kvm/vcpu_sbi.c
> @@ -20,9 +20,7 @@ static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01 = {
>  };
>  #endif
>
> -#ifdef CONFIG_RISCV_PMU_SBI
> -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu;
> -#else
> +#ifndef CONFIG_RISCV_PMU_SBI
>  static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu = {
>         .extid_start = -1UL,
>         .extid_end = -1UL,
> --
> 2.39.2
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: kvm: define vcpu_sbi_ext_pmu in header
  2023-06-16 11:54 [PATCH] riscv: kvm: define vcpu_sbi_ext_pmu in header Ben Dooks
  2023-06-16 12:19 ` Anup Patel
@ 2023-06-16 12:22 ` Conor Dooley
  2023-06-16 12:55   ` Ben Dooks
  1 sibling, 1 reply; 4+ messages in thread
From: Conor Dooley @ 2023-06-16 12:22 UTC (permalink / raw)
  To: Ben Dooks; +Cc: linux-riscv, kvm-riscv, kvm, linux-kernel, palmer, anup, atishp

[-- Attachment #1: Type: text/plain, Size: 2043 bytes --]

Hey Ben,

On Fri, Jun 16, 2023 at 12:54:10PM +0100, Ben Dooks wrote:
> Sparse is giving a warning about vcpu_sbi_ext_pmu not being
> defined, so add a definition to the relevant header to fix
> the following:
> 
> arch/riscv/kvm/vcpu_sbi_pmu.c:81:37: warning: symbol 'vcpu_sbi_ext_pmu' was not declared. Should it be static?
> 
> Fixes: 3e5e56c60a1477 ("riscv: kvm: move extern sbi_ext declarations to a header")

You sure this is the right fixes tag? This code didn't exist when I
wrote that commit, should the fixes tag not be
	Fixes: cbddc4c4cb9e ("RISC-V: KVM: Add SBI PMU extension support")
instead?

Cheers,
Conor.

> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>  arch/riscv/include/asm/kvm_vcpu_sbi.h | 3 +++
>  arch/riscv/kvm/vcpu_sbi.c             | 4 +---
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h
> index 4278125a38a5..b94c7e958da7 100644
> --- a/arch/riscv/include/asm/kvm_vcpu_sbi.h
> +++ b/arch/riscv/include/asm/kvm_vcpu_sbi.h
> @@ -66,4 +66,7 @@ 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;
>  
> +#ifdef CONFIG_RISCV_PMU_SBI
> +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu;
> +#endif
>  #endif /* __RISCV_KVM_VCPU_SBI_H__ */
> diff --git a/arch/riscv/kvm/vcpu_sbi.c b/arch/riscv/kvm/vcpu_sbi.c
> index e52fde504433..c973d92a0ba5 100644
> --- a/arch/riscv/kvm/vcpu_sbi.c
> +++ b/arch/riscv/kvm/vcpu_sbi.c
> @@ -20,9 +20,7 @@ static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01 = {
>  };
>  #endif
>  
> -#ifdef CONFIG_RISCV_PMU_SBI
> -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu;
> -#else
> +#ifndef CONFIG_RISCV_PMU_SBI
>  static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu = {
>  	.extid_start = -1UL,
>  	.extid_end = -1UL,
> -- 
> 2.39.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: kvm: define vcpu_sbi_ext_pmu in header
  2023-06-16 12:22 ` Conor Dooley
@ 2023-06-16 12:55   ` Ben Dooks
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2023-06-16 12:55 UTC (permalink / raw)
  To: Conor Dooley
  Cc: linux-riscv, kvm-riscv, kvm, linux-kernel, palmer, anup, atishp

On 16/06/2023 13:22, Conor Dooley wrote:
> Hey Ben,
> 
> On Fri, Jun 16, 2023 at 12:54:10PM +0100, Ben Dooks wrote:
>> Sparse is giving a warning about vcpu_sbi_ext_pmu not being
>> defined, so add a definition to the relevant header to fix
>> the following:
>>
>> arch/riscv/kvm/vcpu_sbi_pmu.c:81:37: warning: symbol 'vcpu_sbi_ext_pmu' was not declared. Should it be static?
>>
>> Fixes: 3e5e56c60a1477 ("riscv: kvm: move extern sbi_ext declarations to a header")
> 
> You sure this is the right fixes tag? This code didn't exist when I
> wrote that commit, should the fixes tag not be
> 	Fixes: cbddc4c4cb9e ("RISC-V: KVM: Add SBI PMU extension support")
> instead?

I think you're right there.

> Cheers,
> Conor.
> 
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>> ---
>>   arch/riscv/include/asm/kvm_vcpu_sbi.h | 3 +++
>>   arch/riscv/kvm/vcpu_sbi.c             | 4 +---
>>   2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h
>> index 4278125a38a5..b94c7e958da7 100644
>> --- a/arch/riscv/include/asm/kvm_vcpu_sbi.h
>> +++ b/arch/riscv/include/asm/kvm_vcpu_sbi.h
>> @@ -66,4 +66,7 @@ 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;
>>   
>> +#ifdef CONFIG_RISCV_PMU_SBI
>> +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu;
>> +#endif
>>   #endif /* __RISCV_KVM_VCPU_SBI_H__ */
>> diff --git a/arch/riscv/kvm/vcpu_sbi.c b/arch/riscv/kvm/vcpu_sbi.c
>> index e52fde504433..c973d92a0ba5 100644
>> --- a/arch/riscv/kvm/vcpu_sbi.c
>> +++ b/arch/riscv/kvm/vcpu_sbi.c
>> @@ -20,9 +20,7 @@ static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01 = {
>>   };
>>   #endif
>>   
>> -#ifdef CONFIG_RISCV_PMU_SBI
>> -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu;
>> -#else
>> +#ifndef CONFIG_RISCV_PMU_SBI
>>   static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu = {
>>   	.extid_start = -1UL,
>>   	.extid_end = -1UL,
>> -- 
>> 2.39.2
>>

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-16 13:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-16 11:54 [PATCH] riscv: kvm: define vcpu_sbi_ext_pmu in header Ben Dooks
2023-06-16 12:19 ` Anup Patel
2023-06-16 12:22 ` Conor Dooley
2023-06-16 12:55   ` Ben Dooks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox