Re: [edk2] [PATCH 11/15] OvmfPkg: Link separated VarCheckUefiLib NULL class library instance

2015-08-28 Thread Laszlo Ersek
On 08/28/15 04:37, Zeng, Star wrote:
 On 2015/8/26 18:57, Laszlo Ersek wrote:
 On 08/26/15 12:27, Laszlo Ersek wrote:
 Star,

 On 08/17/15 10:24, Star Zeng wrote:
 Cc: Jordan Justen jordan.l.jus...@intel.com
 Cc: Laszlo Ersek ler...@redhat.com
 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Star Zeng star.z...@intel.com
 ---
   OvmfPkg/OvmfPkgIa32.dsc| 5 -
   OvmfPkg/OvmfPkgIa32X64.dsc | 5 -
   OvmfPkg/OvmfPkgX64.dsc | 5 -
   3 files changed, 12 insertions(+), 3 deletions(-)

 diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
 index df00011..e55f0db 100644
 --- a/OvmfPkg/OvmfPkgIa32.dsc
 +++ b/OvmfPkg/OvmfPkgIa32.dsc
 @@ -461,7 +461,10 @@ [Components]

 PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.inf
 }

 MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
 -  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
 +  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
 +LibraryClasses
 +  NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
 +  }
 MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf

 MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf

 MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf

 should we use the same library instance with

MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf

 as well?

 That driver is not part of the OVMF build just yet, but I'm rebasing my
 SMM series on current master, and I'm thinking that the same library
 should *probably* be hooked into the non-privileged part of the
 SMM-flavored variable driver, ie. VariableSmmRuntimeDxe. Can you please
 confirm?

  actually I think it should be hooked into the privileged half:

MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf

 The theoretical part of the reason is that variable checking should
 occur in the protected part of the driver.

 The practical part of the reason is that the constructor of the
 VarCheckUefiLib plugin, VarCheckUefiLibNullClassConstructor(), calls
 VarCheckLibRegisterSetVariableCheckHandler(), which is defined in
 MdeModulePkg/Library/VarCheckLib/VarCheckLib.c, ie. an implementation
 of the VarCheckLib class. Ie. the plugin requires the receiving module
 to link against VarCheckLib in the first place.

 And, VariableSmmRuntimeDxe does not use that library class, only
 VariableSmm.inf does.
 
 Yes, you are right.
 VariableSmmRuntimeDxe is a wrapper based on VariableSmm, it does not do
 real variable check/get/set work.
 Vlv2TbltDevicePkg/PlatformPkgX64.dsc has the example.

Thanks!
Laszlo

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


Re: [edk2] [PATCH 11/15] OvmfPkg: Link separated VarCheckUefiLib NULL class library instance

2015-08-27 Thread Zeng, Star

On 2015/8/26 18:57, Laszlo Ersek wrote:

On 08/26/15 12:27, Laszlo Ersek wrote:

Star,

On 08/17/15 10:24, Star Zeng wrote:

Cc: Jordan Justen jordan.l.jus...@intel.com
Cc: Laszlo Ersek ler...@redhat.com
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng star.z...@intel.com
---
  OvmfPkg/OvmfPkgIa32.dsc| 5 -
  OvmfPkg/OvmfPkgIa32X64.dsc | 5 -
  OvmfPkg/OvmfPkgX64.dsc | 5 -
  3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index df00011..e55f0db 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -461,7 +461,10 @@ [Components]
PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.inf
}
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
-  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
+  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
+LibraryClasses
+  NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+  }
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf

MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf


should we use the same library instance with

   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf

as well?

That driver is not part of the OVMF build just yet, but I'm rebasing my
SMM series on current master, and I'm thinking that the same library
should *probably* be hooked into the non-privileged part of the
SMM-flavored variable driver, ie. VariableSmmRuntimeDxe. Can you please
confirm?


 actually I think it should be hooked into the privileged half:

   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf

The theoretical part of the reason is that variable checking should
occur in the protected part of the driver.

The practical part of the reason is that the constructor of the
VarCheckUefiLib plugin, VarCheckUefiLibNullClassConstructor(), calls
VarCheckLibRegisterSetVariableCheckHandler(), which is defined in
MdeModulePkg/Library/VarCheckLib/VarCheckLib.c, ie. an implementation
of the VarCheckLib class. Ie. the plugin requires the receiving module
to link against VarCheckLib in the first place.

And, VariableSmmRuntimeDxe does not use that library class, only
VariableSmm.inf does.


Yes, you are right.
VariableSmmRuntimeDxe is a wrapper based on VariableSmm, it does not do 
real variable check/get/set work.

Vlv2TbltDevicePkg/PlatformPkgX64.dsc has the example.



Thanks
Laszlo




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


Re: [edk2] [PATCH 11/15] OvmfPkg: Link separated VarCheckUefiLib NULL class library instance

2015-08-26 Thread Laszlo Ersek
Star,

On 08/17/15 10:24, Star Zeng wrote:
 Cc: Jordan Justen jordan.l.jus...@intel.com
 Cc: Laszlo Ersek ler...@redhat.com
 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Star Zeng star.z...@intel.com
 ---
  OvmfPkg/OvmfPkgIa32.dsc| 5 -
  OvmfPkg/OvmfPkgIa32X64.dsc | 5 -
  OvmfPkg/OvmfPkgX64.dsc | 5 -
  3 files changed, 12 insertions(+), 3 deletions(-)
 
 diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
 index df00011..e55f0db 100644
 --- a/OvmfPkg/OvmfPkgIa32.dsc
 +++ b/OvmfPkg/OvmfPkgIa32.dsc
 @@ -461,7 +461,10 @@ [Components]
PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.inf
}
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
 -  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
 +  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
 +LibraryClasses
 +  NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
 +  }
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf

 MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf

should we use the same library instance with

  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf

as well?

That driver is not part of the OVMF build just yet, but I'm rebasing my
SMM series on current master, and I'm thinking that the same library
should *probably* be hooked into the non-privileged part of the
SMM-flavored variable driver, ie. VariableSmmRuntimeDxe. Can you please
confirm?

Thanks
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 11/15] OvmfPkg: Link separated VarCheckUefiLib NULL class library instance

2015-08-26 Thread Laszlo Ersek
On 08/26/15 12:27, Laszlo Ersek wrote:
 Star,
 
 On 08/17/15 10:24, Star Zeng wrote:
 Cc: Jordan Justen jordan.l.jus...@intel.com
 Cc: Laszlo Ersek ler...@redhat.com
 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Star Zeng star.z...@intel.com
 ---
  OvmfPkg/OvmfPkgIa32.dsc| 5 -
  OvmfPkg/OvmfPkgIa32X64.dsc | 5 -
  OvmfPkg/OvmfPkgX64.dsc | 5 -
  3 files changed, 12 insertions(+), 3 deletions(-)

 diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
 index df00011..e55f0db 100644
 --- a/OvmfPkg/OvmfPkgIa32.dsc
 +++ b/OvmfPkg/OvmfPkgIa32.dsc
 @@ -461,7 +461,10 @@ [Components]
PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.inf
}
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
 -  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
 +  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
 +LibraryClasses
 +  NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
 +  }
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf

 MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
 
 should we use the same library instance with
 
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
 
 as well?
 
 That driver is not part of the OVMF build just yet, but I'm rebasing my
 SMM series on current master, and I'm thinking that the same library
 should *probably* be hooked into the non-privileged part of the
 SMM-flavored variable driver, ie. VariableSmmRuntimeDxe. Can you please
 confirm?

... actually I think it should be hooked into the privileged half:

  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf

The theoretical part of the reason is that variable checking should
occur in the protected part of the driver.

The practical part of the reason is that the constructor of the
VarCheckUefiLib plugin, VarCheckUefiLibNullClassConstructor(), calls
VarCheckLibRegisterSetVariableCheckHandler(), which is defined in
MdeModulePkg/Library/VarCheckLib/VarCheckLib.c, ie. an implementation
of the VarCheckLib class. Ie. the plugin requires the receiving module
to link against VarCheckLib in the first place.

And, VariableSmmRuntimeDxe does not use that library class, only
VariableSmm.inf does.

Thanks
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 11/15] OvmfPkg: Link separated VarCheckUefiLib NULL class library instance

2015-08-21 Thread Laszlo Ersek
On 08/17/15 10:24, Star Zeng wrote:
 Cc: Jordan Justen jordan.l.jus...@intel.com
 Cc: Laszlo Ersek ler...@redhat.com
 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Star Zeng star.z...@intel.com
 ---
  OvmfPkg/OvmfPkgIa32.dsc| 5 -
  OvmfPkg/OvmfPkgIa32X64.dsc | 5 -
  OvmfPkg/OvmfPkgX64.dsc | 5 -
  3 files changed, 12 insertions(+), 3 deletions(-)

Reviewed-by: Laszlo Ersek ler...@redhat.com

 diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
 index df00011..e55f0db 100644
 --- a/OvmfPkg/OvmfPkgIa32.dsc
 +++ b/OvmfPkg/OvmfPkgIa32.dsc
 @@ -461,7 +461,10 @@ [Components]
PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.inf
}
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
 -  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
 +  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
 +LibraryClasses
 +  NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
 +  }
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf

 MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
 diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
 index 355ed6a..a8fcd88 100644
 --- a/OvmfPkg/OvmfPkgIa32X64.dsc
 +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
 @@ -468,7 +468,10 @@ [Components.X64]
PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.inf
}
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
 -  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
 +  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
 +LibraryClasses
 +  NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
 +  }
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf

 MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
 diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
 index 4469bd1..63e8c12 100644
 --- a/OvmfPkg/OvmfPkgX64.dsc
 +++ b/OvmfPkg/OvmfPkgX64.dsc
 @@ -466,7 +466,10 @@ [Components]
PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.inf
}
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
 -  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
 +  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
 +LibraryClasses
 +  NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
 +  }
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf

 MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
 

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


[edk2] [PATCH 11/15] OvmfPkg: Link separated VarCheckUefiLib NULL class library instance

2015-08-17 Thread Star Zeng
Cc: Jordan Justen jordan.l.jus...@intel.com
Cc: Laszlo Ersek ler...@redhat.com
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng star.z...@intel.com
---
 OvmfPkg/OvmfPkgIa32.dsc| 5 -
 OvmfPkg/OvmfPkgIa32X64.dsc | 5 -
 OvmfPkg/OvmfPkgX64.dsc | 5 -
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index df00011..e55f0db 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -461,7 +461,10 @@ [Components]
   PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.inf
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
-  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
+  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
+LibraryClasses
+  NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+  }
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
   
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 355ed6a..a8fcd88 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -468,7 +468,10 @@ [Components.X64]
   PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.inf
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
-  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
+  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
+LibraryClasses
+  NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+  }
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
   
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 4469bd1..63e8c12 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -466,7 +466,10 @@ [Components]
   PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.inf
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
-  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
+  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
+LibraryClasses
+  NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+  }
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
   
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
-- 
1.9.5.msysgit.0

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