Skip to content

Commit

Permalink
IntelSiliconPkg VTdDxe: Report status code for VTd error
Browse files Browse the repository at this point in the history
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1273

Current code only uses DEBUG() for VTd error.
This patch updates to also report status code for VTd error.

Test done:
Created case that has VTd error and confirmed the error
status code could be reported as expected.

Cc: Jiewen Yao <[email protected]>
Cc: Rangasai V Chaganty <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
  • Loading branch information
lzeng14 committed Oct 25, 2018
1 parent 8c09f30 commit 27bf671
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <Library/CacheMaintenanceLib.h>
#include <Library/PerformanceLib.h>
#include <Library/PrintLib.h>
#include <Library/ReportStatusCodeLib.h>

#include <Guid/EventGroup.h>
#include <Guid/Acpi.h>
Expand Down
2 changes: 2 additions & 0 deletions IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.inf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
CacheMaintenanceLib
PerformanceLib
PrintLib
ReportStatusCodeLib

[Guids]
gEfiEventExitBootServicesGuid ## CONSUMES ## Event
Expand All @@ -78,6 +79,7 @@

[Pcd]
gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask ## CONSUMES
gIntelSiliconPkgTokenSpaceGuid.PcdErrorCodeVTdError ## CONSUMES

[Depex]
gEfiPciRootBridgeIoProtocolGuid
Expand Down
1 change: 1 addition & 0 deletions IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ DumpVtdIfError (
}

if (HasError) {
REPORT_STATUS_CODE (EFI_ERROR_CODE, PcdGet32 (PcdErrorCodeVTdError));
DEBUG((DEBUG_INFO, "\n#### ERROR ####\n"));
DumpVtdRegs (Num);
DEBUG((DEBUG_INFO, "#### ERROR ####\n\n"));
Expand Down
6 changes: 6 additions & 0 deletions IntelSiliconPkg/IntelSiliconPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
[Protocols]
gEdkiiPlatformVTdPolicyProtocolGuid = { 0x3d17e448, 0x466, 0x4e20, { 0x99, 0x9f, 0xb2, 0xe1, 0x34, 0x88, 0xee, 0x22 }}

[PcdsFixedAtBuild, PcdsPatchableInModule]
## Error code for VTd error.<BR><BR>
# EDKII_ERROR_CODE_VTD_ERROR = (EFI_IO_BUS_UNSPECIFIED | (EFI_OEM_SPECIFIC | 0x00000000)) = 0x02008000<BR>
# @Prompt Error code for VTd error.
gIntelSiliconPkgTokenSpaceGuid.PcdErrorCodeVTdError|0x02008000|UINT32|0x00000005

[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
## This is the GUID of the FFS which contains the Graphics Video BIOS Table (VBT)
# The VBT content is stored as a RAW section which is consumed by GOP PEI/UEFI driver.
Expand Down

0 comments on commit 27bf671

Please sign in to comment.