]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix always reboot issue for an invalid physical presence operation request.
authorgdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 9 May 2012 08:24:29 +0000 (08:24 +0000)
committergdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 9 May 2012 08:24:29 +0000 (08:24 +0000)
Signed-off by: Dong Guo <guo.dong@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Ouyang, Qian <qian.ouyang@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13297 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/Library/DxeTcgPhysicalPresenceLib/DxeTcgPhysicalPresenceLib.c

index 18d87ebe745ef7891a6a6a0bf0239656e7e3c709..bee311bed80f92319dd452bcef161bb99eb68bda 100644 (file)
@@ -2,7 +2,7 @@
 \r
   Execute pending TPM requests from OS or BIOS and Lock TPM.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
 which accompanies this distribution.  The full text of the license may be found at \r
@@ -936,6 +936,23 @@ ExecutePendingTpmRequest (
     case PHYSICAL_PRESENCE_SET_NO_PPI_MAINTENANCE_FALSE:\r
       RequestConfirmed = TRUE;\r
       break;\r
+      \r
+    default:\r
+      //\r
+      // Invalid operation request.\r
+      //\r
+      TcgPpData->PPResponse = TPM_PP_BIOS_FAILURE;\r
+      TcgPpData->LastPPRequest = TcgPpData->PPRequest;\r
+      TcgPpData->PPRequest = PHYSICAL_PRESENCE_NO_ACTION;\r
+      DataSize = sizeof (EFI_PHYSICAL_PRESENCE);\r
+      Status = gRT->SetVariable (\r
+                      PHYSICAL_PRESENCE_VARIABLE,\r
+                      &gEfiPhysicalPresenceGuid,\r
+                      EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+                      DataSize,\r
+                      TcgPpData\r
+                      );\r
+      return;\r
   }\r
 \r
   if ((Flags & FLAG_RESET_TRACK) != 0) {\r
@@ -965,7 +982,7 @@ ExecutePendingTpmRequest (
   //\r
   if ((TcgPpData->Flags & FLAG_RESET_TRACK) == 0) {\r
     TcgPpData->LastPPRequest = TcgPpData->PPRequest;\r
-    TcgPpData->PPRequest = 0;    \r
+    TcgPpData->PPRequest = PHYSICAL_PRESENCE_NO_ACTION;    \r
   }\r
 \r
   //\r
@@ -1004,7 +1021,7 @@ ExecutePendingTpmRequest (
     case PHYSICAL_PRESENCE_ENABLE_ACTIVATE_CLEAR_ENABLE_ACTIVATE:      \r
       break;\r
     default:\r
-      if (TcgPpData->PPRequest != 0) {\r
+      if (TcgPpData->PPRequest != PHYSICAL_PRESENCE_NO_ACTION) {\r
         break;\r
       }\r
       return;\r