Skip to contentSkip to conversation

RISC-V: KVM: Fix SBI implementation version

PATCH In review Anup Patel 2 participants 2 messages Jan 31, 2022 – Feb 2, 2022

Subsystems (3)
lore
Share & tools
lore

Anup Patel

author
#0 lore raw

PATCH 1/1 RISC-V: KVM: Fix SBI implementation version

The SBI implementation version returned by KVM RISC-V should be the Host Linux version code.

Fixes c62a76859723 ("RISC-V: KVM: Add SBI v0.2 base extension")
---
 arch/riscv/kvm/vcpu_sbi_base.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/riscv/kvm/vcpu_sbi_base.c +2 -1
index 4ecf377f483b..48f431091cdb 100644
@@ -9,6 +9,7 @@
 #include <linux/errno.h>
 #include <linux/err.h>
 #include <linux/kvm_host.h>
+#include <linux/version.h>
 #include <asm/csr.h>
 #include <asm/sbi.h>
 #include <asm/kvm_vcpu_timer.h>
@@ -32,7 +33,7 @@ static int kvm_sbi_ext_base_handler(struct kvm_vcpu *vcpu, struct kvm_run *run,
 		*out_val = KVM_SBI_IMPID;
 		break;
 	case SBI_EXT_BASE_GET_IMP_VERSION:
-		*out_val = 0;
+		*out_val = LINUX_VERSION_CODE;
 		break;
 	case SBI_EXT_BASE_PROBE_EXT:
 		if ((cp->a0 >= SBI_EXT_EXPERIMENTAL_START &&
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 6 lines · Anup Patel

The SBI implementation version returned by KVM RISC-V should be the Host Linux version code.

Fixes c62a76859723 ("RISC-V: KVM: Add SBI v0.2 base extension")

Thanks, I have queued this for fixes.

Regards,
Anup

Quoted 28 lines
---
 arch/riscv/kvm/vcpu_sbi_base.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/riscv/kvm/vcpu_sbi_base.c +2 -2
index 4ecf377f483b..48f431091cdb 100644
@@ -9,6 +9,7 @@
 #include <linux/errno.h>
 #include <linux/err.h>
 #include <linux/kvm_host.h>
+#include <linux/version.h>
 #include <asm/csr.h>
 #include <asm/sbi.h>
 #include <asm/kvm_vcpu_timer.h>
@@ -32,7 +33,7 @@ static int kvm_sbi_ext_base_handler(struct kvm_vcpu *vcpu, struct kvm_run *run,
                *out_val = KVM_SBI_IMPID;
                break;
        case SBI_EXT_BASE_GET_IMP_VERSION:
-               *out_val = 0;
+               *out_val = LINUX_VERSION_CODE;
                break;
        case SBI_EXT_BASE_PROBE_EXT:
                if ((cp->a0 >= SBI_EXT_EXPERIMENTAL_START &&
--

2.25.1