From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com []) by mx.groups.io with SMTP id smtpd.web09.3729.1578020675360032184 for ; Thu, 02 Jan 2020 19:04:36 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: zhichao.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 19:04:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,389,1571727600"; d="scan'208";a="252455059" Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga002.fm.intel.com with ESMTP; 02 Jan 2020 19:04:35 -0800 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Chao Zhang Subject: [PATCH 01/13] SecurityPkg/Tcg2PpVerndorLib: Add two Ex function to handle PPdata Date: Fri, 3 Jan 2020 11:04:15 +0800 Message-Id: <20200103030428.28176-2-zhichao.gao@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200103030428.28176-1-zhichao.gao@intel.com> References: <20200103030428.28176-1-zhichao.gao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2443 Add Tcg2PpVendorLibExecutePendingRequestEx and Tcg2PpVendorLibSubmitRequestToPreOSFunctionEx to handle the EFI_TCG2_PHYSICAL_PRESENCE parameters. Add the definition first. Cc: Jiewen Yao Cc: Jian J Wang Cc: Chao Zhang Signed-off-by: Zhichao Gao --- SecurityPkg/Include/Library/Tcg2PpVendorLib.h | 54 ++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/SecurityPkg/Include/Library/Tcg2PpVendorLib.h b/SecurityPkg/Include/Library/Tcg2PpVendorLib.h index 569eba6874..8f7fcf4e84 100644 --- a/SecurityPkg/Include/Library/Tcg2PpVendorLib.h +++ b/SecurityPkg/Include/Library/Tcg2PpVendorLib.h @@ -7,7 +7,7 @@ Caution: This function may receive untrusted input. -Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -16,6 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define _TCG2_PP_VENDOR_LIB_H_ #include +#include #include #include @@ -46,6 +47,33 @@ Tcg2PpVendorLibExecutePendingRequest ( OUT BOOLEAN *ResetRequired ); +/** + Check and execute the requested physical presence command. + + This API should be invoked in BIOS boot phase to process pending request. + + Caution: This function may receive untrusted input. + + If OperationRequest < 128, then ASSERT(). + + @param[in] PlatformAuth platform auth value. NULL means no platform auth change. + @param[in] PPData Ptr to EFI_TCG2_PHYSICAL_PRESENCE data. + @param[in, out] ManagementFlags BIOS TPM Management Flags. + @param[out] ResetRequired If reset is required to vendor settings in effect. + True, it indicates the reset is required. + False, it indicates the reset is not required. + + @return TPM Operation Response to OS Environment. +**/ +UINT32 +EFIAPI +Tcg2PpVendorLibExecutePendingRequestEx ( + IN TPM2B_AUTH *PlatformAuth, OPTIONAL + IN EFI_TCG2_PHYSICAL_PRESENCE *PPData, + IN OUT UINT32 *ManagementFlags, + OUT BOOLEAN *ResetRequired + ); + /** Check if there is a valid physical presence command request. @@ -98,6 +126,30 @@ Tcg2PpVendorLibSubmitRequestToPreOSFunction ( IN UINT32 RequestParameter ); +/** + The callback for TPM vendor specific physical presence which is called for + Submit TPM Operation Request to Pre-OS Environment and + Submit TPM Operation Request to Pre-OS Environment 2. + + This API should be invoked in OS runtime phase to interface with ACPI method. + + Caution: This function may receive untrusted input. + + If OperationRequest < 128, then ASSERT(). + + @param[in] *PPData Ptr to EFI_TCG2_PHYSICAL_PRESENCE data. + @param[in] ManagementFlags BIOS TPM Management Flags. + + @return Return Code for Submit TPM Operation Request to Pre-OS Environment and + Submit TPM Operation Request to Pre-OS Environment 2. +**/ +UINT32 +EFIAPI +Tcg2PpVendorLibSubmitRequestToPreOSFunctionEx ( + IN EFI_TCG2_PHYSICAL_PRESENCE *PPdata, + IN UINT32 ManagementFlags + ); + /** The callback for TPM vendor specific physical presence which is called for Get User Confirmation Status for Operation. -- 2.21.0.windows.1