From patchwork Thu May 6 13:59:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Andryuk X-Patchwork-Id: 12242185 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 40BCBC433ED for ; Thu, 6 May 2021 14:00:25 +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 DC789610FC for ; Thu, 6 May 2021 14:00:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC789610FC 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.123539.233036 (Exim 4.92) (envelope-from ) id 1leeY5-0006Yi-SD; Thu, 06 May 2021 14:00:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 123539.233036; Thu, 06 May 2021 14:00:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1leeY5-0006YV-P3; Thu, 06 May 2021 14:00:17 +0000 Received: by outflank-mailman (input) for mailman id 123539; Thu, 06 May 2021 14:00:15 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1leeY3-0003iB-Ni for xen-devel@lists.xenproject.org; Thu, 06 May 2021 14:00:15 +0000 Received: from mail-qk1-x72c.google.com (unknown [2607:f8b0:4864:20::72c]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7f2b0a8a-1094-4fc4-b780-cb8eb8f45673; Thu, 06 May 2021 13:59:59 +0000 (UTC) Received: by mail-qk1-x72c.google.com with SMTP id x8so4970604qkl.2 for ; Thu, 06 May 2021 06:59:59 -0700 (PDT) Received: from pm2-ws13.praxislan02.com ([2001:470:8:67e:6095:81da:832e:3929]) by smtp.gmail.com with ESMTPSA id 189sm2069992qkh.99.2021.05.06.06.59.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 06:59:58 -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: 7f2b0a8a-1094-4fc4-b780-cb8eb8f45673 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=jlS7YCsZWAJRCh7VQeSElH9c4MLj2HkvcGmj37dX+gg=; b=pVdEJP/iDrGELOtr9qRnBVOIPZ2ZN0l0ZfloCS2HRZitIANAaey0IPnF7UmqjLIn96 n/JRq1SY5EL/IBGqmnbMFmSx/QWGztcQle9WuuUrSG+BYWRzpZUdxmV3QHR8hnGfbv// Ije3dTarTSN0P+MyqQ4/EE+KKcrfzzZBZPb8JGfjOk7LxYam3vXT8WnN7h2GIv0ulPSa YwGlJoaSSHzoCBFDdTVzVcOl2lKURv4aLZOM7AaagnwNM6E4jKxJ0F8lXwrObKix13KL R5MYM0VNqy9uYBMR4ePJ2VwPQCPuBsHewBg/JntIZBzqBT3yUxgO6eoGi7dL1JFsLSie 202g== 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=jlS7YCsZWAJRCh7VQeSElH9c4MLj2HkvcGmj37dX+gg=; b=kaaDUKbLUOxh+JHrKWsSui9oApRPegu1IA5IAwLPrCItDq4qxgXAnl37/dhXQMCuwn bZQhjmeQVugg85aWoTjCNuhoI6Dap7TX07gvtevN1dq80omX5/XarPQBfTnmcgUOH3hZ sG62ZdDBF6Y69+fqOya1FECrQ9d71/xfGKLtawZSmeNRm8A9BNGGS54LqtotB4gRIWwS wAbH65sLQse31ZLDPY34UEYOJb5+HVuVTnVI641GQ+4A28UkeuDreQ7u+Pgtsoypif0t XPAyNDko6ADA4D3DeToVR9c11T9fuFGR2NS6cH7guwbtf1OaOpwGcwllDFcuA4jeAx40 TGsg== X-Gm-Message-State: AOAM533NpPqWQu000l+X+eMI6yKVLdIYorP+pyI2SAXY8lsJzkc+6etK yEF9wTNvubcg1lRs04L3Urzb2DPCpz4= X-Google-Smtp-Source: ABdhPJwSnWOKEZY6X4zaxq3gEapAmbN8i/Fn9uZbztWZrw1J2bhZYr6B32L2xUaFQxx4LT/XNVZUpQ== X-Received: by 2002:a37:8744:: with SMTP id j65mr4376689qkd.304.1620309598982; Thu, 06 May 2021 06:59:58 -0700 (PDT) From: Jason Andryuk To: xen-devel@lists.xenproject.org Cc: Jason Andryuk , Daniel De Graaf , Quan Xu , Samuel Thibault Subject: [PATCH v2 05/13] vtpmmgr: Move vtpmmgr_shutdown Date: Thu, 6 May 2021 09:59:15 -0400 Message-Id: <20210506135923.161427-6-jandryuk@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210506135923.161427-1-jandryuk@gmail.com> References: <20210506135923.161427-1-jandryuk@gmail.com> MIME-Version: 1.0 Reposition vtpmmgr_shutdown so it can call flush_tpm2 without a forward declaration. Signed-off-by: Jason Andryuk Reviewed-by: Samuel Thibault Reviewed-by: Daniel P. Smith --- stubdom/vtpmmgr/init.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c index 130e4f4bf6..decf8e8b4d 100644 --- a/stubdom/vtpmmgr/init.c +++ b/stubdom/vtpmmgr/init.c @@ -503,20 +503,6 @@ egress: return status; } -void vtpmmgr_shutdown(void) -{ - /* Cleanup TPM resources */ - TPM_TerminateHandle(vtpm_globals.oiap.AuthHandle); - - /* Close tpmback */ - shutdown_tpmback(); - - /* Close tpmfront/tpm_tis */ - close(vtpm_globals.tpm_fd); - - vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n"); -} - /* TPM 2.0 */ static void tpm2_AuthArea_ctor(const char *authValue, UINT32 authLen, @@ -797,3 +783,17 @@ abort_egress: egress: return status; } + +void vtpmmgr_shutdown(void) +{ + /* Cleanup TPM resources */ + TPM_TerminateHandle(vtpm_globals.oiap.AuthHandle); + + /* Close tpmback */ + shutdown_tpmback(); + + /* Close tpmfront/tpm_tis */ + close(vtpm_globals.tpm_fd); + + vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n"); +}