From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 65563222A54FF for ; Wed, 3 Jan 2018 19:26:11 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2018 19:31:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,505,1508828400"; d="scan'208";a="18011778" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.158.46]) by fmsmga004.fm.intel.com with ESMTP; 03 Jan 2018 19:31:12 -0800 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Jiewen Yao Date: Thu, 4 Jan 2018 11:31:10 +0800 Message-Id: <1515036670-18616-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [PATCH] IntelSiliconPkg IntelVTdDxe: Signal AcpiNotificationFunc() initially X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jan 2018 03:26:11 -0000 Signal AcpiNotificationFunc() initially for the case that DMAR table has been installed when creating event. Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c | 16 ++++++++++++---- IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c | 3 +++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c index 37b3b19bce90..648f64c20b77 100644 --- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c @@ -1,6 +1,6 @@ /** @file - Copyright (c) 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -473,7 +473,8 @@ InitializeDmaProtection ( EFI_STATUS Status; EFI_EVENT ExitBootServicesEvent; EFI_EVENT LegacyBootEvent; - EFI_EVENT Event; + EFI_EVENT EventAcpi10; + EFI_EVENT EventAcpi20; Status = gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, @@ -481,7 +482,7 @@ InitializeDmaProtection ( AcpiNotificationFunc, NULL, &gEfiAcpi10TableGuid, - &Event + &EventAcpi10 ); ASSERT_EFI_ERROR (Status); @@ -491,10 +492,17 @@ InitializeDmaProtection ( AcpiNotificationFunc, NULL, &gEfiAcpi20TableGuid, - &Event + &EventAcpi20 ); ASSERT_EFI_ERROR (Status); + // + // Signal the events initially for the case + // that DMAR table has been installed. + // + gBS->SignalEvent (EventAcpi20); + gBS->SignalEvent (EventAcpi10); + Status = gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, TPL_CALLBACK, diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c index ce350bafbe3f..b16bd93d53f1 100644 --- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c @@ -1005,6 +1005,9 @@ GetDmarAcpiTable ( &AcpiTable ); } + if (EFI_ERROR (Status)) { + return EFI_NOT_FOUND; + } ASSERT (AcpiTable != NULL); mAcpiDmarTable = FindAcpiPtr ( -- 2.7.0.windows.1