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