summaryrefslogtreecommitdiffstats
path: root/IntelSiliconPkg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2018-10-24 10:27:48 +0800
committerStar Zeng <star.zeng@intel.com>2018-10-25 11:50:49 +0800
commit27bf6712b4ea896bf39b00401218ac3b67b683ae (patch)
treec95b9e96fe265301f2dbc7e5096394d921f6eb5c /IntelSiliconPkg
parent8c09f300103993985c91532239a72ba879df0b31 (diff)
downloadedk2-27bf6712b4ea896bf39b00401218ac3b67b683ae.tar.gz
edk2-27bf6712b4ea896bf39b00401218ac3b67b683ae.tar.bz2
edk2-27bf6712b4ea896bf39b00401218ac3b67b683ae.zip
IntelSiliconPkg VTdDxe: Report status code for VTd error
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 <jiewen.yao@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'IntelSiliconPkg')
-rw-r--r--IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h1
-rw-r--r--IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.inf2
-rw-r--r--IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c1
-rw-r--r--IntelSiliconPkg/IntelSiliconPkg.dec6
4 files changed, 10 insertions, 0 deletions
diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h
index 2ec92fe523..baa092f3ac 100644
--- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h
+++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h
@@ -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>
diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.inf b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.inf
index 60bb335da9..ca1f2d7092 100644
--- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.inf
+++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.inf
@@ -60,6 +60,7 @@
CacheMaintenanceLib
PerformanceLib
PrintLib
+ ReportStatusCodeLib
[Guids]
gEfiEventExitBootServicesGuid ## CONSUMES ## Event
@@ -78,6 +79,7 @@
[Pcd]
gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask ## CONSUMES
+ gIntelSiliconPkgTokenSpaceGuid.PcdErrorCodeVTdError ## CONSUMES
[Depex]
gEfiPciRootBridgeIoProtocolGuid
diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
index e564d373c7..45285510a5 100644
--- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
+++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
@@ -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"));
diff --git a/IntelSiliconPkg/IntelSiliconPkg.dec b/IntelSiliconPkg/IntelSiliconPkg.dec
index 2f5bef6089..900e8f63c6 100644
--- a/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -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.