RISC-V: KVM: do not EOPNOTSUPP in set KVM_REG_RISCV_TIMER_REG
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>
Thu, 3 Aug 2023 16:32:56 +0000 (13:32 -0300)
committerAnup Patel <anup@brainfault.org>
Tue, 8 Aug 2023 11:55:49 +0000 (17:25 +0530)
commit432a8b35cc23d3af9c60e9c0d191d7ff737afbdc
treeeec28a0810e31ea3e9575d8517091ceae6884ebf
parente29f57911d61bcbbe442c72933c606225d3d4d68
RISC-V: KVM: do not EOPNOTSUPP in set KVM_REG_RISCV_TIMER_REG

The KVM_REG_RISCV_TIMER_REG can be read via get_one_reg(). But trying to
write anything in this reg via set_one_reg() results in an EOPNOTSUPP.

Change the API to behave like cbom_block_size: instead of always
erroring out with EOPNOTSUPP, allow userspace to write the same value
(riscv_timebase) back, throwing an EINVAL if a different value is
attempted.

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/kvm/vcpu_timer.c