From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,483,1498546800"; d="scan'208";a="1215292588" 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 From: Jiewen Yao To: edk2-devel@lists.01.org Cc: Star Zeng 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: [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: , X-List-Received-Date: Wed, 06 Sep 2017 06:37:11 -0000 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) == 0) { + DisableDmar (); + DumpVtdRegsAll (); + } } /** diff --git a/IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.c b/IntelSiliconPkg/IntelVTdDxe/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; + if ((PcdGet8(PcdVTdPolicyPropertyMask) & BIT0) == 0) { + return EFI_UNSUPPORTED; + } + InitializeDmaProtection (); Handle = 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 +[Pcd] + gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask ## CONSUMES + [Depex] gEfiPciRootBridgeIoProtocolGuid AND gEfiAcpiSdtProtocolGuid -- 2.7.4.windows.1