From 7729e3c448a116eb5b6198f0f70355f421df43fa Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Thu, 23 Nov 2017 08:55:02 +0800 Subject: [PATCH] IntelSiliconPkg IntelVTdDxe: Do not SetupVtd again Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng Tested-by: Jiewen Yao Reviewed-by: Jiewen Yao --- 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/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c index 6052a0aebe..37b3b19bce 100644 --- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c @@ -412,6 +412,9 @@ AcpiNotificationFunc ( Status = GetDmarAcpiTable (); if (EFI_ERROR (Status)) { + if (Status == EFI_ALREADY_STARTED) { + gBS->CloseEvent (Event); + } return; } SetupVtd (); diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h index 0886647ea6..519a5ab004 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. - @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 previously. + @retval EFI_NOT_FOUND The DMAR ACPI table is not found. **/ EFI_STATUS GetDmarAcpiTable ( diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c index 81dec10967..ce350bafbe 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. - @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 previously. + @retval EFI_NOT_FOUND The DMAR ACPI table is not found. **/ EFI_STATUS GetDmarAcpiTable ( @@ -990,7 +991,7 @@ GetDmarAcpiTable ( EFI_STATUS Status; if (mAcpiDmarTable != NULL) { - return EFI_SUCCESS; + return EFI_ALREADY_STARTED; } AcpiTable = NULL;