From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web09.9083.1652259811362181997 for ; Wed, 11 May 2022 02:03:35 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=NeEoVtdE; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: w.sheng@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652259811; x=1683795811; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=O9pLcdwO5uXnvDrWRrIFp1s4g6z8A3a7ZopLD5TT4Pg=; b=NeEoVtdEbtiByM+b5QP72lijPY+m4RYY532T6k/aWa9PB2nzWMLHUx23 UoQdc4c8E7HFo9vfjM95PcS1+UPP149teGPUPYYjxdnzsVKKZ7pUapKqt L7refrDKlxM2z6I7xiRXLYHU9QH+NE96g9IqTcsAR76ggjxlrMIFyO+vA b65klf2PMsuE/0z7DNGRhSYTLAN596PtNRzYQQ4M/ENsSMl/kD0lWBWxv q/Vqc02ltIgeuHY/Kq63XbITLNgxlFhW0gFmhgTVo7zhiKyqLFfR3B4Kh Zm3xg0j3l0MzGvtJQ4tjNnqNZ/wHk1zoBNxFbGmF0EfaZTjCMslWTLCB6 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="249536911" X-IronPort-AV: E=Sophos;i="5.91,216,1647327600"; d="scan'208";a="249536911" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 02:03:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,216,1647327600"; d="scan'208";a="542217664" Received: from shwdesssddpdwei.ccr.corp.intel.com ([10.239.157.43]) by orsmga006.jf.intel.com with ESMTP; 11 May 2022 02:03:22 -0700 From: "Sheng Wei" To: devel@edk2.groups.io Cc: Ray Ni , Rangasai V Chaganty , Jenny Huang , Robert Kowalewski Subject: [PATCH] IntelSiliconPkg/VTd: Add PCD for VTd Abort DMA Mode Support Date: Wed, 11 May 2022 17:03:13 +0800 Message-Id: <20220511090313.1598-1-w.sheng@intel.com> X-Mailer: git-send-email 2.26.2.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable PcdVTdSupportAbortDmaMode is used to enable/disable VTd Abort DMA Mode. Signed-off-by: Sheng Wei Cc: Ray Ni Cc: Rangasai V Chaganty Cc: Jenny Huang Cc: Robert Kowalewski --- .../Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c | 7 +++++-- .../Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.inf | 3 ++- Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 6 ++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/Inte= lVTdDmar.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/Inte= lVTdDmar.c index b4c44d87..18c22316 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDma= r.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDma= r.c @@ -1,6 +1,6 @@ /** @file=0D =0D - Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
=0D =0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D @@ -570,10 +570,12 @@ EnableVTdTranslationProtectionBlockDma ( =0D DEBUG ((DEBUG_INFO, "EnableVTdTranslationProtectionBlockDma - 0x%08x\n",= VtdUnitBaseAddress));=0D =0D + DEBUG ((DEBUG_INFO, "PcdVTdSupportAbortDmaMode : %d\n", FeaturePcdGet (P= cdVTdSupportAbortDmaMode)));=0D +=0D ECapReg.Uint64 =3D MmioRead64 (VtdUnitBaseAddress + R_ECAP_REG);=0D DEBUG ((DEBUG_INFO, "ECapReg : 0%016lx\n", ECapReg.Uint64));=0D =0D - if (ECapReg.Bits.ADMS =3D=3D 1) {=0D + if ((ECapReg.Bits.ADMS =3D=3D 1) && FeaturePcdGet (PcdVTdSupportAbortDma= Mode)) {=0D //=0D // Use Abort DMA Mode=0D //=0D @@ -594,6 +596,7 @@ EnableVTdTranslationProtectionBlockDma ( ASSERT (FALSE);=0D return EFI_DEVICE_ERROR;=0D }=0D + DEBUG ((DEBUG_INFO, "Block All DMA by TE.\n"));=0D Status =3D EnableDmarPreMem (VtdUnitBaseAddress, (UINT64) (*RootEntryT= able));=0D }=0D =0D diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/Inte= lVTdDmarPei.inf b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei= /IntelVTdDmarPei.inf index b97ff900..473665e9 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDma= rPei.inf +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDma= rPei.inf @@ -4,7 +4,7 @@ # This driver initializes VTd engine based upon EDKII_VTD_INFO_PPI=0D # and provide DMA protection in PEI.=0D #=0D -# Copyright (c) 2020, Intel Corporation. All rights reserved.
=0D +# Copyright (c) 2022, Intel Corporation. All rights reserved.
=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D ##=0D @@ -55,6 +55,7 @@ gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask ## CONSUMES=0D gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSize ## CONSUMES=0D gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSizeS3 ## CONSUMES=0D + gIntelSiliconPkgTokenSpaceGuid.PcdVTdSupportAbortDmaMode ## CONSUMES=0D =0D [Depex]=0D gEfiPeiMasterBootModePpiGuid AND=0D diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/In= tel/IntelSiliconPkg/IntelSiliconPkg.dec index e5b785ae..92d7fa3b 100644 --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec @@ -172,3 +172,9 @@ # @Prompt The VTd PEI DMA buffer size for S3.=0D gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSizeS3|0x00200000|UINT3= 2|0x00000004=0D =0D + ## Indicates if VTd Abort DMA Mode is supported.

=0D + # TRUE - Support VTd abort DMA mode.=0D + # FALSE - Not support VTd abort DMA mode.=0D + # @Prompt VTd abort DMA mode support.=0D + gIntelSiliconPkgTokenSpaceGuid.PcdVTdSupportAbortDmaMode|TRUE|BOOLEAN|0x= 0000000C=0D +=0D --=20 2.26.2.windows.1