[PATCH v5 15/22] RISC-V: KVM: Improve firmware counter read function