[kvm-unit-tests PATCH 2/2] riscv: sbi: Test remaining base functions

Carlos Maiolino cmaiolino at redhat.com
Fri Mar 15 09:20:01 PDT 2024


On Fri, Mar 15, 2024 at 02:32:47PM +0100, Andrew Jones wrote:
> Add the two remaining base extension functions to the base test.
> 
> Signed-off-by: Andrew Jones <ajones at ventanamicro.com>
> ---
>  riscv/sbi.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/riscv/sbi.c b/riscv/sbi.c
> index 707ce8dd1c57..762e9711c35a 100644
> --- a/riscv/sbi.c
> +++ b/riscv/sbi.c
> @@ -71,6 +71,14 @@ static void check_base(void)
>  	}
>  	report_prefix_pop();

Reviewed-by: Carlos Maiolino <cmaiolino at redhat.com>

>  
> +	report_prefix_push("impl_version");
> +	if (env_or_skip("IMPL_VERSION")) {
> +		expected = strtol(getenv("IMPL_VERSION"), NULL, 0);
> +		ret = __base_sbi_ecall(SBI_EXT_BASE_GET_IMP_VERSION, 0);
> +		gen_report(&ret, 0, expected);
> +	}
> +	report_prefix_pop();
> +
>  	report_prefix_push("probe_ext");
>  	expected = getenv("PROBE_EXT") ? strtol(getenv("PROBE_EXT"), NULL, 0) : 1;
>  	ret = __base_sbi_ecall(SBI_EXT_BASE_PROBE_EXT, SBI_EXT_BASE);
> @@ -93,6 +101,14 @@ static void check_base(void)
>  	}
>  	report_prefix_pop();
>  
> +	report_prefix_push("mimpid");
> +	if (env_or_skip("MIMPID")) {
> +		expected = strtol(getenv("MIMPID"), NULL, 0);
> +		ret = __base_sbi_ecall(SBI_EXT_BASE_GET_MIMPID, 0);
> +		gen_report(&ret, 0, expected);
> +	}
> +	report_prefix_pop();
> +
>  	report_prefix_pop();
>  }
>  
> -- 
> 2.44.0
> 




More information about the kvm-riscv mailing list