summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/Tcg/TcgDxe
diff options
context:
space:
mode:
authorczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>2012-08-02 06:33:10 +0000
committerczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>2012-08-02 06:33:10 +0000
commit9e945f785238fe3bb72bbc66f162b68938898c31 (patch)
treefb17c2d5df251150449cf6aaca7c2c936bdb7b9d /SecurityPkg/Tcg/TcgDxe
parentdda39f3a5850458391aaab330971d46bc9c2b690 (diff)
downloadedk2-9e945f785238fe3bb72bbc66f162b68938898c31.tar.gz
edk2-9e945f785238fe3bb72bbc66f162b68938898c31.tar.bz2
edk2-9e945f785238fe3bb72bbc66f162b68938898c31.zip
Measure ExitBootServices failure case
Signed-off-by: Chao Zhang<chao.b.zhang@intel.com> Reviewed-by: Dong Guo<guo.dong@intel.com> Reviewed-by: Gao Liming<liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13580 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SecurityPkg/Tcg/TcgDxe')
-rw-r--r--SecurityPkg/Tcg/TcgDxe/TcgDxe.c41
-rw-r--r--SecurityPkg/Tcg/TcgDxe/TcgDxe.inf1
2 files changed, 42 insertions, 0 deletions
diff --git a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
index 4b5380ba87..75c6a8978f 100644
--- a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
+++ b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
@@ -23,6 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Guid/HobList.h>
#include <Guid/TcgEventHob.h>
#include <Guid/EventGroup.h>
+#include <Guid/EventExitBootServiceFailed.h>
#include <Protocol/DevicePath.h>
#include <Protocol/TcgService.h>
#include <Protocol/AcpiTable.h>
@@ -1104,6 +1105,34 @@ OnExitBootServices (
}
/**
+ Exit Boot Services Failed Event notification handler.
+
+ Measure Failure of ExitBootServices.
+
+ @param[in] Event Event whose notification function is being invoked
+ @param[in] Context Pointer to the notification function's context
+
+**/
+VOID
+EFIAPI
+OnExitBootServicesFailed (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ EFI_STATUS Status;
+
+ //
+ // Measure Failure of ExitBootServices,
+ //
+ Status = TcgMeasureAction (
+ EFI_EXIT_BOOT_SERVICES_FAILED
+ );
+ ASSERT_EFI_ERROR (Status);
+
+}
+
+/**
Get TPM Deactivated state.
@param[out] TPMDeactivatedFlag Returns TPM Deactivated state.
@@ -1205,6 +1234,18 @@ DriverEntry (
&gEfiEventExitBootServicesGuid,
&Event
);
+
+ //
+ // Measure Exit Boot Service failed
+ //
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_NOTIFY,
+ OnExitBootServicesFailed,
+ NULL,
+ &gEventExitBootServicesFailedGuid,
+ &Event
+ );
}
//
diff --git a/SecurityPkg/Tcg/TcgDxe/TcgDxe.inf b/SecurityPkg/Tcg/TcgDxe/TcgDxe.inf
index 95f37737c4..239997db7d 100644
--- a/SecurityPkg/Tcg/TcgDxe/TcgDxe.inf
+++ b/SecurityPkg/Tcg/TcgDxe/TcgDxe.inf
@@ -56,6 +56,7 @@
gTcgEventEntryHobGuid
gEfiEventReadyToBootGuid
gEfiEventExitBootServicesGuid
+ gEventExitBootServicesFailedGuid # ALWAYS_CONSUMED
[Protocols]
gEfiTcgProtocolGuid ## PRODUCES