public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Zhichao" <zhichao.gao@intel.com>
To: devel@edk2.groups.io
Cc: Jiewen Yao <jiewen.yao@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>,
	Chao Zhang <chao.b.zhang@intel.com>
Subject: [PATCH 01/13] SecurityPkg/Tcg2PpVerndorLib: Add two Ex function to handle PPdata
Date: Fri,  3 Jan 2020 11:04:15 +0800	[thread overview]
Message-ID: <20200103030428.28176-2-zhichao.gao@intel.com> (raw)
In-Reply-To: <20200103030428.28176-1-zhichao.gao@intel.com>

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 <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 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.<BR>
+Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.<BR>
 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 <IndustryStandard/Tpm20.h>
+#include <Guid/Tcg2PhysicalPresenceData.h>
 #include <Protocol/Tcg2Protocol.h>
 #include <Library/Tcg2PhysicalPresenceLib.h>
 
@@ -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


  reply	other threads:[~2020-01-03  3:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-03  3:04 [PATCH 00/13] Extend and fix the TCG/TCG2 Physical Presence Interface Gao, Zhichao
2020-01-03  3:04 ` Gao, Zhichao [this message]
2020-01-03  3:04 ` [PATCH 02/13] SecurityPkg/Tcg2PpVendorLib: Add implementation of new Ex function Gao, Zhichao
2020-01-03  3:04 ` [PATCH 03/13] SecurityPkg/Tcg2PhysicalPresenceLib: Use the " Gao, Zhichao
2020-01-03  3:04 ` [PATCH 04/13] SecurityPkg/SmmTcg2PhysicalPresenceLib: " Gao, Zhichao
2020-01-03  3:04 ` [PATCH 05/13] SecurityPkg/dec: Add a pcd for user response wait time Gao, Zhichao
2020-01-03  3:04 ` [PATCH 06/13] OvmfPkg/Tcg2PhysicalPresenceLib: Use " Gao, Zhichao
2020-01-03 14:21   ` [edk2-devel] " Laszlo Ersek
2020-01-15  8:03     ` Gao, Zhichao
2020-01-19  7:03     ` Gao, Zhichao
2020-01-20  8:06       ` Laszlo Ersek
2020-01-03  3:04 ` [PATCH 07/13] SecurityPkg/Tcg2PhysicalPresenceLib: Use Pcd for user resp " Gao, Zhichao
2020-01-03  3:04 ` [PATCH 08/13] SecurityPkg/TcgPyhsicalPresenceLib: " Gao, Zhichao
2020-01-03  3:04 ` [PATCH 09/13] SecurityPkg/Tcg2PhysicalPresenceData.h: Add FunctionIndex for PPdata Gao, Zhichao
2020-01-03  3:04 ` [PATCH 10/13] SecurityPkg/Tcg2PhysicalPresenceLib: Extend the submit preOS func Gao, Zhichao
2020-01-03  3:04 ` [PATCH 11/13] SecurityPkg: Move the Tcg2ConfigNvData.h to Include folder Gao, Zhichao
2020-01-03  3:04 ` [PATCH 12/13] SecurityPkg/TcgPhysicalPresenceLib: Replace the ASSERT with error code Gao, Zhichao
2020-01-03  3:04 ` [PATCH 13/13] SecurityPkg/TcgPhysicalPresenceLib: Fix the operation of 11 Gao, Zhichao
2020-01-03  3:09 ` [PATCH 00/13] Extend and fix the TCG/TCG2 Physical Presence Interface Yao, Jiewen
2020-01-03  5:07   ` Gao, Zhichao
2020-01-03  5:30     ` Yao, Jiewen
2020-01-09  9:05       ` Gao, Zhichao
2020-01-09  9:22         ` Yao, Jiewen
     [not found]     ` <15E649625DE7E06B.2038@groups.io>
2020-01-03  5:59       ` [edk2-devel] " Yao, Jiewen
2020-01-07  8:05         ` Gao, Zhichao
2020-01-07  8:31           ` Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200103030428.28176-2-zhichao.gao@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox