Message ID | 20241017074538.18867-6-ajones@ventanamicro.com |
---|---|
State | Accepted |
Headers | show |
Series | RISC-V: KVM: SBI system suspend support | expand |
On Thu, Oct 17, 2024 at 1:15 PM Andrew Jones <ajones@ventanamicro.com> wrote: > > KVM supports SBI SUSP, so add it to the get-reg-list test. > > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> LGTM. Reviewed-by: Anup Patel <anup@brainfault.org> Regards, Anup > --- > tools/testing/selftests/kvm/riscv/get-reg-list.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/tools/testing/selftests/kvm/riscv/get-reg-list.c > index 8e34f7fa44e9..7c33556ed59d 100644 > --- a/tools/testing/selftests/kvm/riscv/get-reg-list.c > +++ b/tools/testing/selftests/kvm/riscv/get-reg-list.c > @@ -108,6 +108,7 @@ bool filter_reg(__u64 reg) > case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_HSM: > case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_PMU: > case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_DBCN: > + case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_SUSP: > case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_STA: > case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_EXPERIMENTAL: > case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_VENDOR: > @@ -527,10 +528,11 @@ static const char *sbi_ext_single_id_to_str(__u64 reg_off) > KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_SRST), > KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_HSM), > KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_PMU), > + KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_DBCN), > + KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_SUSP), > KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_STA), > KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_EXPERIMENTAL), > KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_VENDOR), > - KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_DBCN), > }; > > if (reg_off >= ARRAY_SIZE(kvm_sbi_ext_reg_name)) > @@ -941,6 +943,7 @@ KVM_SBI_EXT_SUBLIST_CONFIG(base, BASE); > KVM_SBI_EXT_SUBLIST_CONFIG(sta, STA); > KVM_SBI_EXT_SIMPLE_CONFIG(pmu, PMU); > KVM_SBI_EXT_SIMPLE_CONFIG(dbcn, DBCN); > +KVM_SBI_EXT_SIMPLE_CONFIG(susp, SUSP); > > KVM_ISA_EXT_SUBLIST_CONFIG(aia, AIA); > KVM_ISA_EXT_SUBLIST_CONFIG(fp_f, FP_F); > @@ -1005,6 +1008,7 @@ struct vcpu_reg_list *vcpu_configs[] = { > &config_sbi_sta, > &config_sbi_pmu, > &config_sbi_dbcn, > + &config_sbi_susp, > &config_aia, > &config_fp_f, > &config_fp_d, > -- > 2.46.2 >
diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/tools/testing/selftests/kvm/riscv/get-reg-list.c index 8e34f7fa44e9..7c33556ed59d 100644 --- a/tools/testing/selftests/kvm/riscv/get-reg-list.c +++ b/tools/testing/selftests/kvm/riscv/get-reg-list.c @@ -108,6 +108,7 @@ bool filter_reg(__u64 reg) case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_HSM: case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_PMU: case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_DBCN: + case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_SUSP: case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_STA: case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_EXPERIMENTAL: case KVM_REG_RISCV_SBI_EXT | KVM_REG_RISCV_SBI_SINGLE | KVM_RISCV_SBI_EXT_VENDOR: @@ -527,10 +528,11 @@ static const char *sbi_ext_single_id_to_str(__u64 reg_off) KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_SRST), KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_HSM), KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_PMU), + KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_DBCN), + KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_SUSP), KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_STA), KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_EXPERIMENTAL), KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_VENDOR), - KVM_SBI_EXT_ARR(KVM_RISCV_SBI_EXT_DBCN), }; if (reg_off >= ARRAY_SIZE(kvm_sbi_ext_reg_name)) @@ -941,6 +943,7 @@ KVM_SBI_EXT_SUBLIST_CONFIG(base, BASE); KVM_SBI_EXT_SUBLIST_CONFIG(sta, STA); KVM_SBI_EXT_SIMPLE_CONFIG(pmu, PMU); KVM_SBI_EXT_SIMPLE_CONFIG(dbcn, DBCN); +KVM_SBI_EXT_SIMPLE_CONFIG(susp, SUSP); KVM_ISA_EXT_SUBLIST_CONFIG(aia, AIA); KVM_ISA_EXT_SUBLIST_CONFIG(fp_f, FP_F); @@ -1005,6 +1008,7 @@ struct vcpu_reg_list *vcpu_configs[] = { &config_sbi_sta, &config_sbi_pmu, &config_sbi_dbcn, + &config_sbi_susp, &config_aia, &config_fp_f, &config_fp_d,
KVM supports SBI SUSP, so add it to the get-reg-list test. Signed-off-by: Andrew Jones <ajones@ventanamicro.com> --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)