Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3010943rwi; Fri, 21 Oct 2022 10:21:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6LDsMaNT5j0Aqq7fM7do/3ubtK8XBkZ5EOfZdVcO/4JooTPuiq07BNzNQEPhrp7C9Rc7/+ X-Received: by 2002:a05:6402:278d:b0:461:60d4:8ea4 with SMTP id b13-20020a056402278d00b0046160d48ea4mr1507208ede.419.1666372894694; Fri, 21 Oct 2022 10:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666372894; cv=none; d=google.com; s=arc-20160816; b=sUIJvkvzbIj6Sr8cpBj7DR5iUXQFKbgR3b4ITZOM3UHXHA/+/edGoTG4nKMUKyffb9 z+G+rOe8a51TKZ2fFNDvCtboI3/0wZ2oBLaZGOJUwNuMOMrtB33vt7D8rM4fGE72Tzix yi+yoZff9V7JfiLBHk3ngtOEgDoo9t2pdl4GWFEkNHMCu8FYw+BAQhBTKCmVCAld/S9X TQrg8V3t8jnAM+UzZMbwvL5iCBQthnbhTOuUe5bb/utXsX9mk3Fck270b4EpACIAaNVt 9AlyMxFmY1cRiZk3wOrDfmGX6X6wPsAtct/QtDaL5kvScBgdIkq6CrBY+qVuopavrUCc 9fiA== 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=ofAZys3+An7tmgaGUjtoV9RVkLm1YTmfXyVjG3+qekF7+YbF7hJyZ4mM7vYRNa4UYi UeSiOi0C/0YV96F2wbyZ7n+rh3vKgWdEOw0hDQegarrQ7LTrU6AoHjffwHY5ckk2Jn79 zM/lulAks5bCv1qILpINhgm3UGHmMLBnveNfd4DeOg228VTCpmjbtmmfDMELB3X1RKqu zDdbQNNXyJaCUzcZEhAB+H5vAlMKUCP26NKTm8k7sEeU3+qQaZ2FtgblEEGcTE6Pm3KX JqbHlrSzzx7riWiPeBtSSI86+dthRF0JHu9g7cZYKoDcPW5ZYQ4wmFtOCumulXwon5V5 HHjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=IAUiu92e; 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 hv12-20020a17090760cc00b00780e89ce0b0si21361961ejc.600.2022.10.21.10.21.08; Fri, 21 Oct 2022 10:21:34 -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=IAUiu92e; 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 S229802AbiJURAH (ORCPT + 99 others); Fri, 21 Oct 2022 13:00:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbiJURAE (ORCPT ); Fri, 21 Oct 2022 13:00:04 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F6D2558C5 for ; Fri, 21 Oct 2022 09:59:52 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-367dc159c2fso34348827b3.19 for ; Fri, 21 Oct 2022 09:59:51 -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=IAUiu92eRZoXbbSs2RkIa1od4MS2ZKai3lK1I9O75aKToczZ/VnpZ5z1vxJPMa/GkC 0lZR6s0KSFCVAgw42q/iyvA+kgH4bPDygEOtwmVRuTsGKEsMBFRUYetzcXtvMGluFGsl oIRPkUIp+AaAMleOZpYIYm4+q9lNnERRe31K2FGn/prPllHO4BM6VzlqX/JTedIRXn/g TVsFJnaJx3ZF69jFYpZyw6YK4mL41IWE/4P1ddXk2c0qHtRj8j6fw0AoQdrvpaI34rP4 WL66+HcMTo/T5w05qnW0jiXQlTMkXwyTHlgJbbqfWCuOFHRFxD2mQpcOSJyBL1gCfEvx C27w== 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=yp8szvCtnWYMUUFBitjJAtlpaXCt9sLFXDFHyTJNLXO71il5RPh7bR78t+IM+FWeej QG7lXqUow7WpQgwWTgbz+7TRGORVjRsdBzTX1xwELWY9oLteOhZPm31/qDMV/hC1Y8Sj CcxMaatZ4+YBW2l55TTQKZoKk491E4zrYc6I9uHL8qNgnuYxPvTBVcZsh2kkiOXWBqLZ Ua65z3tg9FBkl8egnV5eBmsHSGXwQ9mO8CzvA6D/Su+x4LdR6qLQFlfmvttWAC5NRyF8 Tr5n83KS+5aJscu5eLI0oM9dUY9xEnUd3ng7xEywjnnbyA88Tckhx0GK36xRQ2IrCKPK Uq6w== X-Gm-Message-State: ACrzQf1kHqhRBOqQvL7/RQzKc1wt1dnb0tSbqyughu4DUZSGF7JPdNno TnejQSjzCJk8cXxEqJ25AGYcbLNJ9YviGJc60Ipikov+ADQ99g3hZifOgP9KynXpk2V2L7LAewE VF9WJZMWgs+GAenwCHblRFWS0sfCnAcxPiSKmuz7HjKRz+SMzkyV6CSu9U5mdEYg0NdMXtpi4Ot 6OOIe/X9g= X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a25:be14:0:b0:6be:885f:20bb with SMTP id h20-20020a25be14000000b006be885f20bbmr17567487ybk.480.1666371590674; Fri, 21 Oct 2022 09:59:50 -0700 (PDT) Date: Fri, 21 Oct 2022 16:59:40 +0000 In-Reply-To: <20221021165943.1968044-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20221021165943.1968044-1-dionnaglaze@google.com> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog Message-ID: <20221021165943.1968044-2-dionnaglaze@google.com> Subject: [PATCH v3 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