[PATCH v6 18/24] KVM: riscv: selftests: Add helper functions for extension checks