public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Huang, Jenny" <jenny.huang@intel.com>
To: "Sheng, W" <w.sheng@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Kowalewski, Robert" <robert.kowalewski@intel.com>,
	"Ni, Ray" <ray.ni@intel.com>,
	"Chaganty, Rangasai V" <rangasai.v.chaganty@intel.com>
Subject: Re: [PATCH v3] IntelSiliconPkg/VTd: Add PCD for VTd Abort DMA Mode Support
Date: Thu, 9 Jun 2022 05:20:11 +0000	[thread overview]
Message-ID: <DM6PR11MB46273406C0B61281320B7A6AE2A79@DM6PR11MB4627.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220609051053.2063-1-w.sheng@intel.com>

Reviewed-by: Jenny Huang <jenny.huang@intel.com>

-----Original Message-----
From: Sheng, W <w.sheng@intel.com> 
Sent: Wednesday, June 8, 2022 10:11 PM
To: devel@edk2.groups.io
Cc: Kowalewski, Robert <robert.kowalewski@intel.com>; Ni, Ray <ray.ni@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Huang, Jenny <jenny.huang@intel.com>
Subject: [PATCH v3] IntelSiliconPkg/VTd: Add PCD for VTd Abort DMA Mode Support

PcdVTdSupportAbortDmaMode is used to enable/disable using VTd Abort DMA Mode.

Signed-off-by: Sheng Wei <w.sheng@intel.com>
Reviewed-by: Robert Kowalewski <robert.kowalewski@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Jenny Huang <jenny.huang@intel.com>

Change-Id: If999d2f4906bda887dffe8574ec17cb90346b710
---
 .../Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c           | 9 ++++++---
 .../Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.inf      | 3 ++-
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec        | 6 ++++++
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c
index b4c44d87..0d372f6c 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c
@@ -1,6 +1,6 @@
 /** @file

 

-  Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.<BR>

+  Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.<BR>

 

   SPDX-License-Identifier: BSD-2-Clause-Patent

 

@@ -570,10 +570,12 @@ EnableVTdTranslationProtectionBlockDma (
 

   DEBUG ((DEBUG_INFO, "EnableVTdTranslationProtectionBlockDma - 0x%08x\n", VtdUnitBaseAddress));

 

+  DEBUG ((DEBUG_INFO, "PcdVTdSupportAbortDmaMode : %d\n", FixedPcdGetBool (PcdVTdSupportAbortDmaMode)));

+

   ECapReg.Uint64 = MmioRead64 (VtdUnitBaseAddress + R_ECAP_REG);

-  DEBUG ((DEBUG_INFO, "ECapReg : 0%016lx\n", ECapReg.Uint64));

+  DEBUG ((DEBUG_INFO, "ECapReg.ADMS : %d\n", ECapReg.Bits.ADMS));

 

-  if (ECapReg.Bits.ADMS == 1) {

+  if ((ECapReg.Bits.ADMS == 1) && FixedPcdGetBool (PcdVTdSupportAbortDmaMode)) {

     //

     // Use Abort DMA Mode

     //

@@ -594,6 +596,7 @@ EnableVTdTranslationProtectionBlockDma (
       ASSERT (FALSE);

       return EFI_DEVICE_ERROR;

     }

+    DEBUG ((DEBUG_INFO, "Block All DMA by TE.\n"));

     Status = EnableDmarPreMem (VtdUnitBaseAddress, (UINT64) (*RootEntryTable));

   }

 

diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.inf b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.inf
index b97ff900..473665e9 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.inf
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.inf
@@ -4,7 +4,7 @@
 # This driver initializes VTd engine based upon EDKII_VTD_INFO_PPI

 # and provide DMA protection in PEI.

 #

-# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+# Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>

 # SPDX-License-Identifier: BSD-2-Clause-Patent

 #

 ##

@@ -55,6 +55,7 @@
   gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask   ## CONSUMES

   gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSize     ## CONSUMES

   gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSizeS3   ## CONSUMES

+  gIntelSiliconPkgTokenSpaceGuid.PcdVTdSupportAbortDmaMode  ## CONSUMES

 

 [Depex]

   gEfiPeiMasterBootModePpiGuid AND

diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
index e5b785ae..c36d130a 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -135,6 +135,12 @@
   gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize|0x000A0000|UINT32|0x0000000A

   gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset|0x00660000|UINT32|0x0000000B

 

+  ## Indicates if VTd Abort DMA Mode is supported.<BR><BR>

+  #   TRUE  - Support VTd abort DMA mode.

+  #   FALSE - Not support VTd abort DMA mode.

+  # @Prompt VTd abort DMA mode support.

+  gIntelSiliconPkgTokenSpaceGuid.PcdVTdSupportAbortDmaMode|FALSE|BOOLEAN|0x0000000C

+

 [PcdsFixedAtBuild, PcdsPatchableInModule]

   ## Error code for VTd error.<BR><BR>

   #  EDKII_ERROR_CODE_VTD_ERROR = (EFI_IO_BUS_UNSPECIFIED | (EFI_OEM_SPECIFIC | 0x00000000)) = 0x02008000<BR>

-- 
2.26.2.windows.1


      reply	other threads:[~2022-06-09  5:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09  5:10 [PATCH v3] IntelSiliconPkg/VTd: Add PCD for VTd Abort DMA Mode Support Sheng Wei
2022-06-09  5:20 ` Huang, Jenny [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=DM6PR11MB46273406C0B61281320B7A6AE2A79@DM6PR11MB4627.namprd11.prod.outlook.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