IntelSiliconPkg IntelVTdDxe: Signal AcpiNotificationFunc() initially
authorStar Zeng <star.zeng@intel.com>
Wed, 3 Jan 2018 06:00:03 +0000 (14:00 +0800)
committerStar Zeng <star.zeng@intel.com>
Fri, 5 Jan 2018 02:26:32 +0000 (10:26 +0800)
Signal AcpiNotificationFunc() initially for the case that
DMAR table has been installed when creating event.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c
IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c

index 37b3b19..648f64c 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2017 - 2018, 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
@@ -473,7 +473,8 @@ InitializeDmaProtection (
   EFI_STATUS  Status;\r
   EFI_EVENT   ExitBootServicesEvent;\r
   EFI_EVENT   LegacyBootEvent;\r
-  EFI_EVENT   Event;\r
+  EFI_EVENT   EventAcpi10;\r
+  EFI_EVENT   EventAcpi20;\r
   \r
   Status = gBS->CreateEventEx (\r
                   EVT_NOTIFY_SIGNAL,\r
@@ -481,7 +482,7 @@ InitializeDmaProtection (
                   AcpiNotificationFunc,\r
                   NULL,\r
                   &gEfiAcpi10TableGuid,\r
-                  &Event\r
+                  &EventAcpi10\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
@@ -491,10 +492,17 @@ InitializeDmaProtection (
                   AcpiNotificationFunc,\r
                   NULL,\r
                   &gEfiAcpi20TableGuid,\r
-                  &Event\r
+                  &EventAcpi20\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
+  //\r
+  // Signal the events initially for the case\r
+  // that DMAR table has been installed.\r
+  //\r
+  gBS->SignalEvent (EventAcpi20);\r
+  gBS->SignalEvent (EventAcpi10);\r
+\r
   Status = gBS->CreateEventEx (\r
                   EVT_NOTIFY_SIGNAL,\r
                   TPL_CALLBACK,\r
index ce350ba..b16bd93 100644 (file)
@@ -1005,6 +1005,9 @@ GetDmarAcpiTable (
                &AcpiTable\r
                );\r
   }\r
+  if (EFI_ERROR (Status)) {\r
+    return EFI_NOT_FOUND;\r
+  }\r
   ASSERT (AcpiTable != NULL);\r
 \r
   mAcpiDmarTable = FindAcpiPtr (\r