From nobody Sun Apr 28 17:58:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+89681+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89681+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1652259817; cv=none; d=zohomail.com; s=zohoarc; b=P33zEsuzpu0JF3Yu7e+T904IZ+K7BNKGQPc6QtvqJE6B6I99e3D9uzYkX4ZfPcF4RqH0UrjBN8aptbcT/y1gMaTsB4U+1/gxAAVEGs7lQnU+9U02J7BVlv4u+AjZ3PD2DxUseK4JUZuNnHNIofOaAqg6qvALKJWJ43F/UiFD8rE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652259817; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=+gAf2S0KqKe7k2u48yDUVPN6WnqnS793UFCanpX1xjw=; b=Z4lk82OpU1Mm0CilDTUSjwTKFM7fhEU8EK1/3E3bzDSsY3/IyrXJ3MWeAKXcXJ0P+TVnbUciZL87upXHABOl5UblNnfMsFW1ds/moqpEVm9gfmEI7rkE1FDvZWdzhFo7vVPXZz4duBbgzXkJWjS77y+Ap0Q15KPM5Z9xcO5PaDo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89681+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1652259817051426.2235906147388; Wed, 11 May 2022 02:03:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id qbI9YY1788612xwUyG9jmvB3; Wed, 11 May 2022 02:03:36 -0700 X-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 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" X-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" X-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: [edk2-devel] [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> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,w.sheng@intel.com X-Gm-Message-State: e5X3e2ZDINEvS3S3nNvIP7bax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1652259816; bh=nSjH4VJoNJnV0bg2aZreX82iCbLUZnCIylbfgvikSO0=; h=Cc:Date:From:Reply-To:Subject:To; b=G3/b4+SDvYLnojlSCFgKmOXIJYV2JVr69N7mnwpNruZP0MIYmRBx5VXXe4Bo3cGOEXq zpk2YqoFGZN77HGfNv7rZhZ16Y7ElFYCPjiudSUV4dnByhN9d520hkCqFlYpc1k9SX3Ly J+jZCi585CWqrzg11K8oTFEDLLCLleEirHM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1652259818066100001 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: 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 =20 - Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
+ Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -570,10 +570,12 @@ EnableVTdTranslationProtectionBlockDma ( =20 DEBUG ((DEBUG_INFO, "EnableVTdTranslationProtectionBlockDma - 0x%08x\n",= VtdUnitBaseAddress)); =20 + DEBUG ((DEBUG_INFO, "PcdVTdSupportAbortDmaMode : %d\n", FeaturePcdGet (P= cdVTdSupportAbortDmaMode))); + ECapReg.Uint64 =3D MmioRead64 (VtdUnitBaseAddress + R_ECAP_REG); DEBUG ((DEBUG_INFO, "ECapReg : 0%016lx\n", ECapReg.Uint64)); =20 - if (ECapReg.Bits.ADMS =3D=3D 1) { + if ((ECapReg.Bits.ADMS =3D=3D 1) && FeaturePcdGet (PcdVTdSupportAbortDma= Mode)) { // // 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 =3D EnableDmarPreMem (VtdUnitBaseAddress, (UINT64) (*RootEntryT= able)); } =20 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 # and provide DMA protection in PEI. # -# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2022, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -55,6 +55,7 @@ gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask ## CONSUMES gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSize ## CONSUMES gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSizeS3 ## CONSUMES + gIntelSiliconPkgTokenSpaceGuid.PcdVTdSupportAbortDmaMode ## CONSUMES =20 [Depex] gEfiPeiMasterBootModePpiGuid AND 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. gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSizeS3|0x00200000|UINT3= 2|0x00000004 =20 + ## Indicates if VTd Abort DMA Mode is supported.

+ # TRUE - Support VTd abort DMA mode. + # FALSE - Not support VTd abort DMA mode. + # @Prompt VTd abort DMA mode support. + gIntelSiliconPkgTokenSpaceGuid.PcdVTdSupportAbortDmaMode|TRUE|BOOLEAN|0x= 0000000C + --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89681): https://edk2.groups.io/g/devel/message/89681 Mute This Topic: https://groups.io/mt/91031568/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-