[edk2] [Patch] BaseTools: add some comment for .PrebuildEnv file's usage

2017-07-24 Thread Yonghong Zhu
This patch add some comments to explain why we use .PrebuildEnv file to
save environment variable settings set by the prebuild script.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu 
---
 BaseTools/Source/Python/build/build.py | 5 +
 1 file changed, 5 insertions(+)

diff --git a/BaseTools/Source/Python/build/build.py 
b/BaseTools/Source/Python/build/build.py
index f7634fa..4d05ee2 100644
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -1027,10 +1027,15 @@ class Build():
 
 def LaunchPrebuild(self):
 if self.Prebuild:
 EdkLogger.info("\n- Prebuild Start -\n")
 self.LaunchPrebuildFlag = True
+#
+# The purpose of .PrebuildEnv file is capture environment variable 
settings set by the prebuild script
+# and preserve them for the rest of the main build step, because 
the child process environment will
+# evaporate as soon as it exits, we cannot get it in build step.
+#
 PrebuildEnvFile = 
os.path.join(GlobalData.gConfDirectory,'.cache','.PrebuildEnv')
 if os.path.isfile(PrebuildEnvFile):
 os.remove(PrebuildEnvFile)
 if os.path.isfile(self.PlatformBuildPath):
 os.remove(self.PlatformBuildPath)
-- 
2.6.1.windows.1

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


[edk2] [Patch] BaseTools: Fix the bug that warn() function with only 1 argument

2017-07-24 Thread Yonghong Zhu
In the definition, the warn() function takes at least 2 arguments.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu 
---
 BaseTools/Source/Python/build/build.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/build/build.py 
b/BaseTools/Source/Python/build/build.py
index 1e14fb4..f7634fa 100644
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -888,11 +888,11 @@ class Build():
 ToolChainFamily = []
 ToolDefinition = self.ToolDef.ToolsDefTxtDatabase
 for Tool in self.ToolChainList:
 if TAB_TOD_DEFINES_FAMILY not in ToolDefinition or Tool not in 
ToolDefinition[TAB_TOD_DEFINES_FAMILY] \
or not ToolDefinition[TAB_TOD_DEFINES_FAMILY][Tool]:
-EdkLogger.warn("No tool chain family found in configuration 
for %s. Default to MSFT." % Tool)
+EdkLogger.warn("build", "No tool chain family found in 
configuration for %s. Default to MSFT." % Tool)
 ToolChainFamily.append("MSFT")
 else:
 
ToolChainFamily.append(ToolDefinition[TAB_TOD_DEFINES_FAMILY][Tool])
 self.ToolChainFamily = ToolChainFamily
 
-- 
2.6.1.windows.1

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


Re: [edk2] [PATCH] MdeModulePkg Xhci: Also RecoverHaltedEndpoint for BABBLE_ERROR

2017-07-24 Thread Ni, Ruiyu
Reviewed-by: Ruiyu Ni 

Thanks/Ray

> -Original Message-
> From: Zeng, Star
> Sent: Tuesday, July 25, 2017 11:27 AM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star ; Vladimir Olovyannikov
> ; Ni, Ruiyu 
> Subject: [PATCH] MdeModulePkg Xhci: Also RecoverHaltedEndpoint for
> BABBLE_ERROR
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=644
> 
> According to XHCI spec:
> 4.10.2.1 Stall Error
> 
> 4.10.2.4 Babble Detected Error
> When a device transmits more data on the USB than the host controller is
> expecting for a transaction, it is defined to be babbling.
> In general, this is called a Babble Error. When a device sends more data than
> the TD Transfer Size bytes (TD Babble), unexpected activity that persists
> beyond a specified point in a (micro)frame (Frame Babble), or a packet
> greater than Max Packet Size (Packet Babble), the host controller shall set
> the Babble Detected Error in the Completion Code field of the TRB, generate
> an Error Event, and halt the endpoint (refer to Section 4.10.2.1).
> 
> This patch is to also check for EFI_USB_ERR_BABBLE error returned as a
> TransferResult and then proceed to XhcRecoverhaltedEndPoint.
> 
> Cc: Vladimir Olovyannikov 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Star Zeng 
> ---
>  MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c| 2 +-
>  MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
> b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
> index 20ad3f161197..c884f4c3146c 100644
> --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
> +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
> @@ -801,7 +801,7 @@ XhcTransfer (
>*TransferResult = Urb->Result;
>*DataLength = Urb->Completed;
> 
> -  if (*TransferResult == EFI_USB_ERR_STALL) {
> +  if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult ==
> + EFI_USB_ERR_BABBLE)) {
>  ASSERT (Status == EFI_DEVICE_ERROR);
>  RecoveryStatus = XhcRecoverHaltedEndpoint(Xhc, Urb);
>  if (EFI_ERROR (RecoveryStatus)) {
> diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
> b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
> index 57e70701e826..38f0d2184cff 100644
> --- a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
> +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
> @@ -2,7 +2,7 @@
>  PEIM to produce gPeiUsb2HostControllerPpiGuid based on
> gPeiUsbControllerPpiGuid  which is used to enable recovery function from
> USB Drivers.
> 
> -Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
> 
>  This program and the accompanying materials  are licensed and made
> available under the terms and conditions @@ -666,7 +666,7 @@
> XhcPeiControlTransfer (
>} else {
>  if (*TransferResult == EFI_USB_NOERROR) {
>Status = EFI_SUCCESS;
> -} else if (*TransferResult == EFI_USB_ERR_STALL) {
> +} else if ((*TransferResult == EFI_USB_ERR_STALL) ||
> + (*TransferResult == EFI_USB_ERR_BABBLE)) {
>RecoveryStatus = XhcPeiRecoverHaltedEndpoint(Xhc, Urb);
>if (EFI_ERROR (RecoveryStatus)) {
>  DEBUG ((EFI_D_ERROR, "XhcPeiControlTransfer:
> XhcPeiRecoverHaltedEndpoint failed\n")); @@ -988,7 +988,7 @@
> XhcPeiBulkTransfer (
>} else {
>  if (*TransferResult == EFI_USB_NOERROR) {
>Status = EFI_SUCCESS;
> -} else if (*TransferResult == EFI_USB_ERR_STALL) {
> +} else if ((*TransferResult == EFI_USB_ERR_STALL) ||
> + (*TransferResult == EFI_USB_ERR_BABBLE)) {
>RecoveryStatus = XhcPeiRecoverHaltedEndpoint(Xhc, Urb);
>if (EFI_ERROR (RecoveryStatus)) {
>  DEBUG ((EFI_D_ERROR, "XhcPeiBulkTransfer:
> XhcPeiRecoverHaltedEndpoint failed\n"));
> --
> 2.7.0.windows.1

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


[edk2] [PATCH] MdeModulePkg Xhci: Also RecoverHaltedEndpoint for BABBLE_ERROR

2017-07-24 Thread Star Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=644

According to XHCI spec:
4.10.2.1 Stall Error

4.10.2.4 Babble Detected Error
When a device transmits more data on the USB than the host controller
is expecting for a transaction, it is defined to be babbling.
In general, this is called a Babble Error. When a device sends more
data than the TD Transfer Size bytes (TD Babble), unexpected activity
that persists beyond a specified point in a (micro)frame (Frame Babble),
or a packet greater than Max Packet Size (Packet Babble), the host
controller shall set the Babble Detected Error in the Completion Code
field of the TRB, generate an Error Event, and halt the endpoint
(refer to Section 4.10.2.1).

This patch is to also check for EFI_USB_ERR_BABBLE error returned as
a TransferResult and then proceed to XhcRecoverhaltedEndPoint.

Cc: Vladimir Olovyannikov 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng 
---
 MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c| 2 +-
 MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c 
b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
index 20ad3f161197..c884f4c3146c 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
@@ -801,7 +801,7 @@ XhcTransfer (
   *TransferResult = Urb->Result;
   *DataLength = Urb->Completed;
 
-  if (*TransferResult == EFI_USB_ERR_STALL) {
+  if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == 
EFI_USB_ERR_BABBLE)) {
 ASSERT (Status == EFI_DEVICE_ERROR);
 RecoveryStatus = XhcRecoverHaltedEndpoint(Xhc, Urb);
 if (EFI_ERROR (RecoveryStatus)) {
diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c 
b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
index 57e70701e826..38f0d2184cff 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
+++ b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
@@ -2,7 +2,7 @@
 PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
 which is used to enable recovery function from USB Drivers.
 
-Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
 
 This program and the accompanying materials
 are licensed and made available under the terms and conditions
@@ -666,7 +666,7 @@ XhcPeiControlTransfer (
   } else {
 if (*TransferResult == EFI_USB_NOERROR) {
   Status = EFI_SUCCESS;
-} else if (*TransferResult == EFI_USB_ERR_STALL) {
+} else if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == 
EFI_USB_ERR_BABBLE)) {
   RecoveryStatus = XhcPeiRecoverHaltedEndpoint(Xhc, Urb);
   if (EFI_ERROR (RecoveryStatus)) {
 DEBUG ((EFI_D_ERROR, "XhcPeiControlTransfer: 
XhcPeiRecoverHaltedEndpoint failed\n"));
@@ -988,7 +988,7 @@ XhcPeiBulkTransfer (
   } else {
 if (*TransferResult == EFI_USB_NOERROR) {
   Status = EFI_SUCCESS;
-} else if (*TransferResult == EFI_USB_ERR_STALL) {
+} else if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == 
EFI_USB_ERR_BABBLE)) {
   RecoveryStatus = XhcPeiRecoverHaltedEndpoint(Xhc, Urb);
   if (EFI_ERROR (RecoveryStatus)) {
 DEBUG ((EFI_D_ERROR, "XhcPeiBulkTransfer: XhcPeiRecoverHaltedEndpoint 
failed\n"));
-- 
2.7.0.windows.1

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


Re: [edk2] [Patch v4 5/6] edk2: Move License.txt file to root

2017-07-24 Thread Kinney, Michael D
This patch has one error. The OvmfPkg/License.txt
should not be deleted.  I have already fixed this 
issue locally.

Mike

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On
> Behalf Of Michael D Kinney
> Sent: Monday, July 24, 2017 4:45 PM
> To: edk2-devel@lists.01.org
> Cc: Justen, Jordan L ; Andrew Fish
> ; Leif Lindholm 
> Subject: [edk2] [Patch v4 5/6] edk2: Move License.txt file to
> root
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=642
> 
> Add top level License.txt file with the BSD 2-Clause
> License that is used by the majority of the EKD II open
> source project content.  Merge copyright statements
> from the BSD 2-Clause License files in each package
> directory and remove the duplication License.txt
> file from package directories.
> 
> Cc: Leif Lindholm 
> Cc: Andrew Fish 
> Cc: Jordan Justen 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Michael D Kinney 
> ---
>  AppPkg/License.txt | 25 -
>  ArmPkg/License.txt | 26 --
>  ArmPlatformPkg/License.txt | 25 -
>  BaseTools/License.txt  | 25 -
>  BeagleBoardPkg/License.txt | 26 --
>  CorebootModulePkg/License.txt  | 25 -
>  CorebootPayloadPkg/License.txt | 25 -
>  CryptoPkg/License.txt  | 25 -
>  DuetPkg/License.txt| 25 -
>  EdkCompatibilityPkg/License.txt| 29 
>  EdkShellBinPkg/License.txt | 25 -
>  EdkShellPkg/License.txt| 25 -
>  EmbeddedPkg/License.txt| 26 --
>  EmulatorPkg/License.txt| 25 -
>  FatBinPkg/License.txt  | 25 -
>  FatPkg/License.txt | 25 -
>  IntelFrameworkModulePkg/License.txt| 25 -
>  IntelFrameworkPkg/License.txt  | 25 -
>  IntelFsp2Pkg/License.txt   | 25 -
>  IntelFsp2WrapperPkg/License.txt| 25 -
>  IntelFspPkg/License.txt| 25 -
>  IntelFspWrapperPkg/License.txt | 25 -
>  IntelSiliconPkg/License.txt| 25 -
>  ArmVirtPkg/License.txt => License.txt  |  6 ++--
>  MdeModulePkg/License.txt   | 25 -
>  MdePkg/License.txt | 25 -
>  NetworkPkg/License.txt | 25 -
>  Nt32Pkg/License.txt| 25 -
>  Omap35xxPkg/License.txt| 26 --
>  OptionRomPkg/License.txt   | 25 -
>  OvmfPkg/License.txt| 50 
> --
>  PcAtChipsetPkg/License.txt | 25 -
>  PerformancePkg/License.txt | 25 -
>  QuarkPlatformPkg/License.txt   | 25 -
>  QuarkSocPkg/License.txt| 25 -
>  SecurityPkg/License.txt| 25 -
>  ShellBinPkg/License.txt| 25 -
>  ShellPkg/License.txt   | 25 -
>  SignedCapsulePkg/License.txt   | 25 -
>  SourceLevelDebugPkg/License.txt| 25 -
>  StdLib/License.txt | 25 -
>  StdLibPrivateInternalFiles/License.txt | 25 -
>  UefiCpuPkg/License.txt | 25 -
>  Vlv2DeviceRefCodePkg/License.txt   | 25 -
>  Vlv2TbltDevicePkg/License.txt  | 25 -
>  45 files changed, 3 insertions(+), 1136 deletions(-)
>  delete mode 100644 AppPkg/License.txt
>  delete mode 100644 ArmPkg/License.txt
>  delete mode 100644 ArmPlatformPkg/License.txt
>  delete mode 100644 BaseTools/License.txt
>  delete mode 100644 BeagleBoardPkg/License.txt
>  delete mode 100644 CorebootModulePkg/License.txt
>  delete mode 100644 CorebootPayloadPkg/License.txt
>  delete mode 100644 CryptoPkg/License.txt
>  delete mode 100644 DuetPkg/License.txt
>  delete mode 100644 EdkCompatibilityPkg/License.txt
>  delete mode 100644 EdkShellBinPkg/License.txt
>  delete mode 100644 EdkShellPkg/License.txt
>  delete mode 100644 EmbeddedPkg/License.txt
>  delete mode 100644 EmulatorPkg/License.txt
>  delete mode 100644 FatBinPkg/License.txt
>  delete mode 100644 FatPkg/License.txt
>  delete mode 100644 IntelFrameworkModulePkg/License.txt
>  delete mode 100644 IntelFrameworkPkg/License.txt
>  delete mode 100644 IntelFsp2Pkg/License.txt
>  delete mode 100644 IntelFsp2WrapperPkg/License.txt
>  delete mode 100644 IntelFspPkg/License.txt
>  delete mode 100644 IntelFspWrapperPkg

[edk2] [Patch v4 6/6] edk2: Add Readme.md to root of edk2 repository

2017-07-24 Thread Michael D Kinney
https://bugzilla.tianocore.org/show_bug.cgi?id=643

Add Readme.md with a brief description of the EDK II
open source project along with links to contribution
agreement, licenses, and resources.

Cc: Leif Lindholm 
Cc: Andrew Fish 
Cc: Jordan Justen 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 
---
 Readme.md | 28 
 1 file changed, 28 insertions(+)
 create mode 100644 Readme.md

diff --git a/Readme.md b/Readme.md
new file mode 100644
index 00..f779e8d458
--- /dev/null
+++ b/Readme.md
@@ -0,0 +1,28 @@
+# EDK II Project
+
+A modern, feature-rich, cross-platform firmware development environment
+for the UEFI and PI specifications from www.uefi.org.
+
+Contributions to the EDK II open source project are covered by the
+[TianoCore Contribution Agreement 1.1](Contributions.txt)
+
+The majority of the content in the EDK II open source project uses a
+[BSD 2-Clause License](License.txt).  The EDK II open source project contains
+the following components that are covered by additional licenses:
+* 
[AppPkg/Applications/Python/Python-2.7.2/Tools/pybench](AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/LICENSE)
+* 
[AppPkg/Applications/Python/Python-2.7.2](AppPkg/Applications/Python/Python-2.7.2/LICENSE)
+* 
[AppPkg/Applications/Python/Python-2.7.10](AppPkg/Applications/Python/Python-2.7.10/LICENSE)
+* 
[BaseTools/Source/C/BrotliCompress](BaseTools/Source/C/BrotliCompress/LICENSE)
+* 
[MdeModulePkg/Library/BrotliCustomDecompressLib](MdeModulePkg/Library/BrotliCustomDecompressLib/LICENSE)
+* [OvmfPkg/Include/IndustryStandard/Xen](OvmfPkg/License.txt)
+* [OvmfPkg/XenBusDxe](OvmfPkg/License.txt)
+* [OvmfPkg/XenPvBlkDxe](OvmfPkg/License.txt)
+* 
[CryptoPkg/Library/OpensslLib/openssl](CryptoPkg/Library/OpensslLib/openssl/LICENSE)
+
+# Resources
+* [TianoCore](http://www.tianocore.org)
+* [EDK II](https://github.com/tianocore/tianocore.github.io/wiki/EDK-II)
+* [Getting Started with EDK 
II](https://github.com/tianocore/tianocore.github.io/wiki/Getting-Started-with-EDK-II)
+* [Mailing 
Lists](https://github.com/tianocore/tianocore.github.io/wiki/Mailing-Lists)
+* [TianoCore Bugzilla](https://bugzilla.tianocore.org)
+* [How To 
Contribute](https://github.com/tianocore/tianocore.github.io/wiki/How-To-Contribute)
-- 
2.13.1.windows.2

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


[edk2] [Patch v4 5/6] edk2: Move License.txt file to root

2017-07-24 Thread Michael D Kinney
https://bugzilla.tianocore.org/show_bug.cgi?id=642

Add top level License.txt file with the BSD 2-Clause
License that is used by the majority of the EKD II open
source project content.  Merge copyright statements
from the BSD 2-Clause License files in each package
directory and remove the duplication License.txt
file from package directories.

Cc: Leif Lindholm 
Cc: Andrew Fish 
Cc: Jordan Justen 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 
---
 AppPkg/License.txt | 25 -
 ArmPkg/License.txt | 26 --
 ArmPlatformPkg/License.txt | 25 -
 BaseTools/License.txt  | 25 -
 BeagleBoardPkg/License.txt | 26 --
 CorebootModulePkg/License.txt  | 25 -
 CorebootPayloadPkg/License.txt | 25 -
 CryptoPkg/License.txt  | 25 -
 DuetPkg/License.txt| 25 -
 EdkCompatibilityPkg/License.txt| 29 
 EdkShellBinPkg/License.txt | 25 -
 EdkShellPkg/License.txt| 25 -
 EmbeddedPkg/License.txt| 26 --
 EmulatorPkg/License.txt| 25 -
 FatBinPkg/License.txt  | 25 -
 FatPkg/License.txt | 25 -
 IntelFrameworkModulePkg/License.txt| 25 -
 IntelFrameworkPkg/License.txt  | 25 -
 IntelFsp2Pkg/License.txt   | 25 -
 IntelFsp2WrapperPkg/License.txt| 25 -
 IntelFspPkg/License.txt| 25 -
 IntelFspWrapperPkg/License.txt | 25 -
 IntelSiliconPkg/License.txt| 25 -
 ArmVirtPkg/License.txt => License.txt  |  6 ++--
 MdeModulePkg/License.txt   | 25 -
 MdePkg/License.txt | 25 -
 NetworkPkg/License.txt | 25 -
 Nt32Pkg/License.txt| 25 -
 Omap35xxPkg/License.txt| 26 --
 OptionRomPkg/License.txt   | 25 -
 OvmfPkg/License.txt| 50 --
 PcAtChipsetPkg/License.txt | 25 -
 PerformancePkg/License.txt | 25 -
 QuarkPlatformPkg/License.txt   | 25 -
 QuarkSocPkg/License.txt| 25 -
 SecurityPkg/License.txt| 25 -
 ShellBinPkg/License.txt| 25 -
 ShellPkg/License.txt   | 25 -
 SignedCapsulePkg/License.txt   | 25 -
 SourceLevelDebugPkg/License.txt| 25 -
 StdLib/License.txt | 25 -
 StdLibPrivateInternalFiles/License.txt | 25 -
 UefiCpuPkg/License.txt | 25 -
 Vlv2DeviceRefCodePkg/License.txt   | 25 -
 Vlv2TbltDevicePkg/License.txt  | 25 -
 45 files changed, 3 insertions(+), 1136 deletions(-)
 delete mode 100644 AppPkg/License.txt
 delete mode 100644 ArmPkg/License.txt
 delete mode 100644 ArmPlatformPkg/License.txt
 delete mode 100644 BaseTools/License.txt
 delete mode 100644 BeagleBoardPkg/License.txt
 delete mode 100644 CorebootModulePkg/License.txt
 delete mode 100644 CorebootPayloadPkg/License.txt
 delete mode 100644 CryptoPkg/License.txt
 delete mode 100644 DuetPkg/License.txt
 delete mode 100644 EdkCompatibilityPkg/License.txt
 delete mode 100644 EdkShellBinPkg/License.txt
 delete mode 100644 EdkShellPkg/License.txt
 delete mode 100644 EmbeddedPkg/License.txt
 delete mode 100644 EmulatorPkg/License.txt
 delete mode 100644 FatBinPkg/License.txt
 delete mode 100644 FatPkg/License.txt
 delete mode 100644 IntelFrameworkModulePkg/License.txt
 delete mode 100644 IntelFrameworkPkg/License.txt
 delete mode 100644 IntelFsp2Pkg/License.txt
 delete mode 100644 IntelFsp2WrapperPkg/License.txt
 delete mode 100644 IntelFspPkg/License.txt
 delete mode 100644 IntelFspWrapperPkg/License.txt
 delete mode 100644 IntelSiliconPkg/License.txt
 rename ArmVirtPkg/License.txt => License.txt (94%)
 delete mode 100644 MdeModulePkg/License.txt
 delete mode 100644 MdePkg/License.txt
 delete mode 100644 NetworkPkg/License.txt
 delete mode 100644 Nt32Pkg/License.txt
 delete mode 100644 Omap35xxPkg/License.txt
 delete mode 100644 OptionRomPkg/License.txt
 delete mode 100644 OvmfPkg/License.txt
 delete mode 100644 PcAtChipsetPkg/License.txt
 delete mode 100644 PerformancePkg/License.txt
 delete mode 100644 QuarkPlatformPkg/License.txt
 delete mode 100644 QuarkSocPkg/License.txt
 delete mode 10

[edk2] [Patch v4 3/6] edk2: Update to TianoCore Contribution Agreement 1.1

2017-07-24 Thread Michael D Kinney
https://bugzilla.tianocore.org/show_bug.cgi?id=629

Update the TianoCore Contribution Agreement from Version 1.0
to Version 1.1 to cover open source documentation associated
with the TianoCore project.

Version 1.0 covers source code files.  Version 1.1 is a
backwards compatible extension that adds support for document
files in both source form and compiled form.

The edk2 repository is updated so the same contribution
agreement is used by developers that work on TianoCore
related source code or TianoCore related documents.

Links to RFC and Wiki on the GitBook documentation process
* https://lists.01.org/pipermail/edk2-devel/2017-March/008654.html
* https://github.com/tianocore-docs/edk2-TemplateSpecification/wiki

Cc: Leif Lindholm 
Cc: Andrew Fish 
Cc: Jordan Justen 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 
---
 Contributions.txt | 43 ++-
 1 file changed, 30 insertions(+), 13 deletions(-)

diff --git a/Contributions.txt b/Contributions.txt
index f87cbd73c6..e52fd1adcc 100644
--- a/Contributions.txt
+++ b/Contributions.txt
@@ -1,4 +1,3 @@
-
 ==
 = Code Contributions =
 ==
@@ -12,7 +11,7 @@ To make a contribution to a TianoCore project, follow these 
steps.
contribution is made under the terms of the specified
contribution agreement.  Your "Contributed-under" message
must include the name of contribution agreement and version.
-   For example: Contributed-under: TianoCore Contribution Agreement 1.0
+   For example: Contributed-under: TianoCore Contribution Agreement 1.1
The "TianoCore Contribution Agreement" is included below in
this document.
 4. Submit your code to the TianoCore project using the process
@@ -28,6 +27,10 @@ To make a contribution to a TianoCore project, follow these 
steps.
* Python-2.0: http://opensource.org/licenses/Python-2.0
* Zlib: http://opensource.org/licenses/Zlib
 
+   For documentation:
+   * FreeBSD Documentation License
+ https://www.freebsd.org/copyright/freebsd-doc-license.html
+
Contributions of code put into the public domain can also be
accepted.
 
@@ -47,11 +50,11 @@ and the "Contributed-under" message.
 === Start of sample patch email message ===
 
 From: Contributor Name 
-Subject: [PATCH] CodeModule: Brief-single-line-summary
+Subject: [Repository/Branch PATCH] CodeModule: Brief-single-line-summary
 
 Full-commit-message
 
-Contributed-under: TianoCore Contribution Agreement 1.0
+Contributed-under: TianoCore Contribution Agreement 1.1
 Signed-off-by: Contributor Name 
 ---
 
@@ -65,29 +68,37 @@ Patch content inline or attached
 === Notes for sample patch email ===
 
 * The first line of commit message is taken from the email's subject
-  line following [PATCH]. The remaining portion of the commit message
+  line following [Repository/Branch PATCH]. The remaining portion of the 
commit message
   is the email's content until the '---' line.
 * git format-patch is one way to create this format
 
 === Definitions for sample patch email ===
 
-* "CodeModule" is a short idenfier for the affected code.  For
-  example MdePkg, or MdeModulePkg UsbBusDxe.
+* "Repository" is the identifier of the repository the patch applies.
+  This identifier should only be provided for repositories other than
+  'edk2'. For example 'edk2-BuildSpecification' or 'staging'.
+* "Branch" is the identifier of the branch the patch applies. This
+  identifier should only be provided for branches other than 'edk2/master'.
+  For example 'edk2/UDK2015', 'edk2-BuildSpecification/release/1.27', or
+  'staging/edk2-test'.
+* "CodeModule" is a short identifier for the affected code. This identifier
+  should not be provided for documentation patches. For example 'MdePkg',
+  or 'MdeModulePkg/UsbBusDxe'
 * "Brief-single-line-summary" is a short summary of the change.
 * The entire first line should be less than ~70 characters.
 * "Full-commit-message" a verbose multiple line comment describing
   the change.  Each line should be less than ~70 characters.
-* "Contributed-under" explicitely states that the contribution is
-  made under the terms of the contribtion agreement.  This
+* "Contributed-under" explicitly states that the contribution is
+  made under the terms of the contribution agreement. This
   agreement is included below in this document.
 * "Signed-off-by" is the contributor's signature identifying them
   by their real/legal name and their email address.
 
 
-= TianoCore Contribution Agreement 1.0 =
+= TianoCore Contribution Agreement 1.1 =
 
 
-INTEL CORPORATION ("INTEL") MAKES AVAILABLE SOFTWARE, DOCUMENTATION,
+INTEL CORPORATION ("INTEL") MAKES AVAILABLE SOFTWARE, DOCUMENTATION 
("DOCUMENTATION"),
 INFORMATION AND/OR OTHER MATERIALS FOR USE IN THE TIANOCORE OPEN SOURCE
 PROJECT (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE
 TER

[edk2] [Patch v4 4/6] edk2: Reformat TianoCore Contribution Agreement 1.1

2017-07-24 Thread Michael D Kinney
https://bugzilla.tianocore.org/show_bug.cgi?id=629

Update formatting of Contributions.txt to line wrap
at 80 columns.

Cc: Leif Lindholm 
Cc: Andrew Fish 
Cc: Jordan Justen 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 
---
 Contributions.txt | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/Contributions.txt b/Contributions.txt
index e52fd1adcc..44b3787550 100644
--- a/Contributions.txt
+++ b/Contributions.txt
@@ -68,8 +68,8 @@ Patch content inline or attached
 === Notes for sample patch email ===
 
 * The first line of commit message is taken from the email's subject
-  line following [Repository/Branch PATCH]. The remaining portion of the 
commit message
-  is the email's content until the '---' line.
+  line following [Repository/Branch PATCH]. The remaining portion of the
+  commit message is the email's content until the '---' line.
 * git format-patch is one way to create this format
 
 === Definitions for sample patch email ===
@@ -98,22 +98,22 @@ Patch content inline or attached
 = TianoCore Contribution Agreement 1.1 =
 
 
-INTEL CORPORATION ("INTEL") MAKES AVAILABLE SOFTWARE, DOCUMENTATION 
("DOCUMENTATION"),
-INFORMATION AND/OR OTHER MATERIALS FOR USE IN THE TIANOCORE OPEN SOURCE
-PROJECT (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE
-TERMS AND CONDITIONS OF THIS AGREEMENT BETWEEN YOU AND INTEL AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR
-REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE
-CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS
+INTEL CORPORATION ("INTEL") MAKES AVAILABLE SOFTWARE, DOCUMENTATION
+("DOCUMENTATION"), INFORMATION AND/OR OTHER MATERIALS FOR USE IN THE
+TIANOCORE OPEN SOURCE PROJECT (COLLECTIVELY "CONTENT"). USE OF THE CONTENT
+IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT BETWEEN YOU AND
+INTEL AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES
+INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR
+USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND
+CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR
+REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS
 AGREEMENT AND THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
 AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT
 USE THE CONTENT.
 
-Unless otherwise indicated, all Content (except Documentation) made available 
on the TianoCore
-site is provided to you under the terms and conditions of the BSD
-License ("BSD"). A copy of the BSD License is available at
+Unless otherwise indicated, all Content (except Documentation) made available
+on the TianoCore site is provided to you under the terms and conditions of the
+BSD License ("BSD"). A copy of the BSD License is available at
 http://opensource.org/licenses/bsd-license.php
 or when applicable, in the associated License.txt file.
 
-- 
2.13.1.windows.2

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


[edk2] [Patch v4 1/6] BaseTools/PatchCheck: Support Contribution Agreement 1.1

2017-07-24 Thread Michael D Kinney
https://bugzilla.tianocore.org/show_bug.cgi?id=628

Update PatchCheck.py to support either
"Contributed-under: TianoCore Contribution Agreement 1.0"
or "Contributed-under: TianoCore Contribution Agreement 1.1"
in the commit message.

Temporarily continue to allow the TianoCore Contribution
Agreement 1.0 agreement.

Cc: Leif Lindholm 
Cc: Andrew Fish 
Cc: Jordan Justen 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 
---
 BaseTools/Scripts/PatchCheck.py | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 7bc5736dbf..43bfc2495c 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -75,10 +75,13 @@ class CommitMessageCheck:
 count += 1
 
 def check_contributed_under(self):
-cu_msg='Contributed-under: TianoCore Contribution Agreement 1.0'
+cu_msg='Contributed-under: TianoCore Contribution Agreement 1.1'
 if self.msg.find(cu_msg) < 0:
-self.error('Missing Contributed-under! (Note: this must be ' +
-   'added by the code contributor!)')
+# Allow 1.0 for now while EDK II community transitions to 1.1
+cu_msg='Contributed-under: TianoCore Contribution Agreement 1.0'
+if self.msg.find(cu_msg) < 0:
+self.error('Missing Contributed-under! (Note: this must be ' +
+   'added by the code contributor!)')
 
 @staticmethod
 def make_signature_re(sig, re_input=False):
-- 
2.13.1.windows.2

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


[edk2] [Patch V4 0/6] Update to Tiano Contribution Agreement 1.1

2017-07-24 Thread Michael D Kinney
https://bugzilla.tianocore.org/show_bug.cgi?id=628
https://bugzilla.tianocore.org/show_bug.cgi?id=629
https://bugzilla.tianocore.org/show_bug.cgi?id=642
https://bugzilla.tianocore.org/show_bug.cgi?id=643

New in V4
* Revert changes to OvmfPkg License.txt files.  OvmfPkg is back to its
  original state with MIT license for XEN content in OvmfPkg/License.txt.
* Revert change to remove commit message details from Contributions.txt.
  Instead, this section has been updated to support both code and documentation
  patches.
* Remove commit message details from Readme.md.

New in V3
* Merge patch that moves Contribution.txt to root with patch that deletes
  Contribution.txt from packages. 
* Add Readme.md with commit message content that was removed from
  Contributions.txt
* Add MIT License.txt files for XEN related components in OvmfPkg to those
  components.
* Add BSD 2-Clause License.txt file to root of edk2 repo so it can be referenced
  from Readme.md in root of edk2 repo.
* Remove duplicate BSD 2-Clause License.txt from packages.  
  
New in V2
* Reorder checks in PatchCheck.py and add comments
* Split patch series up into more patches
* Add more detailed reason for change to commit messages 
* Rename CONTRIBUTIONS.TXT to Contributions.txt
* Reformat Contributions.txt to wrap at 80 columns

This series updates the contribution agreement from the
Tiano Contribution Agreement 1.0 to the Tiano Contribution
Agreement 1.1.  In addition, the duplication of the 
Contributions.txt file is removed and a single version of
Contributions.txt is added to the root of the edk2 repository.

The BaseTools/Scripts/PatchCheck.py tool is also updated to 
support the Tiano Contribution Agreement 1.1.

The RFC email discussion that covers the new contribution
agreement can be found here:

https://lists.01.org/pipermail/edk2-devel/2017-March/008924.html

This new agreement does not have any changes for code contributions.
It adds content to cover open source documentation contributions.

Cc: Leif Lindholm 
Cc: Andrew Fish 
Cc: Jordan Justen 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 

Michael D Kinney (6):
  BaseTools/PatchCheck: Support Contribution Agreement 1.1
  edk2: Move TianoCore Contribution Agreement to root
  edk2: Update to TianoCore Contribution Agreement 1.1
  edk2: Reformat TianoCore Contribution Agreement 1.1
  edk2: Move License.txt file to root
  edk2: Add Readme.md to root of edk2 repository

 AppPkg/License.txt|  25 ---
 ArmPkg/Contributions.txt  | 218 --
 ArmPkg/License.txt|  26 ---
 ArmPlatformPkg/Contributions.txt  | 218 --
 ArmPlatformPkg/License.txt|  25 ---
 ArmVirtPkg/Contributions.txt  | 218 --
 BaseTools/Contributions.txt   | 218 --
 BaseTools/License.txt |  25 ---
 BaseTools/Scripts/PatchCheck.py   |   9 +-
 BeagleBoardPkg/Contributions.txt  | 218 --
 BeagleBoardPkg/License.txt|  26 ---
 AppPkg/Contributions.txt => Contributions.txt |  65 +---
 CorebootModulePkg/Contributions.txt   | 218 --
 CorebootModulePkg/License.txt |  25 ---
 CorebootPayloadPkg/Contributions.txt  | 218 --
 CorebootPayloadPkg/License.txt|  25 ---
 CryptoPkg/Contributions.txt   | 218 --
 CryptoPkg/License.txt |  25 ---
 DuetPkg/Contributions.txt | 218 --
 DuetPkg/License.txt   |  25 ---
 EdkCompatibilityPkg/Contributions.txt | 218 --
 EdkCompatibilityPkg/License.txt   |  29 
 EdkShellBinPkg/Contributions.txt  | 218 --
 EdkShellBinPkg/License.txt|  25 ---
 EdkShellPkg/Contributions.txt | 218 --
 EdkShellPkg/License.txt   |  25 ---
 EmbeddedPkg/Contributions.txt | 218 --
 EmbeddedPkg/License.txt   |  26 ---
 EmulatorPkg/Contributions.txt | 218 --
 EmulatorPkg/License.txt   |  25 ---
 FatBinPkg/Contributions.txt   | 218 --
 FatBinPkg/License.txt |  25 ---
 FatPkg/Contributions.txt  | 218 --
 FatPkg/License.txt|  25 ---
 IntelFrameworkModulePkg/Contributions.txt | 218 --
 IntelFrameworkModulePkg/License.txt   |  25 ---
 IntelFrameworkPkg/Contributions.txt   | 218 ---

Re: [edk2] [Patch V3 3/8] edk2: Remove commit message details from Contributions.txt

2017-07-24 Thread Jordan Justen
On 2017-07-24 13:01:00, Kinney, Michael D wrote:
> > -Original Message-
> > From: Justen, Jordan L
> > Sent: Monday, July 24, 2017 12:34 PM
> > 
> > Could a [PATCH] email sent to edk2-devel be assumed to be for
> > edk2/master? I think this is a good 'default' to have since it
> > covers the majority of patches.
> 
> Yes.  See details below for when it is optional.

Whoops. Yes, that sounds good.

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


Re: [edk2] [Patch V3 3/8] edk2: Remove commit message details from Contributions.txt

2017-07-24 Thread Kinney, Michael D
> -Original Message-
> From: Justen, Jordan L
> Sent: Monday, July 24, 2017 12:34 PM
> To: Kinney, Michael D ; Leif Lindholm
> 
> Cc: edk2-devel@lists.01.org; Andrew Fish 
> Subject: RE: [edk2] [Patch V3 3/8] edk2: Remove commit message
> details from Contributions.txt
> 
> On 2017-07-24 11:13:52, Kinney, Michael D wrote:
> > Hi Leif,
> >
> > I was attempting to keep the number of top level files to a
> minimum
> > and also attempt to use the same Contributions.txt file for
> both
> > source code repositories and document repositories.
> >
> > The set of files I am proposing be at the root of repositories
> are:
> >
> > * Readme.md
> > * License.txt
> > * Contributions.txt
> >
> > My first attempt at this was to move some of the commit message
> > details that are slightly different between source code and
> > documentation from Contributions.txt to the Readme.md and the
> > Readme.md also provides links to the wiki pages with even more
> > details.
> >
> > I am seeing feedback that there is a desire to retain the
> commit
> > message format details in Contributions.txt.  How about the
> following
> > approach for updates to Contributions.txt:
> >
> > 1) Update Contribution Agreement section from 1.0 to 1.1 to add
> >support for TianoCore Documentation.
> >
> > 2) Update the 'Code Contributions' section to add the FreeBSD
> >Documentation License as one of the accepted licenses for
> >documentation.  Of course additional licenses can be
> considered
> >at a later date if a community member requests to add
> documentation
> >under a different license.
> >
> > 3) Update the 'Change Description / Commit Message / Patch
> Email'
> >section so it applies equally well to both source code and
> >documentation.  The following proposal provides guidelines
> that
> >can work for patches to patches to edk2/master, other
> branches in
> >edk2, other code repositories such as edk2-staging and edk2-
> non-osi,
> >and document repositories in tianocore-docs.
> >
> 
> I understand why we might want to try to have a common
> Contributions.txt for consistency, but would there be an
> advantage to
> the separate ContributionAgreement.txt?
> 
> Would it allow us to change Contributions.txt more easily? (Less
> legal
> review?) If it were easier to change Contributions.txt, then
> would it
> be better to make them specific to the repo?
> 
> >  Begin 
> >
> > =
> > = Change Description / Commit Message / Patch Email =
> > =
> >
> > Your change description should use the standard format for a
> > commit message, and must include your "Signed-off-by" signature
> > and the "Contributed-under" message.
> >
> > == Sample Change Description / Commit Message =
> >
> > === Start of sample patch email message ===
> >
> > From: Contributor Name 
> > Subject: [Repository/Branch PATCH] CodeModule: Brief-single-
> line-summary
> 
> It looks like this change will significantly increase the subject
> line
> length in the common case.
> 
> Could a [PATCH] email sent to edk2-devel be assumed to be for
> edk2/master? I think this is a good 'default' to have since it
> covers
> the majority of patches.

Yes.  See details below for when it is optional.

> 
> Another default could be to allow for Repository or Branch to be
> omited if there isn't a conflict. For example, UDK2017 should
> uniquely
> identify the edk2/UDK2017 even though it is just the branch name.
> Similarly, if a repository name is given without a branch, then
> the
> 'master' branch could be assumed.

Yes.  See details below for when it is optional.

> 
> This change should probably be sent as a separate patch to
> highlight
> it for discussion, right? (Unless [PATCH] could default to
> edk2/master, which would mean most people wouldn't have to change
> their process.)

Yes.  [PATCH] is default for edk2/master, so no change to current 
process at all for changes to area.  See details below.

> 
> -Jordan
> 
> >
> > Full-commit-message
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Contributor Name 
> > ---
> >
> > An extra message for the patch email which will not be
> considered part
> > of the commit message can be added here.
> >
> > Patch content inline or attached
> >
> > === End of sample patch email message ===
> >
> > === Notes for sample patch email ===
> >
> > * The first line of commit message is taken from the email's
> subject
> >   line following [Repository/Branch PATCH]. The remaining
> portion of the
> >   commit message is the email's content until the '---' line.
> > * git format-patch is one way to create this format
> >
> > === Definitions for sample patch email ===
> >
> > * "Repository" is the identifier of the repository the patch
> applies.
> >   This identifier should only be provided for repositories
> other than
> >   'edk2'.  For example 'edk2-BuildSpecifica

Re: [edk2] [Patch V3 3/8] edk2: Remove commit message details from Contributions.txt

2017-07-24 Thread Jordan Justen
On 2017-07-24 11:13:52, Kinney, Michael D wrote:
> Hi Leif,
> 
> I was attempting to keep the number of top level files to a minimum
> and also attempt to use the same Contributions.txt file for both
> source code repositories and document repositories.
> 
> The set of files I am proposing be at the root of repositories are:
> 
> * Readme.md
> * License.txt
> * Contributions.txt
> 
> My first attempt at this was to move some of the commit message
> details that are slightly different between source code and
> documentation from Contributions.txt to the Readme.md and the
> Readme.md also provides links to the wiki pages with even more
> details.
> 
> I am seeing feedback that there is a desire to retain the commit
> message format details in Contributions.txt.  How about the following
> approach for updates to Contributions.txt:
> 
> 1) Update Contribution Agreement section from 1.0 to 1.1 to add 
>support for TianoCore Documentation.
> 
> 2) Update the 'Code Contributions' section to add the FreeBSD 
>Documentation License as one of the accepted licenses for
>documentation.  Of course additional licenses can be considered 
>at a later date if a community member requests to add documentation
>under a different license.
> 
> 3) Update the 'Change Description / Commit Message / Patch Email'
>section so it applies equally well to both source code and
>documentation.  The following proposal provides guidelines that
>can work for patches to patches to edk2/master, other branches in
>edk2, other code repositories such as edk2-staging and edk2-non-osi,
>and document repositories in tianocore-docs.
>

I understand why we might want to try to have a common
Contributions.txt for consistency, but would there be an advantage to
the separate ContributionAgreement.txt?

Would it allow us to change Contributions.txt more easily? (Less legal
review?) If it were easier to change Contributions.txt, then would it
be better to make them specific to the repo?

>  Begin 
> 
> =
> = Change Description / Commit Message / Patch Email =
> =
> 
> Your change description should use the standard format for a
> commit message, and must include your "Signed-off-by" signature
> and the "Contributed-under" message.
> 
> == Sample Change Description / Commit Message =
> 
> === Start of sample patch email message ===
> 
> From: Contributor Name 
> Subject: [Repository/Branch PATCH] CodeModule: Brief-single-line-summary

It looks like this change will significantly increase the subject line
length in the common case.

Could a [PATCH] email sent to edk2-devel be assumed to be for
edk2/master? I think this is a good 'default' to have since it covers
the majority of patches.

Another default could be to allow for Repository or Branch to be
omited if there isn't a conflict. For example, UDK2017 should uniquely
identify the edk2/UDK2017 even though it is just the branch name.
Similarly, if a repository name is given without a branch, then the
'master' branch could be assumed.

This change should probably be sent as a separate patch to highlight
it for discussion, right? (Unless [PATCH] could default to
edk2/master, which would mean most people wouldn't have to change
their process.)

-Jordan

> 
> Full-commit-message
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Contributor Name 
> ---
> 
> An extra message for the patch email which will not be considered part
> of the commit message can be added here.
> 
> Patch content inline or attached
> 
> === End of sample patch email message ===
> 
> === Notes for sample patch email ===
> 
> * The first line of commit message is taken from the email's subject
>   line following [Repository/Branch PATCH]. The remaining portion of the
>   commit message is the email's content until the '---' line.
> * git format-patch is one way to create this format
> 
> === Definitions for sample patch email ===
> 
> * "Repository" is the identifier of the repository the patch applies.
>   This identifier should only be provided for repositories other than
>   'edk2'.  For example 'edk2-BuildSpecification' or 'staging'.
> * "Branch" is the identifier of the branch the patch applies. This
>   identifier should only be provided for branches other than 'edk2/master'.
>   For example 'edk2/UDK2015', 'edk2-BuildSpecification/release/1.27', or 
>   'staging/edk2-test'.
> * "CodeModule" is a short identifier for the affected code. This identifier
>   should not be provided for documentation patches. For example 'MdePkg', 
>   or 'MdeModulePkg/UsbBusDxe'.
> * "Brief-single-line-summary" is a short summary of the change.
> * The entire first line should be less than ~70 characters.
> * "Full-commit-message" a verbose multiple line comment describing
>   the change.  Each line should be less than ~70 characters.
> * "Contributed-under" explicitly states

Re: [edk2] [Patch V3 3/8] edk2: Remove commit message details from Contributions.txt

2017-07-24 Thread Kinney, Michael D
Hi Leif,

I was attempting to keep the number of top level files to a minimum
and also attempt to use the same Contributions.txt file for both
source code repositories and document repositories.

The set of files I am proposing be at the root of repositories are:

* Readme.md
* License.txt
* Contributions.txt

My first attempt at this was to move some of the commit message
details that are slightly different between source code and
documentation from Contributions.txt to the Readme.md and the
Readme.md also provides links to the wiki pages with even more
details.

I am seeing feedback that there is a desire to retain the commit
message format details in Contributions.txt.  How about the following
approach for updates to Contributions.txt:

1) Update Contribution Agreement section from 1.0 to 1.1 to add 
   support for TianoCore Documentation.

2) Update the 'Code Contributions' section to add the FreeBSD 
   Documentation License as one of the accepted licenses for
   documentation.  Of course additional licenses can be considered 
   at a later date if a community member requests to add documentation
   under a different license.

3) Update the 'Change Description / Commit Message / Patch Email'
   section so it applies equally well to both source code and
   documentation.  The following proposal provides guidelines that
   can work for patches to patches to edk2/master, other branches in
   edk2, other code repositories such as edk2-staging and edk2-non-osi,
   and document repositories in tianocore-docs.

 Begin 

=
= Change Description / Commit Message / Patch Email =
=

Your change description should use the standard format for a
commit message, and must include your "Signed-off-by" signature
and the "Contributed-under" message.

== Sample Change Description / Commit Message =

=== Start of sample patch email message ===

From: Contributor Name 
Subject: [Repository/Branch PATCH] CodeModule: Brief-single-line-summary

Full-commit-message

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Contributor Name 
---

An extra message for the patch email which will not be considered part
of the commit message can be added here.

Patch content inline or attached

=== End of sample patch email message ===

=== Notes for sample patch email ===

* The first line of commit message is taken from the email's subject
  line following [Repository/Branch PATCH]. The remaining portion of the
  commit message is the email's content until the '---' line.
* git format-patch is one way to create this format

=== Definitions for sample patch email ===

* "Repository" is the identifier of the repository the patch applies.
  This identifier should only be provided for repositories other than
  'edk2'.  For example 'edk2-BuildSpecification' or 'staging'.
* "Branch" is the identifier of the branch the patch applies. This
  identifier should only be provided for branches other than 'edk2/master'.
  For example 'edk2/UDK2015', 'edk2-BuildSpecification/release/1.27', or 
  'staging/edk2-test'.
* "CodeModule" is a short identifier for the affected code. This identifier
  should not be provided for documentation patches. For example 'MdePkg', 
  or 'MdeModulePkg/UsbBusDxe'.
* "Brief-single-line-summary" is a short summary of the change.
* The entire first line should be less than ~70 characters.
* "Full-commit-message" a verbose multiple line comment describing
  the change.  Each line should be less than ~70 characters.
* "Contributed-under" explicitly states that the contribution is
  made under the terms of the contribution agreement.  This
  agreement is included below in this document.
* "Signed-off-by" is the contributor's signature identifying them
  by their real/legal name and their email address.

 End 

If this approach is acceptable, then I will update the patch series
to V4.

Best regards,

Mike

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On
> Behalf Of Leif Lindholm
> Sent: Friday, July 21, 2017 3:14 PM
> To: Justen, Jordan L 
> Cc: Kinney, Michael D ; edk2-
> de...@lists.01.org; Andrew Fish 
> Subject: Re: [edk2] [Patch V3 3/8] edk2: Remove commit message
> details from Contributions.txt
> 
> On Fri, Jul 21, 2017 at 02:16:54PM -0700, Jordan Justen wrote:
> > On 2017-07-19 22:44:06, Michael D Kinney wrote:
> > > https://bugzilla.tianocore.org/show_bug.cgi?id=629
> > >
> > > Remove the change description, commit message, and
> > > patch email section from Contributions.txt.  This
> > > section is not part of the TianoCore Contribution
> > > Agreement.
> >
> > Neither are the ~35 remaining lines before this content, which
> you are
> > not removing.
> >
> > > The information is very important and is
> > > provided on the TianoCore web site and wiki and will
> > > be added to Readme.md in the root of the edk2
> > > repository.
> >
> > Yes

Re: [edk2] [PATCH] MdePkg/SecPeiDxeTimerLibCpu: Consume UefiCpuPkg LAPIC code.

2017-07-24 Thread Marvin Häuser
Hi Michael,

Sorry, I did not notice that UefiCpuPkg already has a similiar library.
Could you please answer my question regarding the mask value which I considered 
incorrect nevertheless?
I am getting compile-time errors as the mask promotes the value to UINT64, 
which is, on 32-bit platforms,
implicitely casted to UINT32 (UINTN), resulting in the appropiate data loss 
warning.

Thanks for your answer!

Regards,
Marvin. 

> -Original Message-
> From: Kinney, Michael D [mailto:michael.d.kin...@intel.com]
> Sent: Monday, July 24, 2017 6:40 PM
> To: Marvin Häuser ; edk2-
> de...@lists.01.org; Kinney, Michael D 
> Cc: Gao, Liming 
> Subject: RE: [PATCH] MdePkg/SecPeiDxeTimerLibCpu: Consume UefiCpuPkg
> LAPIC code.
> 
> Hi Marvin,
> 
> We should not add a dependency on the UefiCpuPkg to the MdePkg.  I agree
> that a better location of the local APIC based timer lib would be the
> UefiCpuPkg, and there is already one there called
> SecPeiDxeTimerLibUefiCpu.
> 
> The TimeLib in the MdePkg was created before the UefiCpuPkg was created,
> which explains the current state of the MdePkg.
> 
> The MdePkg version has other limitations noted in the INF and recommends
> the UefiCpuPkg version be used.
> 
> Thanks,
> 
> Mike
> 
> > -Original Message-
> > From: Marvin Häuser [mailto:marvin.haeu...@outlook.com]
> > Sent: Sunday, July 23, 2017 3:19 AM
> > To: edk2-devel@lists.01.org
> > Cc: Kinney, Michael D ; Gao, Liming
> > 
> > Subject: RE: [PATCH] MdePkg/SecPeiDxeTimerLibCpu: Consume
> UefiCpuPkg
> > LAPIC code.
> >
> > Dear Michael and Liming,
> >
> > I submited the patch as the changes need to be done anyway, though I
> > think the library might be better moved to UefiCpuPkg.
> > Also, is my understanding of the mask value being incorrect right? I
> > was confused by the 'ULL' suffix, which makes it look like it was
> > intended. Is it?
> >
> > Regards,
> > Marvin.
> >
> > > -Original Message-
> > > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On
> > Behalf Of
> > > Marvin Häuser
> > > Sent: Sunday, July 23, 2017 12:12 PM
> > > To: edk2-devel@lists.01.org
> > > Cc: michael.d.kin...@intel.com; liming@intel.com
> > > Subject: [edk2] [PATCH] MdePkg/SecPeiDxeTimerLibCpu: Consume
> > > UefiCpuPkg LAPIC code.
> > >
> > > X86TimerLib is changed to use UefiCpuPkg LAPIC register
> > definitions and
> > > LocalApicLib to remove duplicated code. An implicite change is
> > the value
> > > returned by InternalX86GetApicBase() as it now returns the
> > result of
> > > GetLocalApicBaseAddress(), which is the full LAPIC address.
> > This also
> > > implicitely fixes the incorrect mask value used previously,
> > which did not only
> > > mask AcpiBase, but also the first nibble of AcpiBaseHi. This
> > does not apply to
> > > 32-bit platforms.
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Marvin Haeuser 
> > > ---
> > >  MdePkg/Library/SecPeiDxeTimerLibCpu/X86TimerLib.c|
> > 35 +++--
> > > ---
> > >  MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf |
> > 4 ++-
> > >  MdePkg/MdePkg.dsc|
> > 3 ++
> > >  3 files changed, 18 insertions(+), 24 deletions(-)
> > >
> > > diff --git a/MdePkg/Library/SecPeiDxeTimerLibCpu/X86TimerLib.c
> > > b/MdePkg/Library/SecPeiDxeTimerLibCpu/X86TimerLib.c
> > > index 76c66fbce6fb..fa6e6f213029 100644
> > > --- a/MdePkg/Library/SecPeiDxeTimerLibCpu/X86TimerLib.c
> > > +++ b/MdePkg/Library/SecPeiDxeTimerLibCpu/X86TimerLib.c
> > > @@ -1,7 +1,7 @@
> > >  /** @file
> > >Timer Library functions built upon local APIC on IA32/x64.
> > >
> > > -  Copyright (c) 2006 - 2015, Intel Corporation. All rights
> > reserved.
> > > +  Copyright (c) 2006 - 2017, Intel Corporation. All rights
> > > + reserved.
> > >This program and the accompanying materials
> > >are licensed and made available under the terms and
> > conditions of the BSD
> > > License
> > >which accompanies this distribution.  The full text of the
> > license may be
> > > found at @@ -13,18 +13,14 @@  **/
> > >
> > >  #include 
> > > +#include 
> > > +#include 
> > >  #include 
> > >  #include 
> > >  #include 
> > >  #include 
> > >  #include 
> > >
> > > -#define APIC_SVR0x0f0
> > > -#define APIC_LVTERR 0x370
> > > -#define APIC_TMICT  0x380
> > > -#define APIC_TMCCT  0x390
> > > -#define APIC_TDCR   0x3e0
> > > -
> > >  //
> > >  // The following array is used in calculating the frequency of
> > local APIC  //
> > > timer. Refer to IA-32 developers' manual for more details.
> > > @@ -54,30 +50,21 @@ InternalX86GetApicBase (
> > >VOID
> > >)
> > >  {
> > > -  UINTN MsrValue;
> > >UINTN ApicBase;
> > >
> > > -  MsrValue = (UINTN) AsmReadMsr64 (27);
> > > -  ApicBase = MsrValue & 0xff000ULL;
> > > -
> > >//
> > > -  // Check the APIC Global Enable bit (bit 11) in
> > IA32_APIC_BASE MSR.

Re: [edk2] [PATCH 1/2] MdePkg/BaseLib: Add IsNodeInList() function.

2017-07-24 Thread Marvin Häuser
Hey Mike,

In contrast to setting 'BackLink' and 'ForwardLink' to dummy values such as 
EFI_BAD_POINTER, verifying that a node is part of a known list is a safe way to 
determine whether a link is still valid without needing to keep the memory 
allocated. If the Node, which had its links set to dummys, is freed, the dummy 
values may be overwriten and the check would pass despite the node being 
invalid. This can, for example, be used in OpenKabylake's PchSmiDispatcher, 
which does the described check against EFI_BAD_POINTER (though if I remember 
correctly, the value is actually never explicitely set). The issue is that some 
function may pass a handle that was unregistered to the function. 
IsNodeInList() can be used to determine whether it was previously removed.

Thanks for your response!

Regards,
Marvin.

> -Original Message-
> From: Kinney, Michael D [mailto:michael.d.kin...@intel.com]
> Sent: Monday, July 24, 2017 6:31 PM
> To: Marvin Häuser ; edk2-
> de...@lists.01.org; Kinney, Michael D 
> Cc: Gao, Liming 
> Subject: RE: [PATCH 1/2] MdePkg/BaseLib: Add IsNodeInList() function.
> 
> Hi Marvin,
> 
> Can you provide a few more details on why you would like to see tis internal
> function promoted to a library class API?
> 
> Thanks,
> 
> Mike
> 
> > -Original Message-
> > From: Marvin Häuser [mailto:marvin.haeu...@outlook.com]
> > Sent: Sunday, July 23, 2017 3:11 AM
> > To: edk2-devel@lists.01.org
> > Cc: Kinney, Michael D ; Gao, Liming
> > 
> > Subject: [PATCH 1/2] MdePkg/BaseLib: Add IsNodeInList() function.
> >
> > This patch adds IsNodeInList() to BaseLib, which verifies the given
> > Node is part of the doubly-linked List provided.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Marvin Haeuser 
> > ---
> >  MdePkg/Library/BaseLib/LinkedList.c   | 70
> > +++-
> >  MdePkg/Include/Library/BaseLib.h  | 25 +++
> >  MdePkg/Library/BaseLib/BaseLibInternals.h | 28 
> >  3 files changed, 94 insertions(+), 29 deletions(-)
> >
> > diff --git a/MdePkg/Library/BaseLib/LinkedList.c
> > b/MdePkg/Library/BaseLib/LinkedList.c
> > index ba373f4b7be3..b364ae41c647 100644
> > --- a/MdePkg/Library/BaseLib/LinkedList.c
> > +++ b/MdePkg/Library/BaseLib/LinkedList.c
> > @@ -1,7 +1,7 @@
> >  /** @file
> >Linked List Library Functions.
> >
> > -  Copyright (c) 2006 - 2013, Intel Corporation. All rights
> > reserved.
> > +  Copyright (c) 2006 - 2017, Intel Corporation. All rights
> > reserved.
> >This program and the accompanying materials
> >are licensed and made available under the terms and conditions of
> > the BSD License
> >which accompanies this distribution.  The full text of the license
> > may be found at @@ -113,6 +113,74 @@ InternalBaseLibIsNodeInList (  }
> >
> >  /**
> > +  Checks whether Node is part of a doubly-linked list.
> > +
> > +  If List is NULL, then ASSERT().
> > +  If List->ForwardLink is NULL, then ASSERT().
> > +  If List->BackLink is NULL, then ASSERT().
> > +  If Node is NULL, then ASSERT();
> > +  If PcdMaximumLinkedListLength is not zero, and List contains
> > more than
> > +  PcdMaximumLinkedListLength nodes, then ASSERT().
> > +
> > +  @param  List  A pointer to a node in a linked list.
> > +  @param  Node  A pointer to the node to locate.
> > +
> > +  @retval TRUE   Node is in List.
> > +  @retval FALSE  Node isn't in List, or List is invalid.
> > +
> > +**/
> > +BOOLEAN
> > +EFIAPI
> > +IsNodeInList (
> > +  IN  CONST LIST_ENTRY  *List,
> > +  IN  CONST LIST_ENTRY  *Node
> > +  )
> > +{
> > +  UINTN Count;
> > +  CONST LIST_ENTRY  *Ptr;
> > +
> > +  //
> > +  // Test the validity of List and Node  //  ASSERT (List != NULL);
> > + ASSERT (List->ForwardLink != NULL);  ASSERT (List->BackLink !=
> > + NULL);  ASSERT (Node != NULL);
> > +
> > +  //
> > +  // ASSERT List not too long
> > +  //
> > +  ASSERT (InternalBaseLibIsNodeInList (ListHead, Entry, FALSE));
> > +
> > +  Count = 0;
> > +  Ptr   = List;
> > +
> > +  //
> > +  // Check to see if Node is a member of List.
> > +  // Exit early if the number of nodes in List >=
> > PcdMaximumLinkedListLength
> > +  //
> > +  do {
> > +Ptr = Ptr->ForwardLink;
> > +if (PcdGet32 (PcdMaximumLinkedListLength) > 0) {
> > +  Count++;
> > +
> > +  //
> > +  // Return if the linked list is too long
> > +  //
> > +  if (Count == PcdGet32 (PcdMaximumLinkedListLength)) {
> > +return (BOOLEAN)(Ptr == Node);
> > +  }
> > +}
> > +
> > +if (Ptr == Node) {
> > +  return TRUE;
> > +}
> > +  } while (Ptr != List);
> > +
> > +  return FALSE;
> > +}
> > +
> > +/**
> >Initializes the head node of a doubly-linked list, and returns the
> > pointer to
> >the head node of the doubly-linked list.
> >
> > diff --git a/MdePkg/Include/Library/BaseLib.h
> > b/MdePkg/Include/Library/BaseLib.h
> > index 791849b80406..4f3f4fd51f3f 100644
> > --- a/MdePkg/Include/Library/BaseLib.h
>

[edk2] [UEFI PI 1.6/EDK2] Missing decorators for EFI_PEI_GET_VARIABLE2.

2017-07-24 Thread Marvin H?user
Dear developers,

I noticed that EFI_PEI_GET_VARIABLE2 is lacking decorators in both the UEFI PI 
1.6 specification and the EDK2
codebase. The parameter description for 'Attributes' starts with 'If non-NULL', 
hence it may be NULL, which is
not reflected in the function prototype with the decorator 'OPTIONAL'. 
Furthermore, as the possibility of it
being NULL is not coupled to the values of the other parameters, 'IN' should be 
added as well.

Can someone please forward this to the right working group?

Thanks and best regards,
Marvin.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdePkg/SecPeiDxeTimerLibCpu: Consume UefiCpuPkg LAPIC code.

2017-07-24 Thread Kinney, Michael D
Hi Marvin,

We should not add a dependency on the UefiCpuPkg to the
MdePkg.  I agree that a better location of the local APIC
based timer lib would be the UefiCpuPkg, and there is 
already one there called SecPeiDxeTimerLibUefiCpu.

The TimeLib in the MdePkg was created before the UefiCpuPkg
was created, which explains the current state of the MdePkg.

The MdePkg version has other limitations noted in the INF 
and recommends the UefiCpuPkg version be used.

Thanks,

Mike

> -Original Message-
> From: Marvin Häuser [mailto:marvin.haeu...@outlook.com]
> Sent: Sunday, July 23, 2017 3:19 AM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Gao, Liming
> 
> Subject: RE: [PATCH] MdePkg/SecPeiDxeTimerLibCpu: Consume
> UefiCpuPkg LAPIC code.
> 
> Dear Michael and Liming,
> 
> I submited the patch as the changes need to be done anyway,
> though I think the library might be better moved to UefiCpuPkg.
> Also, is my understanding of the mask value being incorrect
> right? I was confused by the 'ULL' suffix, which makes it look
> like it was intended. Is it?
> 
> Regards,
> Marvin.
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On
> Behalf Of
> > Marvin Häuser
> > Sent: Sunday, July 23, 2017 12:12 PM
> > To: edk2-devel@lists.01.org
> > Cc: michael.d.kin...@intel.com; liming@intel.com
> > Subject: [edk2] [PATCH] MdePkg/SecPeiDxeTimerLibCpu: Consume
> > UefiCpuPkg LAPIC code.
> >
> > X86TimerLib is changed to use UefiCpuPkg LAPIC register
> definitions and
> > LocalApicLib to remove duplicated code. An implicite change is
> the value
> > returned by InternalX86GetApicBase() as it now returns the
> result of
> > GetLocalApicBaseAddress(), which is the full LAPIC address.
> This also
> > implicitely fixes the incorrect mask value used previously,
> which did not only
> > mask AcpiBase, but also the first nibble of AcpiBaseHi. This
> does not apply to
> > 32-bit platforms.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Marvin Haeuser 
> > ---
> >  MdePkg/Library/SecPeiDxeTimerLibCpu/X86TimerLib.c|
> 35 +++--
> > ---
> >  MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf |
> 4 ++-
> >  MdePkg/MdePkg.dsc|
> 3 ++
> >  3 files changed, 18 insertions(+), 24 deletions(-)
> >
> > diff --git a/MdePkg/Library/SecPeiDxeTimerLibCpu/X86TimerLib.c
> > b/MdePkg/Library/SecPeiDxeTimerLibCpu/X86TimerLib.c
> > index 76c66fbce6fb..fa6e6f213029 100644
> > --- a/MdePkg/Library/SecPeiDxeTimerLibCpu/X86TimerLib.c
> > +++ b/MdePkg/Library/SecPeiDxeTimerLibCpu/X86TimerLib.c
> > @@ -1,7 +1,7 @@
> >  /** @file
> >Timer Library functions built upon local APIC on IA32/x64.
> >
> > -  Copyright (c) 2006 - 2015, Intel Corporation. All rights
> reserved.
> > +  Copyright (c) 2006 - 2017, Intel Corporation. All rights
> > + reserved.
> >This program and the accompanying materials
> >are licensed and made available under the terms and
> conditions of the BSD
> > License
> >which accompanies this distribution.  The full text of the
> license may be
> > found at @@ -13,18 +13,14 @@  **/
> >
> >  #include 
> > +#include 
> > +#include 
> >  #include 
> >  #include 
> >  #include 
> >  #include 
> >  #include 
> >
> > -#define APIC_SVR0x0f0
> > -#define APIC_LVTERR 0x370
> > -#define APIC_TMICT  0x380
> > -#define APIC_TMCCT  0x390
> > -#define APIC_TDCR   0x3e0
> > -
> >  //
> >  // The following array is used in calculating the frequency of
> local APIC  //
> > timer. Refer to IA-32 developers' manual for more details.
> > @@ -54,30 +50,21 @@ InternalX86GetApicBase (
> >VOID
> >)
> >  {
> > -  UINTN MsrValue;
> >UINTN ApicBase;
> >
> > -  MsrValue = (UINTN) AsmReadMsr64 (27);
> > -  ApicBase = MsrValue & 0xff000ULL;
> > -
> >//
> > -  // Check the APIC Global Enable bit (bit 11) in
> IA32_APIC_BASE MSR.
> > -  // This bit will be 1, if local APIC is globally enabled.
> > +  // Verify local APIC is under XAPIC mode.
> >//
> > -  ASSERT ((MsrValue & BIT11) != 0);
> > +  ASSERT (GetApicMode () == LOCAL_APIC_MODE_XAPIC);
> >
> > -  //
> > -  // Check the APIC Extended Mode bit (bit 10) in
> IA32_APIC_BASE MSR.
> > -  // This bit will be 0, if local APIC is under XAPIC mode.
> > -  //
> > -  ASSERT ((MsrValue & BIT10) == 0);
> > +  ApicBase = GetLocalApicBaseAddress ();
> >
> >//
> >// Check the APIC Software Enable/Disable bit (bit 8) in
> Spurious-Interrupt
> >// Vector Register.
> >// This bit will be 1, if local APIC is software enabled.
> >//
> > -  ASSERT ((MmioRead32 (ApicBase + APIC_SVR) & BIT8) != 0);
> > +  ASSERT ((MmioRead32 (ApicBase +
> XAPIC_SPURIOUS_VECTOR_OFFSET) &
> > BIT8)
> > + != 0);
> >
> >return ApicBase;
> >  }
> > @@ -98,7 +85,9 @@ InternalX86GetTimerFrequency (  {
> >return
> >  PcdGet32(PcdFSBClock) /
> > - 

Re: [edk2] [PATCH 1/2] MdePkg/BaseLib: Add IsNodeInList() function.

2017-07-24 Thread Kinney, Michael D
Hi Marvin,

Can you provide a few more details on why you would like
to see tis internal function promoted to a library class
API?

Thanks,

Mike

> -Original Message-
> From: Marvin Häuser [mailto:marvin.haeu...@outlook.com]
> Sent: Sunday, July 23, 2017 3:11 AM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Gao, Liming
> 
> Subject: [PATCH 1/2] MdePkg/BaseLib: Add IsNodeInList() function.
> 
> This patch adds IsNodeInList() to BaseLib, which verifies the
> given
> Node is part of the doubly-linked List provided.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marvin Haeuser 
> ---
>  MdePkg/Library/BaseLib/LinkedList.c   | 70
> +++-
>  MdePkg/Include/Library/BaseLib.h  | 25 +++
>  MdePkg/Library/BaseLib/BaseLibInternals.h | 28 
>  3 files changed, 94 insertions(+), 29 deletions(-)
> 
> diff --git a/MdePkg/Library/BaseLib/LinkedList.c
> b/MdePkg/Library/BaseLib/LinkedList.c
> index ba373f4b7be3..b364ae41c647 100644
> --- a/MdePkg/Library/BaseLib/LinkedList.c
> +++ b/MdePkg/Library/BaseLib/LinkedList.c
> @@ -1,7 +1,7 @@
>  /** @file
>Linked List Library Functions.
> 
> -  Copyright (c) 2006 - 2013, Intel Corporation. All rights
> reserved.
> +  Copyright (c) 2006 - 2017, Intel Corporation. All rights
> reserved.
>This program and the accompanying materials
>are licensed and made available under the terms and conditions
> of the BSD License
>which accompanies this distribution.  The full text of the
> license may be found at
> @@ -113,6 +113,74 @@ InternalBaseLibIsNodeInList (
>  }
> 
>  /**
> +  Checks whether Node is part of a doubly-linked list.
> +
> +  If List is NULL, then ASSERT().
> +  If List->ForwardLink is NULL, then ASSERT().
> +  If List->BackLink is NULL, then ASSERT().
> +  If Node is NULL, then ASSERT();
> +  If PcdMaximumLinkedListLength is not zero, and List contains
> more than
> +  PcdMaximumLinkedListLength nodes, then ASSERT().
> +
> +  @param  List  A pointer to a node in a linked list.
> +  @param  Node  A pointer to the node to locate.
> +
> +  @retval TRUE   Node is in List.
> +  @retval FALSE  Node isn't in List, or List is invalid.
> +
> +**/
> +BOOLEAN
> +EFIAPI
> +IsNodeInList (
> +  IN  CONST LIST_ENTRY  *List,
> +  IN  CONST LIST_ENTRY  *Node
> +  )
> +{
> +  UINTN Count;
> +  CONST LIST_ENTRY  *Ptr;
> +
> +  //
> +  // Test the validity of List and Node
> +  //
> +  ASSERT (List != NULL);
> +  ASSERT (List->ForwardLink != NULL);
> +  ASSERT (List->BackLink != NULL);
> +  ASSERT (Node != NULL);
> +
> +  //
> +  // ASSERT List not too long
> +  //
> +  ASSERT (InternalBaseLibIsNodeInList (ListHead, Entry, FALSE));
> +
> +  Count = 0;
> +  Ptr   = List;
> +
> +  //
> +  // Check to see if Node is a member of List.
> +  // Exit early if the number of nodes in List >=
> PcdMaximumLinkedListLength
> +  //
> +  do {
> +Ptr = Ptr->ForwardLink;
> +if (PcdGet32 (PcdMaximumLinkedListLength) > 0) {
> +  Count++;
> +
> +  //
> +  // Return if the linked list is too long
> +  //
> +  if (Count == PcdGet32 (PcdMaximumLinkedListLength)) {
> +return (BOOLEAN)(Ptr == Node);
> +  }
> +}
> +
> +if (Ptr == Node) {
> +  return TRUE;
> +}
> +  } while (Ptr != List);
> +
> +  return FALSE;
> +}
> +
> +/**
>Initializes the head node of a doubly-linked list, and returns
> the pointer to
>the head node of the doubly-linked list.
> 
> diff --git a/MdePkg/Include/Library/BaseLib.h
> b/MdePkg/Include/Library/BaseLib.h
> index 791849b80406..4f3f4fd51f3f 100644
> --- a/MdePkg/Include/Library/BaseLib.h
> +++ b/MdePkg/Include/Library/BaseLib.h
> @@ -2869,6 +2869,31 @@ PathCleanUpDirectories(
> 
> 
>  /**
> +  Checks whether Node is part of a doubly-linked list.
> +
> +  If List is NULL, then ASSERT().
> +  If List->ForwardLink is NULL, then ASSERT().
> +  If List->BackLink is NULL, then ASSERT().
> +  If Node is NULL, then ASSERT();
> +  If PcdMaximumLinkedListLength is not zero, and List contains
> more than
> +  PcdMaximumLinkedListLength nodes, then ASSERT().
> +
> +  @param  List  A pointer to a node in a linked list.
> +  @param  Node  A pointer to the node to locate.
> +
> +  @retval TRUE   Node is in List.
> +  @retval FALSE  Node isn't in List, or List is invalid.
> +
> +**/
> +BOOLEAN
> +EFIAPI
> +IsNodeInList (
> +  IN  CONST LIST_ENTRY  *List,
> +  IN  CONST LIST_ENTRY  *Node
> +  );
> +
> +
> +/**
>Initializes the head node of a doubly linked list, and returns
> the pointer to
>the head node of the doubly linked list.
> 
> diff --git a/MdePkg/Library/BaseLib/BaseLibInternals.h
> b/MdePkg/Library/BaseLib/BaseLibInternals.h
> index ea387ce37d27..9dca97a0dcc9 100644
> --- a/MdePkg/Library/BaseLib/BaseLibInternals.h
> +++ b/MdePkg/Library/BaseLib/BaseLibInternals.h
> @@ -340,34 +340,6 @@ InternalSwitchStack (
> 
> 
>  /**
> -  Worker function that locates the Node in the List.
> -
> - 

[edk2] search plugin for the TianoCore Bugzilla

2017-07-24 Thread Laszlo Ersek
Hi Mike,

(1) OpenSearch plugins are very useful for bug trackers because they
allow users to perform simple searches (incl. direct bug numbers) right
from their web browsers.

  https://en.wikipedia.org/wiki/OpenSearch

Such OpenSearch plugins are supposed to be compatible with Safari, Edge,
Firefox and Chrome:

  https://en.wikipedia.org/wiki/OpenSearch#Support

I think that such a search plugin would be helpful for TianoCore BZ
users as well.

(2) The Firefox docs describe two methods for a website to offer a
search plugin:

(2a)
https://developer.mozilla.org/en-US/Add-ons/Creating_OpenSearch_plugins_for_Firefox#Autodiscovery_of_search_plugins

(2b)
https://developer.mozilla.org/en-US/docs/Web/API/Window/sidebar/Adding_search_engines_from_Web_pages

When a website implements the first method, a Firefox user can install
the site's search plugin by clicking the "magnifying glass with PLUS
sign" icon that is to the left of their search bar. According to the
above wikipedia article on OpenSearch, this is the generic /
multi-browser method called "Auto-discovery".

When a website implements the second method, the user needs to click a
normal link. I'm unsure if this method works outside of Firefox.

(3) The TianoCore Bugzilla already implements method (2a), namely
auto-discovery -- if you navigate to ,
the "magnifying glass with PLUS sign" icon appears in Firefox.

However:
- The name of the plugin that is offered is plain "Bugzilla". I think
it's too nondescript; there are many bugzilla instances on the web, and
a user should be able to install & tell apart several such plugins in
his/her web browser.
- The icon associated with this search plugin is Mozilla's default
lizard figure. Also too nondescript IMO.

(4) I've created an alternative page where
- a similar search plugin is offered with the name "TianoCore Bugzilla",
- and the icon associated with the plugin comes from
"MdeModulePkg/Logo/Logo.bmp" (cropping the image to a square from the
left side).

This page implements both installation methods (2a) and (2b); please
check it out:

  https://people.redhat.com/lersek/tianocore-bugzilla-opensearch/

(5) I suggest that we try to incorporate these improvements (i.e., the
more specific plugin name, and the matching icon) in the TianoCore BZ.

(6) I also tried to offer the improved plugin in our wiki article

  https://github.com/lersek/edk2/wiki/Reporting-Issues

However, the github wiki pages do not support either install method (2a)
or (2b); please see why under:

  https://github.com/github/markup/issues/79#issuecomment-317394553

Hence my suggestion in (5) -- we should stick with the TianoCore BZ's
built-in plugin offering (which is also multi-browser), but we should
update the icon and the plugin name to more specific ones.

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


Re: [edk2] [RFC v1 0/3] Add VIRTIO_F_IOMMU_PLATFORM support

2017-07-24 Thread Gerd Hoffmann
  Hi,

> > I see that OVMF has the following virtio drivers, we need to update
> > them
> > all:
> > 
> > VirtioBlkDxe
> > VirtioGpuDxe
> > VirtioNetDxe
> > VirtioRngDxe
> > VirtioScsiDxe
> > 
> > I will wait for Laszlo and Jordan's initial feedback before
> > changing
> > other drivers.
> 
> I'm not sure about the GPU. Cc relevant maintainers -
> can virtio GPU work from behind an IOMMU?

GPU uses main memory as backing storage for framebuffers, and this is
passed as guest physical address (scatterlist of addresses to be exact)
to the host.

So, I think no, this isn't going to work with the current code.

Should be possible to fix though.  We need to define what "guest
physical address" should be with VIRTIO_F_IOMMU_PLATFORM enabled
(probably guest pci bus address) and add support for proper iommu
lookups.

cheers,
  Gerd

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