]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelSiliconPkg VTdDxe: Report status code for VTd error
authorStar Zeng <star.zeng@intel.com>
Wed, 24 Oct 2018 02:27:48 +0000 (10:27 +0800)
committerStar Zeng <star.zeng@intel.com>
Thu, 25 Oct 2018 03:50:49 +0000 (11:50 +0800)
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>
IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h
IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.inf
IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
IntelSiliconPkg/IntelSiliconPkg.dec

index 2ec92fe523c395a1b964a73e0e1cbd95395af193..baa092f3ac0c9db6e2d6e26179d229836c2406da 100644 (file)
@@ -28,6 +28,7 @@
 #include <Library/CacheMaintenanceLib.h>\r
 #include <Library/PerformanceLib.h>\r
 #include <Library/PrintLib.h>\r
 #include <Library/CacheMaintenanceLib.h>\r
 #include <Library/PerformanceLib.h>\r
 #include <Library/PrintLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
 \r
 #include <Guid/EventGroup.h>\r
 #include <Guid/Acpi.h>\r
 \r
 #include <Guid/EventGroup.h>\r
 #include <Guid/Acpi.h>\r
index 60bb335da946db13a72064e13d7955c8d684c805..ca1f2d70921580e3026b1853a8e5973727f736a4 100644 (file)
@@ -60,6 +60,7 @@
   CacheMaintenanceLib\r
   PerformanceLib\r
   PrintLib\r
   CacheMaintenanceLib\r
   PerformanceLib\r
   PrintLib\r
+  ReportStatusCodeLib\r
 \r
 [Guids]\r
   gEfiEventExitBootServicesGuid   ## CONSUMES ## Event\r
 \r
 [Guids]\r
   gEfiEventExitBootServicesGuid   ## CONSUMES ## Event\r
@@ -78,6 +79,7 @@
 \r
 [Pcd]\r
   gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask   ## CONSUMES\r
 \r
 [Pcd]\r
   gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask   ## CONSUMES\r
+  gIntelSiliconPkgTokenSpaceGuid.PcdErrorCodeVTdError       ## CONSUMES\r
 \r
 [Depex]\r
   gEfiPciRootBridgeIoProtocolGuid\r
 \r
 [Depex]\r
   gEfiPciRootBridgeIoProtocolGuid\r
index e564d373c756c82f2d284121c147aa98f143fb3f..45285510a5006f51082a78bee55933a2aeecb5ed 100644 (file)
@@ -545,6 +545,7 @@ DumpVtdIfError (
     }\r
 \r
     if (HasError) {\r
     }\r
 \r
     if (HasError) {\r
+      REPORT_STATUS_CODE (EFI_ERROR_CODE, PcdGet32 (PcdErrorCodeVTdError));\r
       DEBUG((DEBUG_INFO, "\n#### ERROR ####\n"));\r
       DumpVtdRegs (Num);\r
       DEBUG((DEBUG_INFO, "#### ERROR ####\n\n"));\r
       DEBUG((DEBUG_INFO, "\n#### ERROR ####\n"));\r
       DumpVtdRegs (Num);\r
       DEBUG((DEBUG_INFO, "#### ERROR ####\n\n"));\r
index 2f5bef6089f9baafa87153967f1429bd3e8eb48c..900e8f63c64d030210a71193cbce817cc1dd776e 100644 (file)
 [Protocols]\r
   gEdkiiPlatformVTdPolicyProtocolGuid = { 0x3d17e448, 0x466, 0x4e20, { 0x99, 0x9f, 0xb2, 0xe1, 0x34, 0x88, 0xee, 0x22 }}\r
 \r
 [Protocols]\r
   gEdkiiPlatformVTdPolicyProtocolGuid = { 0x3d17e448, 0x466, 0x4e20, { 0x99, 0x9f, 0xb2, 0xe1, 0x34, 0x88, 0xee, 0x22 }}\r
 \r
+[PcdsFixedAtBuild, PcdsPatchableInModule]\r
+  ## Error code for VTd error.<BR><BR>\r
+  #  EDKII_ERROR_CODE_VTD_ERROR = (EFI_IO_BUS_UNSPECIFIED | (EFI_OEM_SPECIFIC | 0x00000000)) = 0x02008000<BR>\r
+  # @Prompt Error code for VTd error.\r
+  gIntelSiliconPkgTokenSpaceGuid.PcdErrorCodeVTdError|0x02008000|UINT32|0x00000005\r
+\r
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]\r
   ## This is the GUID of the FFS which contains the Graphics Video BIOS Table (VBT)\r
   # The VBT content is stored as a RAW section which is consumed by GOP PEI/UEFI driver.\r
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]\r
   ## This is the GUID of the FFS which contains the Graphics Video BIOS Table (VBT)\r
   # The VBT content is stored as a RAW section which is consumed by GOP PEI/UEFI driver.\r