diff options
author | Atish Patra <atishp@rivosinc.com> | 2023-02-05 04:15:06 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2023-02-07 18:05:43 +0300 |
commit | 8cdb8a53857d54fbbabad2593c3c841836e990a9 (patch) | |
tree | 6d174f4ce257c29f7af34928b41821d81a07e493 | |
parent | 026bac4574b5da5aa8715bf60584679fa269eb14 (diff) | |
download | linux-8cdb8a53857d54fbbabad2593c3c841836e990a9.tar.xz |
RISC-V: KVM: Return correct code for hsm stop function
According to the SBI specification, the stop function can only
return error code SBI_ERR_FAILED. However, currently it returns
-EINVAL which will be mapped SBI_ERR_INVALID_PARAM.
Return an linux error code that maps to SBI_ERR_FAILED i.e doesn't map
to any other SBI error code. While EACCES is not the best error code
to describe the situation, it is close enough and will be replaced
with SBI error codes directly anyways.
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
-rw-r--r-- | arch/riscv/kvm/vcpu_sbi_hsm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/kvm/vcpu_sbi_hsm.c b/arch/riscv/kvm/vcpu_sbi_hsm.c index 2e915cafd551..619ac0ff17dc 100644 --- a/arch/riscv/kvm/vcpu_sbi_hsm.c +++ b/arch/riscv/kvm/vcpu_sbi_hsm.c @@ -42,7 +42,7 @@ static int kvm_sbi_hsm_vcpu_start(struct kvm_vcpu *vcpu) static int kvm_sbi_hsm_vcpu_stop(struct kvm_vcpu *vcpu) { if (vcpu->arch.power_off) - return -EINVAL; + return -EACCES; kvm_riscv_vcpu_power_off(vcpu); |