BIOS uses TE with a null root entry table to block VT-d engine access to block any DMA traffic in pre-memory phase.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2867 Change-Id: I6c086c1f26e60f781de79cc37677cc5717c5edec Cc: Ray Ni <[email protected]> Cc: Rangasai V Chaganty <[email protected]> Signed-off-by: Sheng Wei <[email protected]> --- .../PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c | 15 +++++++++++++++ .../PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.inf | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c index 6f6c14f7..465bc2a4 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c @@ -164,6 +164,15 @@ EFI_PEI_PPI_DESCRIPTOR mPlatformVTdNoIgdInfoSampleDesc = { &mPlatformVTdNoIgdSample }; +// BIOS uses TE with a null root entry table to block VT-d engine access to block any DMA traffic in pre-memory phase. +EDKII_VTD_NULL_ROOT_ENTRY_TABLE_PPI mNullRootEntryTable = 0xFED20000; + +EFI_PEI_PPI_DESCRIPTOR mPlatformNullRootEntryTableDesc = { + (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), + &gEdkiiVTdNullRootEntryTableGuid, + &mNullRootEntryTable +}; + /** Initialize VTd register. Initialize the VTd hardware unit which has INCLUDE_PCI_ALL set @@ -344,6 +353,12 @@ PlatformVTdInfoSampleInitialize ( if (!EFI_ERROR(Status)) { SiliconInitialized = TRUE; } + + Status = PeiServicesInstallPpi (&mPlatformNullRootEntryTableDesc); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR , "Failed to install the NullRootEntryTable ppi - %r\n", Status)); + } + DEBUG ((DEBUG_INFO, "SiliconInitialized - %x\n", SiliconInitialized)); if (!SiliconInitialized) { Status = PeiServicesNotifyPpi (&mSiliconInitializedNotifyList); diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.inf b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.inf index dacfdf5e..b35853b6 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.inf +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.inf @@ -38,7 +38,8 @@ IoLib [Ppis] - gEdkiiVTdInfoPpiGuid ## PRODUCES + gEdkiiVTdInfoPpiGuid ## PRODUCES + gEdkiiVTdNullRootEntryTableGuid ## PRODUCES [Depex] gEfiPeiMasterBootModePpiGuid -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#64606): https://edk2.groups.io/g/devel/message/64606 Mute This Topic: https://groups.io/mt/76402533/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
