|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 3/3] xen/riscv: add RISC-V virtual SBI base extension support for guests
On 12/18/25 3:32 PM, Jan Beulich wrote: On 17.12.2025 17:54, Oleksii Kurochko wrote:--- a/xen/arch/riscv/include/asm/sbi.h +++ b/xen/arch/riscv/include/asm/sbi.h @@ -14,6 +14,10 @@#include <xen/cpumask.h> +#define XEN_SBI_VER_MAJOR 0+#define XEN_SBI_VER_MINOR 2 +#define XEN_SBI_IMPID 7Are these numbers part of the spec (sorry, lack of a reference makes me wonder, plus if that were the case, I'd kind of expect the names to be SBI_XEN_..., not XEN_SBI_...)? XEN_SBI_IMPID is a number defined by the SBI specification: https://github.com/riscv-non-isa/riscv-sbi-doc/blob/master/src/ext-base.adoc#sbi-implementation-ids XEN_SBI_VER_MAJOR and XEN_SBI_VER_MINOR somehow also is a part of the spec, there is no such defines explicitly, but it is real numbers of the SBI version. I will rename the defines accordingly: - s/XEN_SBI_VER_MAJOR/SBI_XEN_VER_MAJOR - s/XEN_SBI_VER_MINOR/SBI_XEN_VER_MINOR - s/XEN_SBI_IMPID/SBI_XEN_IMPID
I would say that we are free to use an arbitrary layout. The specification says: The encoding of this version number is specific to the SBI implementation. (https://github.com/riscv-non-isa/riscv-sbi-doc/blob/master/src/ext-base.adoc#function-get-sbi-implementation-version-fid-2) So this fully depends on how a specific SBI implementation decides to encode the version. For Xen, I simply copied the approach used by OpenSBI: /** * OpenSBI 32-bit version with: * 1. upper 16-bits as major number * 2. lower 16-bits as minor number */ #define OPENSBI_VERSION ((OPENSBI_VERSION_MAJOR << 16) | \ (OPENSBI_VERSION_MINOR)) Therefore, I think it is fine to keep Xen’s implementation as it is now, without introducing additional defines. Thanks. ~ Oleksii
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |