From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA3A4C433ED for ; Tue, 4 May 2021 12:49:26 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8703861185 for ; Tue, 4 May 2021 12:49:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8703861185 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.122281.230598 (Exim 4.92) (envelope-from ) id 1lduUJ-0005o7-UW; Tue, 04 May 2021 12:49:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 122281.230598; Tue, 04 May 2021 12:49:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lduUJ-0005o0-R0; Tue, 04 May 2021 12:49:19 +0000 Received: by outflank-mailman (input) for mailman id 122281; Tue, 04 May 2021 12:49:17 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lduUH-0005hX-RF for xen-devel@lists.xenproject.org; Tue, 04 May 2021 12:49:17 +0000 Received: from mail-qt1-x82c.google.com (unknown [2607:f8b0:4864:20::82c]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 37a208f9-55da-474d-b809-2c31378d1d2e; Tue, 04 May 2021 12:49:12 +0000 (UTC) Received: by mail-qt1-x82c.google.com with SMTP id o1so6152340qta.1 for ; Tue, 04 May 2021 05:49:12 -0700 (PDT) Received: from pm2-ws13.praxislan02.com ([2001:470:8:67e:92e5:6d58:b544:4daa]) by smtp.gmail.com with ESMTPSA id i11sm2355001qtv.8.2021.05.04.05.49.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 May 2021 05:49:11 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 37a208f9-55da-474d-b809-2c31378d1d2e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mBt899KCzk+1nbxQuHuD9pe5MRuqdb/uNTd34+igWrM=; b=G/Us5UcFLnbOBW2ZxV/xvgiRyKBiZispCo68BGevhBKsXCLZtNTLLTc4oPSfFJalWY hFENro5shnFlNzV5GZ+qEECrYCZDtO74ZZ/Y/iebR9qmVb2biicsJUvFdB6scJn6tcaw 2xuh1FD38bAYlvkqgdyjEG6hvmk1uk90DiDhyjuMuj8FFFNyG0HT/if7yY8dR1tbazYG v/b7PUaMKPyY2DfLi8CK9jLSVU2/yU3vP/QS5O8ZLsel1lYVxxOT5YpxtS1qlWhp3UNA 3mWvvS87E0tKEyFqCNVoZq4bCmtnui3HEmUD7n+eJ93fdAJH2ru32RuUqrS4JV+HtLRC 34zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mBt899KCzk+1nbxQuHuD9pe5MRuqdb/uNTd34+igWrM=; b=t0lpoCK2acfOcG3WWFMBGBnOgTuRc3NETXD8u2H5SlFhz3MHvL0iTc+VEa1lMWu8uK dwP4XfstadKxt2bKt1QvNbWjlpAcVPB69ZM0O/vwrtyjFN9hTDcdWZ/JS5Inh1kBvka7 8TP7wvf+04X3bBJe3IHNPw9igsp7frCBQHc7AGKNoygk8CeWv2b3M2eRabBGn9c60bgw EWO2hDmNs6ptagub92/o+Baw7KYvMEZPN3ImW2EW08wJewmVq99Hg8HJL+rTL+OE68B7 ZJ6CpWTD1ra+kQCHJoSisU8/Obl3TAR2SE7zmyp/Za2Al7lK2eV49K3hXwhALQJTXwjv rH0A== X-Gm-Message-State: AOAM5339/iVnZmc5XtJskGhLq/4+gXqQqkDWXKyCpiF3sLBmvpYBniaJ pADLNyy2I/zAkoDwZhswh/1BQTw+lL4= X-Google-Smtp-Source: ABdhPJwNXWm+uBV0EUqUcW0M49kF1m7xKv8ZVNnfm8ZAL8isMlbC1MwV+wwtOvN2wXOH7wVCTmEQCw== X-Received: by 2002:ac8:5358:: with SMTP id d24mr3180823qto.351.1620132552280; Tue, 04 May 2021 05:49:12 -0700 (PDT) From: Jason Andryuk To: xen-devel@lists.xenproject.org Cc: Jason Andryuk , Daniel De Graaf , Quan Xu , Samuel Thibault Subject: [PATCH 2/9] vtpmmgr: Print error code to aid debugging Date: Tue, 4 May 2021 08:48:35 -0400 Message-Id: <20210504124842.220445-3-jandryuk@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210504124842.220445-1-jandryuk@gmail.com> References: <20210504124842.220445-1-jandryuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit tpm_get_error_name returns "Unknown Error Code" when an error string is not defined. In that case, we should print the Error Code so it can be looked up offline. tpm_get_error_name returns a const string, so just have the two callers always print the error code so it is always available. Signed-off-by: Jason Andryuk --- stubdom/vtpmmgr/tpm.c | 2 +- stubdom/vtpmmgr/tpm2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stubdom/vtpmmgr/tpm.c b/stubdom/vtpmmgr/tpm.c index 779cddd64e..83b2bc16b2 100644 --- a/stubdom/vtpmmgr/tpm.c +++ b/stubdom/vtpmmgr/tpm.c @@ -109,7 +109,7 @@ UINT32 rsp_status; \ UNPACK_OUT(TPM_RSP_HEADER, &rsp_tag, &rsp_len, &rsp_status); \ if (rsp_status != TPM_SUCCESS) { \ - vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(rsp_status)); \ + vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s (%x)\n", tpm_get_error_name(rsp_status), rsp_status); \ status = rsp_status; \ goto abort_egress; \ } \ diff --git a/stubdom/vtpmmgr/tpm2.c b/stubdom/vtpmmgr/tpm2.c index c9f1016ab5..655e6d164c 100644 --- a/stubdom/vtpmmgr/tpm2.c +++ b/stubdom/vtpmmgr/tpm2.c @@ -126,7 +126,7 @@ ptr = unpack_TPM_RSP_HEADER(ptr, \ &(tag), &(paramSize), &(status));\ if ((status) != TPM_SUCCESS){ \ - vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(status));\ + vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s (%x)\n", tpm_get_error_name(status), (status));\ goto abort_egress;\ }\ } while(0) -- 2.30.2