public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Eric Dong <eric.dong@intel.com>
To: edk2-devel@lists.01.org
Cc: Jiewen Yao <jiewen.yao@intel.com>, Chao Zhang <chao.b.zhang@intel.com>
Subject: [Patch 08/10] SecurityPkg TcgSmm: Enable Storage actions.
Date: Wed, 16 Nov 2016 14:00:47 +0800	[thread overview]
Message-ID: <1479276049-34308-9-git-send-email-eric.dong@intel.com> (raw)
In-Reply-To: <1479276049-34308-1-git-send-email-eric.dong@intel.com>

After enable storage related actions in the
TcgPhysicalPresenceStorageLib, use this library to support
storage related actions in this driver.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
---
 SecurityPkg/Tcg/TcgSmm/TcgSmm.c   | 23 +++++++++++++++++++++++
 SecurityPkg/Tcg/TcgSmm/TcgSmm.h   |  2 ++
 SecurityPkg/Tcg/TcgSmm/TcgSmm.inf |  1 +
 3 files changed, 26 insertions(+)

diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c
index 589bab6..743b3eb 100644
--- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c
+++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c
@@ -55,6 +55,7 @@ PhysicalPresenceCallback (
   EFI_PHYSICAL_PRESENCE          PpData;
   EFI_PHYSICAL_PRESENCE_FLAGS    Flags;
   BOOLEAN                        RequestConfirmed;
+  UINT32                         StorageFlags;
 
   //
   // Get the Physical Presence variable
@@ -150,6 +151,11 @@ PhysicalPresenceCallback (
       return EFI_SUCCESS;
     }
 
+    //
+    // Get the Physical Presence storage flags
+    //
+    StorageFlags = TcgPhysicalPresenceStorageLibReturnStorageFlags();
+
     RequestConfirmed = FALSE;
 
     switch (mTcgNvs->PPRequestUserConfirm) {
@@ -201,6 +207,23 @@ PhysicalPresenceCallback (
         //
         mTcgNvs->PhysicalPresence.ReturnCode = TCG_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED; 
         return EFI_SUCCESS;
+
+      case TCG2_PHYSICAL_PRESENCE_ENABLE_BLOCK_SID:
+        if ((StorageFlags & TCG_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_ENABLE_BLOCK_SID) == 0) {
+          RequestConfirmed = TRUE;
+        }
+        break;
+
+      case TCG2_PHYSICAL_PRESENCE_DISABLE_BLOCK_SID:
+        if ((StorageFlags & TCG_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_DISABLE_BLOCK_SID) == 0) {
+          RequestConfirmed = TRUE;
+        }
+        break;
+
+      case TCG2_PHYSICAL_PRESENCE_SET_PP_REQUIRED_FOR_ENABLE_BLOCK_SID_FUNC_TRUE:
+      case TCG2_PHYSICAL_PRESENCE_SET_PP_REQUIRED_FOR_DISABLE_BLOCK_SID_FUNC_TRUE:
+        break;
+
       default:
         break;
     }
diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.h b/SecurityPkg/Tcg/TcgSmm/TcgSmm.h
index 21e4ad9..148638c 100644
--- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.h
+++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.h
@@ -18,6 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <PiDxe.h>
 #include <IndustryStandard/Acpi.h>
 #include <IndustryStandard/UefiTcgPlatform.h>
+#include <IndustryStandard/TcgPhysicalPresence.h>
 
 #include <Guid/PhysicalPresenceData.h>
 #include <Guid/MemoryOverwriteControl.h>
@@ -37,6 +38,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/TpmMeasurementLib.h>
 #include <Library/PcdLib.h>
 #include <Library/TcgPpVendorLib.h>
+#include <Library/TcgPhysicalPresenceStorageLib.h>
 
 #pragma pack(1)
 typedef struct {
diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf b/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf
index be7a96b..5f2d3a3 100644
--- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf
+++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf
@@ -50,6 +50,7 @@
   TpmMeasurementLib
   PcdLib
   TcgPpVendorLib
+  TcgPhysicalPresenceStorageLib
 
 [Guids]
   ## SOMETIMES_PRODUCES ## Variable:L"PhysicalPresence"
-- 
2.6.4.windows.1



  parent reply	other threads:[~2016-11-16  6:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16  6:00 [Patch 00/10] Enable BlockSid related PP actions Eric Dong
2016-11-16  6:00 ` [Patch 01/10] SecurityPkg: Add definition for Physical Presence storage flag Eric Dong
2016-11-16  6:00 ` [Patch 02/10] SecurityPkg: Add header file for TcgPhysicalPresenceStorageLib Eric Dong
2016-11-16  6:00 ` [Patch 03/10] SecurityPkg: Add DxeTcgPhysicalPresenceStorageLib Eric Dong
2016-11-17  5:49   ` Zhang, Chao B
2016-11-16  6:00 ` [Patch 04/10] SecurityPkg: Add SmmTcgPhysicalPresenceStorageLib Eric Dong
2016-11-16  6:00 ` [Patch 05/10] SecurityPkg DxeTcg2PhysicalPresenceLib: Enable Storage actions Eric Dong
2016-11-16  6:00 ` [Patch 06/10] SecurityPkg DxeTcgPhysicalPresenceLib: " Eric Dong
2016-11-16  6:00 ` [Patch 07/10] SecurityPkg SmmTcg2PhysicalPresenceLib: " Eric Dong
2016-11-17  5:58   ` Zhang, Chao B
2016-11-16  6:00 ` Eric Dong [this message]
2016-11-16  6:00 ` [Patch 09/10] SecurityPkg OpalPasswordDxe: Use PP actions to enable BlockSID Eric Dong
2016-11-16  6:00 ` [Patch 10/10] SecurityPkg Tcg2Config: Remove the empty options Eric Dong
2016-11-21  3:31 ` [Patch 00/10] Enable BlockSid related PP actions Yao, Jiewen
2016-11-23  8:12   ` Dong, Eric
2016-11-23  8:14     ` 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=1479276049-34308-9-git-send-email-eric.dong@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