public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Zeng, Star" <star.zeng@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] IntelSiliconPkg VTdDxe: Report status code for VTd error
Date: Wed, 24 Oct 2018 11:22:04 +0000	[thread overview]
Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AE262F6@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1540352160-101156-1-git-send-email-star.zeng@intel.com>

Reviewed-by: Jiewen.yao@intel.com

> -----Original Message-----
> From: Zeng, Star
> Sent: Wednesday, October 24, 2018 11:36 AM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>;
> Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>
> Subject: [PATCH] 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>
> ---
>  IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h | 1 +
>  IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.inf | 2 ++
>  IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c        | 1 +
>  IntelSiliconPkg/IntelSiliconPkg.dec                     | 6 ++++++
>  4 files changed, 10 insertions(+)
> 
> diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h
> b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h
> index 2ec92fe523c3..baa092f3ac0c 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 60bb335da946..ca1f2d709215 100644
> --- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.inf
> +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.inf
> @@ -60,6 +60,7 @@ [LibraryClasses]
>    CacheMaintenanceLib
>    PerformanceLib
>    PrintLib
> +  ReportStatusCodeLib
> 
>  [Guids]
>    gEfiEventExitBootServicesGuid   ## CONSUMES ## Event
> @@ -78,6 +79,7 @@ [Protocols]
> 
>  [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 e564d373c756..45285510a500 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 2f5bef6089f9..900e8f63c64d 100644
> --- a/IntelSiliconPkg/IntelSiliconPkg.dec
> +++ b/IntelSiliconPkg/IntelSiliconPkg.dec
> @@ -47,6 +47,12 @@ [Ppis]
>  [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|UINT3
> 2|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.
> --
> 2.7.0.windows.1



      reply	other threads:[~2018-10-24 11:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24  3:36 [PATCH] IntelSiliconPkg VTdDxe: Report status code for VTd error Star Zeng
2018-10-24 11:22 ` Yao, Jiewen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74D8A39837DF1E4DA445A8C0B3885C503AE262F6@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox