Skip to contentSkip to conversation

riscv: kvm: define vcpu_sbi_ext_pmu in header

PATCH In review Ben Dooks 3 participants 4 messages Jun 16, 2023 – Jun 18, 2023

Subsystems (3)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH v2 1/1 riscv: kvm: define vcpu_sbi_ext_pmu in header

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 cbddc4c4cb9e ("RISC-V: KVM: Add SBI PMU extension support")

---
v2:
- correct the fixes tag as suggested by Conor Dooley

---
 arch/riscv/include/asm/kvm_vcpu_sbi.h | 3 +++
 arch/riscv/kvm/vcpu_sbi.c             | 4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)
arch/riscv/include/asm/kvm_vcpu_sbi.h +3 -0
index 4278125a38a5..b94c7e958da7 100644
@@ -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__ */
arch/riscv/kvm/vcpu_sbi.c +1 -3
index e52fde504433..c973d92a0ba5 100644
@@ -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,
Signature · 1 line
2.39.2
maintainer
#1 lore raw
Quoted 9 lines · On Fri, Jun 16, 2023 at 7:52?PM Ben Dooks <[email protected]> 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 cbddc4c4cb9e ("RISC-V: KVM: Add SBI PMU extension support")

Please include Reviewed-by tags obtained on previous version

Regards,
Anup

Quoted 38 lines

---
v2:
- correct the fixes tag as suggested by Conor Dooley

---
 arch/riscv/include/asm/kvm_vcpu_sbi.h | 3 +++
 arch/riscv/kvm/vcpu_sbi.c             | 4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)
arch/riscv/include/asm/kvm_vcpu_sbi.h +3 -0
index 4278125a38a5..b94c7e958da7 100644
@@ -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__ */
arch/riscv/kvm/vcpu_sbi.c +1 -4
index e52fde504433..c973d92a0ba5 100644
@@ -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

Reviewed-by on v2 1/1
#2 lore raw
In reply to Ben Dooks
Quoted 8 lines · 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 cbddc4c4cb9e ("RISC-V: KVM: Add SBI PMU extension support")

Cheers,
Conor.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/kvm-riscv/attachments/20230616/6addc8cc/attachment.sig>

maintainer
#3 lore raw
In reply to Ben Dooks
Quoted 9 lines · On Fri, Jun 16, 2023 at 7:52?PM Ben Dooks <[email protected]> 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 cbddc4c4cb9e ("RISC-V: KVM: Add SBI PMU extension support")

Queued this for 6.5

Thanks,
Anup

Quoted 38 lines

---
v2:
- correct the fixes tag as suggested by Conor Dooley

---
 arch/riscv/include/asm/kvm_vcpu_sbi.h | 3 +++
 arch/riscv/kvm/vcpu_sbi.c             | 4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)
arch/riscv/include/asm/kvm_vcpu_sbi.h +3 -0
index 4278125a38a5..b94c7e958da7 100644
@@ -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__ */
arch/riscv/kvm/vcpu_sbi.c +1 -4
index e52fde504433..c973d92a0ba5 100644
@@ -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