public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/2] Add VTd policy PCD
@ 2017-09-06  6:39 Jiewen Yao
  2017-09-06  6:39 ` [PATCH 1/2] IntelSiliconPkg/dec: " Jiewen Yao
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jiewen Yao @ 2017-09-06  6:39 UTC (permalink / raw)
  To: edk2-devel

Add PcdVTdPolicyPropertyMask
BIT0: This is to control if a platform wants to enable VTd
based protection during boot.
BIT1: This is to control if a platform wants to keep VTd
enabled at ExitBootService.

The default configuration is BIT0:1, BIT1:0.

Jiewen Yao (2):
  IntelSiliconPkg/dec: Add VTd policy PCD
  IntelSiliconPkg/IntelVtd: Consume VTd policy PCD

 IntelSiliconPkg/IntelSiliconPkg.dec         | 6 ++++++
 IntelSiliconPkg/IntelVTdDxe/DmaProtection.c | 7 +++++--
 IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.c   | 4 ++++
 IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.inf | 3 +++
 4 files changed, 18 insertions(+), 2 deletions(-)

-- 
2.7.4.windows.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] IntelSiliconPkg/dec: Add VTd policy PCD
  2017-09-06  6:39 [PATCH 0/2] Add VTd policy PCD Jiewen Yao
@ 2017-09-06  6:39 ` Jiewen Yao
  2017-09-06  6:39 ` [PATCH 2/2] IntelSiliconPkg/IntelVtd: Consume " Jiewen Yao
  2017-09-06  7:32 ` [PATCH 0/2] Add " Zeng, Star
  2 siblings, 0 replies; 4+ messages in thread
From: Jiewen Yao @ 2017-09-06  6:39 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng

BIT0: This is to control if a platform wants to enable VTd
based protection during boot.
BIT1: This is to control if a platform wants to keep VTd
enabled at ExitBootService.

The default configuration is BIT0:1, BIT1:0.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
---
 IntelSiliconPkg/IntelSiliconPkg.dec | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/IntelSiliconPkg/IntelSiliconPkg.dec b/IntelSiliconPkg/IntelSiliconPkg.dec
index 663a232..2fc6379 100644
--- a/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -44,3 +44,9 @@
   # { 0x56752da9, 0xde6b, 0x4895, 0x88, 0x19, 0x19, 0x45, 0xb6, 0xb7, 0x6c, 0x22 }
   gIntelSiliconPkgTokenSpaceGuid.PcdIntelGraphicsVbtFileGuid|{ 0xa9, 0x2d, 0x75, 0x56, 0x6b, 0xde, 0x95, 0x48, 0x88, 0x19, 0x19, 0x45, 0xb6, 0xb7, 0x6c, 0x22 }|VOID*|0x00000001
 
+  ## The mask is used to control VTd behavior.<BR><BR>
+  #  BIT0: Enable IOMMU during boot.
+  #  BIT1: Enable IOMMU on exit boot service.
+  # @Prompt The policy for VTd driver behavior.
+  gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask|1|UINT8|0x00000002
+
-- 
2.7.4.windows.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] IntelSiliconPkg/IntelVtd: Consume VTd policy PCD
  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
  2017-09-06  7:32 ` [PATCH 0/2] Add " Zeng, Star
  2 siblings, 0 replies; 4+ messages in thread
From: Jiewen Yao @ 2017-09-06  6:39 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng

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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] Add VTd policy PCD
  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 ` [PATCH 2/2] IntelSiliconPkg/IntelVtd: Consume " Jiewen Yao
@ 2017-09-06  7:32 ` Zeng, Star
  2 siblings, 0 replies; 4+ messages in thread
From: Zeng, Star @ 2017-09-06  7:32 UTC (permalink / raw)
  To: Yao, Jiewen, edk2-devel@lists.01.org; +Cc: Zeng, Star

Reviewed-by: Star Zeng <star.zeng@intel.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiewen Yao
Sent: Wednesday, September 6, 2017 2:40 PM
To: edk2-devel@lists.01.org
Subject: [edk2] [PATCH 0/2] Add VTd policy PCD

Add PcdVTdPolicyPropertyMask
BIT0: This is to control if a platform wants to enable VTd based protection during boot.
BIT1: This is to control if a platform wants to keep VTd enabled at ExitBootService.

The default configuration is BIT0:1, BIT1:0.

Jiewen Yao (2):
  IntelSiliconPkg/dec: Add VTd policy PCD
  IntelSiliconPkg/IntelVtd: Consume VTd policy PCD

 IntelSiliconPkg/IntelSiliconPkg.dec         | 6 ++++++
 IntelSiliconPkg/IntelVTdDxe/DmaProtection.c | 7 +++++--
 IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.c   | 4 ++++
 IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.inf | 3 +++
 4 files changed, 18 insertions(+), 2 deletions(-)

--
2.7.4.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-06  7:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/2] IntelSiliconPkg/IntelVtd: Consume " Jiewen Yao
2017-09-06  7:32 ` [PATCH 0/2] Add " Zeng, Star

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox