Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86B31C27C76 for ; Sat, 28 Jan 2023 14:52:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233971AbjA1Owu (ORCPT ); Sat, 28 Jan 2023 09:52:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231168AbjA1Owq (ORCPT ); Sat, 28 Jan 2023 09:52:46 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 572E6172B for ; Sat, 28 Jan 2023 06:52:45 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id g11so7129651eda.12 for ; Sat, 28 Jan 2023 06:52:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ijLxm1lKEfZs0IZlgOOAhHSKYX5QLiE4GGhNuEVcGng=; b=frQzbI8stra8ftvJmg/B4t7HWCvM9FnezzFATdbngE0HpGmiaL/TjPJIoSbNZ9A4VT TmqVpwwgbl9nEk931XnNjrIWQzD1UcenOwzz7GqmOsjVO7BYYbBpkzFJDhcxKpiEcTCX uzi6RWK9H2QU/hsKU3ApOaN/zDfb2Lmd4qhQ3vml3oB7T8z+VRPoQ2XASr0au1Tc8krm w/KeidcDztQFgvdZPPr37O235osye7NaYMTydT7lZdmtqzkxHCll2ApdWqQt9MGreTMW vXqptBUC9RS0RSP6flDXsebDs2Zk+3yAUrJhs3OYKD7CWrVsMAGNeuQ4LUaQCZyYZ+kN hU7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ijLxm1lKEfZs0IZlgOOAhHSKYX5QLiE4GGhNuEVcGng=; b=zyZtwGvsedfCggNuEloXLeS1ou2ULCrEaj73Jg7HzG9mOEZc01dezYkTfj39/dWPTm j66gwsUMV+877s7hcMiCDvOkGprgqfXmOyhsMAJbu87O76mUyk3SjBudXto/VUI0GAt8 VTN2ZJ6o3rg7xz2bU8WiAZYjwMHZyeEBDn6UtvRTnEjXgy9p/Lwmkq6JxAzncCCP1He1 +lcY1a5fD6PsYo37PER6rKPKwBzcv8sufpQHKyUkP+PBX7zIYpCMrODJLKQ5UQ0Ei50e 55akSkg/5fWAUq9a6KyRyqUk1pr21iqgtKbVKs7vVKHcp9Sn7EqPrqeApg7xbE3hMxiT xYbg== X-Gm-Message-State: AFqh2koV7VYTsyS4pbW3Yyl/mz2UlufCnUAlgfJi3RcGv7vbdSMaZ90n qnOivcZcbM2Fn0/ExMqWH0zJoHgVPoHaApqXFvVaHA== X-Google-Smtp-Source: AMrXdXse7F8M1Kedc0Z1csa7K5rxc5NJv1iWBhk3K9TBNTVIFbV/IBRgCuYscAaDKH70PcJaPWPHOuAgkp3YkwYEPNY= X-Received: by 2002:a05:6402:1008:b0:499:f0f:f788 with SMTP id c8-20020a056402100800b004990f0ff788mr7501420edu.25.1674917563804; Sat, 28 Jan 2023 06:52:43 -0800 (PST) MIME-Version: 1.0 References: <20230127182558.2416400-1-atishp@rivosinc.com> <20230127182558.2416400-6-atishp@rivosinc.com> In-Reply-To: <20230127182558.2416400-6-atishp@rivosinc.com> From: Anup Patel Date: Sat, 28 Jan 2023 20:22:31 +0530 Message-ID: Subject: Re: [PATCH v3 05/14] RISC-V: KVM: Return correct code for hsm stop function To: Atish Patra Cc: linux-kernel@vger.kernel.org, Andrew Jones , Atish Patra , Guo Ren , Heiko Stuebner , kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-riscv@lists.infradead.org, Mark Rutland , Palmer Dabbelt , Paul Walmsley , Sergey Matyukevich , Will Deacon Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 27, 2023 at 11:56 PM 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. > > Signed-off-by: Atish Patra Looks good to me. Reviewed-by: Anup Patel Regards, Anup > --- > 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 >