[PATCH v3 8/9] KVM: riscv: selftests: Change vcpu_has_ext to a common function