From: Jiewen Yao <jiewen.yao@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>
Subject: [PATCH 2/2] IntelSiliconPkg/IntelVtd: Consume VTd policy PCD
Date: Wed, 6 Sep 2017 14:39:43 +0800 [thread overview]
Message-ID: <1504679983-15536-3-git-send-email-jiewen.yao@intel.com> (raw)
In-Reply-To: <1504679983-15536-1-git-send-email-jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
---
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
next prev parent reply other threads:[~2017-09-06 6:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-06 6:39 [PATCH 0/2] Add VTd policy PCD Jiewen Yao
2017-09-06 6:39 ` [PATCH 1/2] IntelSiliconPkg/dec: " Jiewen Yao
2017-09-06 6:39 ` Jiewen Yao [this message]
2017-09-06 7:32 ` [PATCH 0/2] " Zeng, Star
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1504679983-15536-3-git-send-email-jiewen.yao@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox