[PATCH v2 7/8] KVM: riscv: selftest: Change vcpu_has_ext to a common function