summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhorne <mhorne@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>2020-12-18 20:10:30 +0000
committermhorne <mhorne@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>2020-12-18 20:10:30 +0000
commit6fa1999162bf0673eccd0ea320cc276fceda4dc4 (patch)
tree8cfd7e497833fb1b5d2d85853d83a69fcac59263
parent514da7bcb9de4f32ebce7a5fbb7393dc709cf34a (diff)
downloadfreebsd-6fa1999162bf0673eccd0ea320cc276fceda4dc4.tar.gz
freebsd-6fa1999162bf0673eccd0ea320cc276fceda4dc4.tar.bz2
riscv: report additional known SBI implementations
These implementation IDs are defined in the SBI spec, so we should print their name if detected. Submitted by: Danjel Qyteza <danq1222@gmail.com> Reviewed by: jhb, kp Differential Revision: https://reviews.freebsd.org/D27660 git-svn-id: http://svn.freebsd.org/base/head@368767 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
-rw-r--r--sys/riscv/include/sbi.h4
-rw-r--r--sys/riscv/riscv/sbi.c12
2 files changed, 16 insertions, 0 deletions
diff --git a/sys/riscv/include/sbi.h b/sys/riscv/include/sbi.h
index 9458d242456..50cacb3e6e5 100644
--- a/sys/riscv/include/sbi.h
+++ b/sys/riscv/include/sbi.h
@@ -47,6 +47,10 @@
/* SBI Implementation IDs */
#define SBI_IMPL_ID_BBL 0
#define SBI_IMPL_ID_OPENSBI 1
+#define SBI_IMPL_ID_XVISOR 2
+#define SBI_IMPL_ID_KVM 3
+#define SBI_IMPL_ID_RUSTSBI 4
+#define SBI_IMPL_ID_DIOSIX 5
/* SBI Error Codes */
#define SBI_SUCCESS 0
diff --git a/sys/riscv/riscv/sbi.c b/sys/riscv/riscv/sbi.c
index 2727cfc9f47..d529d2d0835 100644
--- a/sys/riscv/riscv/sbi.c
+++ b/sys/riscv/riscv/sbi.c
@@ -110,6 +110,18 @@ sbi_print_version(void)
case (SBI_IMPL_ID_BBL):
printf("SBI: Berkely Boot Loader %lu\n", sbi_impl_version);
break;
+ case (SBI_IMPL_ID_XVISOR):
+ printf("SBI: eXtensible Versatile hypervISOR %lu\n", sbi_impl_version);
+ break;
+ case (SBI_IMPL_ID_KVM):
+ printf("SBI: Kernel-based Virtual Machine %lu\n", sbi_impl_version);
+ break;
+ case (SBI_IMPL_ID_RUSTSBI):
+ printf("SBI: RustSBI %lu\n", sbi_impl_version);
+ break;
+ case (SBI_IMPL_ID_DIOSIX):
+ printf("SBI: Diosix %lu\n", sbi_impl_version);
+ break;
case (SBI_IMPL_ID_OPENSBI):
major = sbi_impl_version >> OPENSBI_VERSION_MAJOR_OFFSET;
minor = sbi_impl_version & OPENSBI_VERSION_MINOR_MASK;