From nobody Sat May 4 05:48:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1511399479630486.7084800047908; Wed, 22 Nov 2017 17:11:19 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B05C72035689C; Wed, 22 Nov 2017 17:07:01 -0800 (PST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 E3FAC220C1603 for ; Wed, 22 Nov 2017 17:06:59 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2017 17:11:16 -0800 Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.158.46]) by fmsmga006.fm.intel.com with ESMTP; 22 Nov 2017 17:11:15 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,438,1505804400"; d="scan'208";a="179521490" From: Star Zeng To: edk2-devel@lists.01.org Date: Thu, 23 Nov 2017 09:11:14 +0800 Message-Id: <1511399474-9580-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [edk2] [PATCH] IntelSiliconPkg IntelVTdDxe: Do not SetupVtd again X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiewen Yao , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng Reviewed-by: Jiewen.yao@intel.com Tested-by: Jiewen.yao@intel.com --- IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c | 3 +++ IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h | 5 +++-- IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c | 7 ++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c b/Inte= lSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c index 6052a0aebe45..37b3b19bce90 100644 --- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c @@ -412,6 +412,9 @@ AcpiNotificationFunc ( =20 Status =3D GetDmarAcpiTable (); if (EFI_ERROR (Status)) { + if (Status =3D=3D EFI_ALREADY_STARTED) { + gBS->CloseEvent (Event); + } return; } SetupVtd (); diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h b/Inte= lSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h index 0886647ea673..519a5ab00450 100644 --- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h @@ -302,8 +302,9 @@ FindVtdIndexByPciDevice ( /** Get the DMAR ACPI table. =20 - @retval EFI_SUCCESS The DMAR ACPI table is got. - @retval EFI_NOT_FOUND The DMAR ACPI table is not found. + @retval EFI_SUCCESS The DMAR ACPI table is got. + @retval EFI_ALREADY_STARTED The DMAR ACPI table has been got previousl= y. + @retval EFI_NOT_FOUND The DMAR ACPI table is not found. **/ EFI_STATUS GetDmarAcpiTable ( diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c b/Inte= lSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c index 81dec109675b..ce350bafbe3f 100644 --- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c @@ -978,8 +978,9 @@ FindAcpiPtr ( /** Get the DMAR ACPI table. =20 - @retval EFI_SUCCESS The DMAR ACPI table is got. - @retval EFI_NOT_FOUND The DMAR ACPI table is not found. + @retval EFI_SUCCESS The DMAR ACPI table is got. + @retval EFI_ALREADY_STARTED The DMAR ACPI table has been got previousl= y. + @retval EFI_NOT_FOUND The DMAR ACPI table is not found. **/ EFI_STATUS GetDmarAcpiTable ( @@ -990,7 +991,7 @@ GetDmarAcpiTable ( EFI_STATUS Status; =20 if (mAcpiDmarTable !=3D NULL) { - return EFI_SUCCESS; + return EFI_ALREADY_STARTED; } =20 AcpiTable =3D NULL; --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel