From nobody Thu Dec 26 13:45:01 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1504680008130115.70638124302093; Tue, 5 Sep 2017 23:40:08 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 085CD21E47D74; Tue, 5 Sep 2017 23:37:12 -0700 (PDT) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 996CA21E47D58 for ; Tue, 5 Sep 2017 23:37:11 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2017 23:40:01 -0700 Received: from jyao1-mobl.ccr.corp.intel.com ([10.239.196.53]) by fmsmga002.fm.intel.com with ESMTP; 05 Sep 2017 23:40:00 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,483,1498546800"; d="scan'208";a="1215292588" From: Jiewen Yao To: edk2-devel@lists.01.org Date: Wed, 6 Sep 2017 14:39:43 +0800 Message-Id: <1504679983-15536-3-git-send-email-jiewen.yao@intel.com> X-Mailer: git-send-email 2.7.4.windows.1 In-Reply-To: <1504679983-15536-1-git-send-email-jiewen.yao@intel.com> References: <1504679983-15536-1-git-send-email-jiewen.yao@intel.com> Subject: [edk2] [PATCH 2/2] IntelSiliconPkg/IntelVtd: Consume VTd policy PCD X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao --- IntelSiliconPkg/IntelVTdDxe/DmaProtection.c | 7 +++++-- IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.c | 4 ++++ IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.inf | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/IntelSiliconPkg/IntelVTdDxe/DmaProtection.c b/IntelSiliconPkg/= IntelVTdDxe/DmaProtection.c index 82ed4d2..f5de01f 100644 --- a/IntelSiliconPkg/IntelVTdDxe/DmaProtection.c +++ b/IntelSiliconPkg/IntelVTdDxe/DmaProtection.c @@ -437,8 +437,11 @@ OnExitBootServices ( { DEBUG ((DEBUG_INFO, "Vtd OnExitBootServices\n")); DumpVtdRegsAll (); - DisableDmar (); - DumpVtdRegsAll (); + + if ((PcdGet8(PcdVTdPolicyPropertyMask) & BIT1) =3D=3D 0) { + DisableDmar (); + DumpVtdRegsAll (); + } } =20 /** diff --git a/IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.c b/IntelSiliconPkg/In= telVTdDxe/IntelVTdDxe.c index 24b88c3..64693a8 100644 --- a/IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.c +++ b/IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.c @@ -352,6 +352,10 @@ IntelVTdInitialize ( EFI_STATUS Status; EFI_HANDLE Handle; =20 + if ((PcdGet8(PcdVTdPolicyPropertyMask) & BIT0) =3D=3D 0) { + return EFI_UNSUPPORTED; + } + InitializeDmaProtection (); =20 Handle =3D NULL; diff --git a/IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.inf b/IntelSiliconPkg/= IntelVTdDxe/IntelVTdDxe.inf index 697932e..d45fd67 100644 --- a/IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.inf +++ b/IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.inf @@ -73,6 +73,9 @@ gEfiPciEnumerationCompleteProtocolGuid ## CONSUMES gEdkiiPlatformVTdPolicyProtocolGuid ## SOMETIMES_CONSUMES =20 +[Pcd] + gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask ## CONSUMES + [Depex] gEfiPciRootBridgeIoProtocolGuid AND gEfiAcpiSdtProtocolGuid --=20 2.7.4.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel