Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4293752pxb; Tue, 2 Nov 2021 07:24:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVXbH5iM6QDs43tq3QlD/IwzjmAcrq9v6A2n5xU1Pw0vZfH+knxkS7A7P51Uof+B0sLrK9 X-Received: by 2002:a05:6e02:1c0c:: with SMTP id l12mr17816776ilh.84.1635863043035; Tue, 02 Nov 2021 07:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635863043; cv=none; d=google.com; s=arc-20160816; b=AXvkVojbIQzaV9yDqViD7lEN7SxLyzxW1zXy7LfTRkiG8ltVgQyrP7Iz2kqa4A1Kq5 xYIttXzxiUGTvtv6QVutT6zEx8X9a6COOxiRwJoh0QkRe55a6m/I+S/HW18XtLH2cM0R 7yLaqYUoqyE3aOtjCfeXJGi1ShEHaz5a8HHqLS0v6tDPkLttJGBb/ZfDDgrwT7vxcnHz Z1kr9X2Z3wreoIpGR52n8q3VH1Oj4qEhc16FqHQ7J9MhsFbh74b1+dUmlkkrDbcPh2ZH WK1Wzf2p49FBg+swjc+d3PjUGuNsfFmvdCDGr9EPm1CM2P9dWWETI12JAupUVo3Oc0c+ ARaw== 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:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=u6e4WOpk0Gy7k+VMHluWLZb26ejBKbKlf2/TYAs8po4=; b=nAdSXM/bqdFuQAI3QKcJbVW847jyGwa2xNHdq5DCedgVApzRueBxZT6uvYHKzUv/RX gjVig1XLg/OqSBMUrYnkGFZuE85Wr9niE2VZy1bAFIm+4CBp/OqtMr8rvDo1sr5IsH2d m6DB6/D2jBQqf5LNokQWeSwQ1hAcMR9J1cmj6NSWhlXkHxLRmgwL8o2r8W5wcWdbMRpN hfzumUt+UnK6rCV6jgPFVE2NVMoEp98Xa9j1C642dLUFzcWvzl+ddI8/4eNbRQvtNoYz yaLUr+tbpYUxsEoDYBHiWbXLmQp3WKRldW7Uw2Rh6XqEemzlFW5FtehvoHZQFWf2ZhK3 YZOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=XTjOStoK; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si19215730jad.37.2021.11.02.07.23.49; Tue, 02 Nov 2021 07:24:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=XTjOStoK; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 S231366AbhKBO0T (ORCPT + 99 others); Tue, 2 Nov 2021 10:26:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231219AbhKBO0K (ORCPT ); Tue, 2 Nov 2021 10:26:10 -0400 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53CC7C061767 for ; Tue, 2 Nov 2021 07:23:35 -0700 (PDT) Received: by mail-pf1-x449.google.com with SMTP id u15-20020a62790f000000b004802fdd141dso6489581pfc.17 for ; Tue, 02 Nov 2021 07:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=u6e4WOpk0Gy7k+VMHluWLZb26ejBKbKlf2/TYAs8po4=; b=XTjOStoKg0N6wfHaH3SzwOZID8vIMWONfnqf8lYJCeqJ2EiS/S6Hjq9ofmqln9P1EW MK6wB0SISa52PPpwF3WyGEILcviw4Z0TwMyEQrlVTMOaVOjyuefpxn/Vxl2xiQeeqdMM pH2QT1EO5clygoA7+wugYZ3pXkf/+US8wCMqYVEUr0K6OYhxXCUJFROEifzwNUn5dER3 5tJFFhG6Zm6vw97ArYpj+vh0MiEv4qpk/T4sZcpYpITGMDjIaHL9lFveEqUM5b4vk1d2 qmX1RaK3+SrFEsb0SqRiIMtBcoqLQsqhm5Mn69bzHtfNtn7gOSHj8C55GJ0+W6ZeMu1+ zfSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=u6e4WOpk0Gy7k+VMHluWLZb26ejBKbKlf2/TYAs8po4=; b=auFFxaSnY5OuvTTIjdjG+dxpzJLWwDtN1wnhol1LiK/qIJxMbRz/1CpYSxCqh/UlkJ JwdUMeznIPbqHUGOKFCEaTKTrWvaVU2uvDfHzlc2ytXwa6bZRUhS8Av8QAB4MN/cjPTm gdGlobr3PCPd49cuSM6KekPZU1AMFDhvrWnd3CCUj++52yEPgXbTcCcywCFAfWExWihT TobKZ3DoytNjpso9PhYVPRbV207wy69qS7ktUiXO1pG0E/AU8DSXJ2y3M8QCAoMFk3Vw mDwpvJV76B6Qcm30Xk0//Qm6ix7UGg1NsAPk0/x8JKwMzJ9uov8KCk91D7RzDFiwMf0m lm5g== X-Gm-Message-State: AOAM5324ACRhXvndHyf+dHoi038X7H0WJ27s8yTK+HKSbuiDIZ2mhZ36 EnFSXTZlbCeqIvOsSEukiXrgRBQ0tUU= X-Received: from pgonda1.kir.corp.google.com ([2620:15c:29:204:3109:8497:f59d:9150]) (user=pgonda job=sendgmr) by 2002:a17:902:9694:b0:141:ea16:aecb with SMTP id n20-20020a170902969400b00141ea16aecbmr12630734plp.62.1635863014799; Tue, 02 Nov 2021 07:23:34 -0700 (PDT) Date: Tue, 2 Nov 2021 07:23:28 -0700 In-Reply-To: <20211102142331.3753798-1-pgonda@google.com> Message-Id: <20211102142331.3753798-2-pgonda@google.com> Mime-Version: 1.0 References: <20211102142331.3753798-1-pgonda@google.com> X-Mailer: git-send-email 2.33.1.1089.g2158813163f-goog Subject: [PATCH V3 1/4] crypto: ccp - Fix SEV_INIT error logging on init From: Peter Gonda To: thomas.lendacky@amd.com Cc: Peter Gonda , Marc Orr , David Rientjes , Brijesh Singh , Joerg Roedel , Herbert Xu , John Allen , "David S. Miller" , Paolo Bonzini , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Currently only the firmware error code is printed. This is incomplete and also incorrect as error cases exists where the firmware is never called and therefore does not set an error code. This change zeros the firmware error code in case the call does not get that far and prints the return code for non firmware errors. Signed-off-by: Peter Gonda Reviewed-by: Marc Orr Acked-by: David Rientjes Acked-by: Tom Lendacky Cc: Tom Lendacky Cc: Brijesh Singh Cc: Marc Orr Cc: Joerg Roedel Cc: Herbert Xu Cc: David Rientjes Cc: John Allen Cc: "David S. Miller" Cc: Paolo Bonzini Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/crypto/ccp/sev-dev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c index 2ecb0e1f65d8..ec89a82ba267 100644 --- a/drivers/crypto/ccp/sev-dev.c +++ b/drivers/crypto/ccp/sev-dev.c @@ -1065,7 +1065,7 @@ void sev_pci_init(void) { struct sev_device *sev = psp_master->sev_data; struct page *tmr_page; - int error, rc; + int error = 0, rc; if (!sev) return; @@ -1104,7 +1104,8 @@ void sev_pci_init(void) } if (rc) { - dev_err(sev->dev, "SEV: failed to INIT error %#x\n", error); + dev_err(sev->dev, "SEV: failed to INIT error %#x, rc %d\n", + error, rc); return; } -- 2.33.1.1089.g2158813163f-goog