Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7601813rwi; Mon, 24 Oct 2022 17:28:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7gFc4EjWwgvTxtU5vgBlqV8CJvM5vup27dqMwol6Ra/Lvlv6rFT9j9rdSc3vtgnNf/1eJf X-Received: by 2002:a17:906:da85:b0:741:40a7:d08d with SMTP id xh5-20020a170906da8500b0074140a7d08dmr31578217ejb.263.1666657729932; Mon, 24 Oct 2022 17:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666657729; cv=none; d=google.com; s=arc-20160816; b=wj2pfCobeiLWPePPm56CmhjCtEziQBtGcqRGqWl0IluqRXk3h5eW1QEor0V9hfi7oV yPFIDt63gXH8YomIm6WaW0zYGeUGBTxUS/aRNET0TwVc2GpaeYNlpwnn1XTZgLFaVxh0 7S6YdZKYbmWDl7F34n48wm1r/4JJW378t50K7Q+sZku6rkBhpUpfkudlAN6X4x7daxej 4Tn6wTqrPKHoiOQZmbSC8oqxorAKb/PdKn+gdAg6bjLVVvfV//koYcWy6AMRAh4oVa90 crjU0SfFLG5EGXuveS7Ym18IvZ6HduIOirf43vbkc6JccvJu/b4KI6r3D+W7x1wqL7uR uH9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=m+6LJgKl0wRgTRLkq4f9veim6S7HXx9ZKXbkLf1zrmQ=; b=IT2pUMHuHqoMSdAFsW8tqwl8ncF1jB7DeQHv2ppVDs9HbNQ0VL3z97icvSz8AuHbC0 rlT48+W6OJYWRCkBIsO4vkQaeqFlBk1vBp6+10SvSBTP7SkStkvz4whZ/JmAqqBY8UYk NLukEPs04Aa8o6YXQBLXKy3j+6Tl0OlmgPUGbt+uIkLV97X5+c7d2nm2U5ZjZ4cEogKd rdFW5CMQEsbyxpSigPZ749v01nKxbmdLOmLuS7sCWxHghqf1KG1J/yPsObqhcTlYe908 fDTvVCq5AKqGv3TvhyVzUxRYD9YErFwY8Q0DwmTVkmwz4MHOiynPc1uQcbAYg+jvrNqj McMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=qAquYynk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho33-20020a1709070ea100b0079914497afcsi1360150ejc.581.2022.10.24.17.28.24; Mon, 24 Oct 2022 17:28:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=qAquYynk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231272AbiJYAX4 (ORCPT + 99 others); Mon, 24 Oct 2022 20:23:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbiJYAX0 (ORCPT ); Mon, 24 Oct 2022 20:23:26 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80B4812D805 for ; Mon, 24 Oct 2022 15:47:02 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id oo18-20020a17090b1c9200b0020bdba475afso9534960pjb.4 for ; Mon, 24 Oct 2022 15:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=m+6LJgKl0wRgTRLkq4f9veim6S7HXx9ZKXbkLf1zrmQ=; b=qAquYynksnnVrt4f8uMTPnplyMcJL6gGvw6BcX9ETlFFAXWc7XeOmnjigS6Hk0RpJM GkCMlq1TCF5o28LCAPZ/RuFkgTw9BdSBEt+bB7lbM52ppb6/Yt+jFvxxbnjjHWjcSGrh VJskB3Gdm/nLTkw0sS7BvyHSiL7wCAKdIYi1qs0i4ppvBISk+DnFFu00la9g6j+qws5a fU8qzKJnoDartK3Pz7Sv7YvzJnvp7lA8bng0iZ+KH6an/Hg4Yl4gJ+huobq7QOG6AbGZ WqvhLddmwlZqkHd8u97quSJZEYRPRm8j8QMlyLpL1/B134pcwlnlm0jCJiIg82Dgakep hQvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=m+6LJgKl0wRgTRLkq4f9veim6S7HXx9ZKXbkLf1zrmQ=; b=OWN1HgyUXLRXjJH0iRpe51f98cZbyz4R0hiUrqwrONN57n2j5ZK3khVudp1UBHCqof I/u25VoDo4Tm00RpVnuvq2JPUVzRFaveHomoufT0Tk6tGrynwq0l7ddkJza44eZUh9pG h6cX9DxbshXPtD9WL+0tUH2vdBTUEh01MpmFtECrP8iUmwlO1/j1xTRvwiduVNDlH92V 1JEgpbCO9D24wkLAdC/PSZJkBAIeMVoWHnLAn+bGcL/4jbP9dBtKsuP6aal//j+wm4f5 DTDbNE9MEeGUd7Tu1M1/BZ5+1NCL+oVgR9OvnxjoJbFv4+c7V/i9/nZP4qjBGJeMTxoz 6mWA== X-Gm-Message-State: ACrzQf2/XqYMs5A1EBvhxWKa7tOlOIL8TbTaJZsJvlT+1N5a0MG3CthT PwYZmnhlpK5FXnB4XUnYu+jvLVQX4oAV2IIvPZg9oBedoNULzeL1ckhDPaeMA9OIU63GBUZpZ4r 4WS70tGqwaKgh69jTjPw66kecG/CKKwzMcwRfvF89nv41iuW+F94YahCBvg1QwvXXXy0Lxy8DoI H3Bve1peE= X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a17:902:ced0:b0:17f:92d6:f5ec with SMTP id d16-20020a170902ced000b0017f92d6f5ecmr35114513plg.34.1666651622229; Mon, 24 Oct 2022 15:47:02 -0700 (PDT) Date: Mon, 24 Oct 2022 22:46:54 +0000 In-Reply-To: <20221024224657.2917482-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20221024224657.2917482-1-dionnaglaze@google.com> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog Message-ID: <20221024224657.2917482-2-dionnaglaze@google.com> Subject: [PATCH v4 1/4] ccp: Name -1 return value as SEV_RET_NO_FW_CALL From: Dionna Glaze To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Dionna Glaze , Thomas Lendacky , Paolo Bonzini , Joerg Roedel , Ingo Molnar , Andy Lutomirsky Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The PSP can return a "firmware error" code of -1 in circumstances where the PSP is not actually called. To make this protocol unambiguous, we add a constant naming the return value. From: Peter Gonda Cc: Thomas Lendacky Cc: Paolo Bonzini Cc: Joerg Roedel Cc: Ingo Molnar Cc: Andy Lutomirsky Signed-off-by: Dionna Glaze --- drivers/crypto/ccp/sev-dev.c | 2 +- include/uapi/linux/psp-sev.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c index 06fc7156c04f..97eb3544ab36 100644 --- a/drivers/crypto/ccp/sev-dev.c +++ b/drivers/crypto/ccp/sev-dev.c @@ -444,7 +444,7 @@ static int __sev_platform_init_locked(int *error) { struct psp_device *psp = psp_master; struct sev_device *sev; - int rc = 0, psp_ret = -1; + int rc = 0, psp_ret = SEV_RET_NO_FW_CALL; int (*init_function)(int *error); if (!psp || !psp->sev_data) diff --git a/include/uapi/linux/psp-sev.h b/include/uapi/linux/psp-sev.h index 91b4c63d5cbf..fb61e083d42e 100644 --- a/include/uapi/linux/psp-sev.h +++ b/include/uapi/linux/psp-sev.h @@ -36,6 +36,13 @@ enum { * SEV Firmware status code */ typedef enum { + /* + * This error code is not in the SEV spec but is added to convey that + * there was an error that prevented the SEV Firmware from being called. + * This is (u32)-1 since the firmware error code part of EXIT_INFO_2 is + * the lower 32 bits. + */ + SEV_RET_NO_FW_CALL = 0xffffffff, SEV_RET_SUCCESS = 0, SEV_RET_INVALID_PLATFORM_STATE, SEV_RET_INVALID_GUEST_STATE, -- 2.38.0.135.g90850a2211-goog