From nobody Sat May 18 23:14:58 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+90001+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+90001+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1653460606; cv=none; d=zohomail.com; s=zohoarc; b=N94b1DMBgB6+sURPB1FvFv5dzlH/noM8fBPAHFQC6tKCzxFkmBFjgowCuYee6WGG/88PpPrOSvNufjROSuzrvwHgfLwSYaaO4LuwoDMS3sdPiCneVVWtJv7JcbMq8gkFYB6+eR8J5hYZ5iHqQ2aLJuyLia2p++wIiNZRawy+V+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653460606; 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=HGjFOYn2qIjfiBR16N83VbN/i5U/F1sBiKRBQ4wZ+pQ=; b=RYpBEcBiRVBmPODsfRcrx4CaAnh2sgBLHiDEb+wnoAcDTs43tvI65dLzkafC8OzUS0o5g4vL8mU1jSWzKX4flKMszdwpneg7bNv5YWDzHugoWXYLiPozVqqvUXugszC64MM+yvgJo5GScZRg7wAA6rUVH4XTnx5GcMn9V0hOsXo= 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+90001+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 1653460606932263.1841517968304; Tue, 24 May 2022 23:36:46 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ctn2YY1788612x9gAZDyLBuu; Tue, 24 May 2022 23:36:46 -0700 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.3821.1653460604909043965 for ; Tue, 24 May 2022 23:36:45 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="273842123" X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="273842123" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 23:36:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="601687167" X-Received: from shwdesssddpdwei.ccr.corp.intel.com ([10.239.157.43]) by orsmga008.jf.intel.com with ESMTP; 24 May 2022 23:36:32 -0700 From: "Sheng Wei" To: devel@edk2.groups.io Cc: Robert Kowalewski , Ray Ni , Rangasai V Chaganty , Jenny Huang Subject: [edk2-devel] [PATCH v2] IntelSiliconPkg/VTd: Add PCD for VTd Abort DMA Mode Support Date: Wed, 25 May 2022 14:36:29 +0800 Message-Id: <20220525063629.1210-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: VKhSFU1X6GjNZ82j92sbpfyux1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653460606; bh=bY9wIOFkFAFOx7jux5giiyjGuA4qoY1rXkX5kUs9RIg=; h=Cc:Date:From:Reply-To:Subject:To; b=cgtBk/NTz5g82UANUJEMJEJM6E0yaQnbm51YkSPcHJ0JpdEaC68aW67ouFgNLvVsApg NtWRMij15iJF6dKAtQc3Hlgq/aY766TJjRBj1GIKkfZY80s2NVqfXM7mN546xmy9I6BQa TM2JFGMrsZ/39wT+a7GKuHozhtp95BBp6uE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653460608438100003 Content-Type: text/plain; charset="utf-8" PcdVTdSupportAbortDmaMode is used to enable/disable using VTd Abort DMA Mod= e. Signed-off-by: Sheng Wei Reviewed-by: Robert Kowalewski Cc: Ray Ni Cc: Rangasai V Chaganty Cc: Jenny Huang 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/Inte= lVTdDmar.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/Inte= lVTdDmar.c index b4c44d87..0d372f6c 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", FixedPcdGetBool = (PcdVTdSupportAbortDmaMode))); + ECapReg.Uint64 =3D MmioRead64 (VtdUnitBaseAddress + R_ECAP_REG); - DEBUG ((DEBUG_INFO, "ECapReg : 0%016lx\n", ECapReg.Uint64)); + DEBUG ((DEBUG_INFO, "ECapReg.ADMS : %d\n", ECapReg.Bits.ADMS)); =20 - if (ECapReg.Bits.ADMS =3D=3D 1) { + if ((ECapReg.Bits.ADMS =3D=3D 1) && FixedPcdGetBool (PcdVTdSupportAbortD= maMode)) { // // 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..1131f4c5 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|UINT= 32|0x0000000B =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 + [PcdsFixedAtBuild, PcdsPatchableInModule] ## Error code for VTd error.

# EDKII_ERROR_CODE_VTD_ERROR =3D (EFI_IO_BUS_UNSPECIFIED | (EFI_OEM_SPE= CIFIC | 0x00000000)) =3D 0x02008000
--=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 (#90001): https://edk2.groups.io/g/devel/message/90001 Mute This Topic: https://groups.io/mt/91328253/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-