lkml.org 
[lkml]   [2023]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v4 05/14] RISC-V: KVM: Return correct code for hsm stop function
    On Wed, Feb 01, 2023 at 03:12:41PM -0800, Atish Patra wrote:
    > 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>
    > Signed-off-by: Atish Patra <atishp@rivosinc.com>
    > ---
    > arch/riscv/kvm/vcpu_sbi_hsm.c | 2 +-
    > 1 file changed, 1 insertion(+), 1 deletion(-)
    >
    > diff --git a/arch/riscv/kvm/vcpu_sbi_hsm.c b/arch/riscv/kvm/vcpu_sbi_hsm.c
    > index 2e915ca..619ac0f 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);
    >
    > --
    > 2.25.1
    >

    Reviewed-by: Andrew Jones <ajones@ventanamicro.com>

    \
     
     \ /
      Last update: 2023-03-27 00:07    [W:5.512 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site