Re: [edk2] [PATCH v2 1/6] MdeModulePkg/PciSioSerialDxe: Use MAX_UINT8 instead of PCI_BAR_ALL

2017-02-07 Thread Tian, Feng
Reviewed-by: Feng Tian 

Thanks
Feng

-Original Message-
From: Ni, Ruiyu 
Sent: Monday, February 6, 2017 2:01 PM
To: edk2-devel@lists.01.org
Cc: Tian, Feng 
Subject: [PATCH v2 1/6] MdeModulePkg/PciSioSerialDxe: Use MAX_UINT8 instead of 
PCI_BAR_ALL

When BarIndex equals to 0xFF, default value 0 is used as the BAR index. Though 
PCI_BAR_ALL and MAX_UINT8 shares the same value, using PCI_BAR_ALL is like to 
match any BAR not BAR 0, it's more proper to use MAX_UINT8 here.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni 
Cc: Feng Tian 
---
 MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c 
b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c
index 65ddf5d..a9dc827 100644
--- a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c
+++ b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c
@@ -473,7 +473,7 @@ CreateSerialDevice (
   // For PCI serial device, use the information from PCD
   //
   if (PciSerialParameter != NULL) {
-BarIndex = (PciSerialParameter->BarIndex == PCI_BAR_ALL) ? 0 : 
PciSerialParameter->BarIndex;
+BarIndex = (PciSerialParameter->BarIndex == MAX_UINT8) ? 0 : 
+ PciSerialParameter->BarIndex;
 Offset = PciSerialParameter->Offset;
 if (PciSerialParameter->RegisterStride != 0) {
   SerialDevice->RegisterStride = PciSerialParameter->RegisterStride;
--
2.9.0.windows.1

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


Re: [edk2] [patch] OvmfPkg/QemuBootOrderLib: Fix NOOPT build failure

2017-02-07 Thread Bi, Dandan
Hi  Jordan,

Yes, it fails on IA32.
As far as I know, it impacts VS2012/2013/2015. 
I will create a new patch and add the impacted toolchain and arch info to the 
commit message.

Thanks,
Dandan

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Jordan 
Justen
Sent: Wednesday, February 8, 2017 2:49 PM
To: Bi, Dandan ; edk2-devel@lists.01.org
Cc: Laszlo Ersek ; Gao, Liming 
Subject: Re: [edk2] [patch] OvmfPkg/QemuBootOrderLib: Fix NOOPT build failure

On 2017-02-07 21:55:52, Dandan Bi wrote:
> Cc: Jordan Justen 
> Cc: Laszlo Ersek 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi 
> ---
>  OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c 
> b/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
> index ec42214..1bb89d4 100644
> --- a/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
> +++ b/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
> @@ -306,8 +306,8 @@ MapRootBusPosToBusNr (
>  return EFI_INVALID_PARAMETER;
>}
>if (RootBusPos > ExtraRootBusMap->Count) {
>  return EFI_NOT_FOUND;
>}
> -  *RootBusNr = ExtraRootBusMap->BusNumbers[RootBusPos - 1];
> +  *RootBusNr = ExtraRootBusMap->BusNumbers[(UINT32)RootBusPos - 1];

Is this failing on IA32? If so, think UINTN would be better.

You might also want to add the impacted toolchain and arch to the commit 
message.

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


Re: [edk2] [Patch] MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength

2017-02-07 Thread Ye, Ting
Reviewed-by: Ye Ting 


-Original Message-
From: Wu, Jiaxin 
Sent: Wednesday, February 08, 2017 12:58 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jiaxin 

Subject: [Patch] MdeModulePkg/DxeHttpLib: Correct the return status for the 
HTTP Port/ContentLength

Replace AsciiStrDecimalToUintn with AsciiStrDecimalToUintnS to return the 
correct status for the HTTP Port/ContentLength.

Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 
---
 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c 
b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index a4579bf..ff7e799 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -1,10 +1,10 @@
 /** @file
   This library is used to share code between UEFI network stack modules.
   It provides the helper routines to parse the HTTP message byte stream.
 
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP  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  
http://opensource.org/licenses/bsd-license.php
@@ -719,13 +719,12 @@ HttpUrlGetPort (
   if (EFI_ERROR (Status)) {
 return Status;
   }
 
   PortString[ResultLength] = '\0';
-  *Port = (UINT16) AsciiStrDecimalToUintn (Url + 
Parser->FieldData[HTTP_URI_FIELD_PORT].Offset);
 
-  return  EFI_SUCCESS;
+  return AsciiStrDecimalToUintnS (Url + 
+ Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN 
+ *) Port);
 }
 
 /**
   Get the Path from a HTTP URL.
 
@@ -930,12 +929,11 @@ HttpIoParseContentLengthHeader (
   Header = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_LENGTH);
   if (Header == NULL) {
 return EFI_NOT_FOUND;
   }
 
-  *ContentLength = AsciiStrDecimalToUintn (Header->FieldValue);
-  return EFI_SUCCESS;
+  return AsciiStrDecimalToUintnS (Header->FieldValue, (CHAR8 **) NULL, 
+ ContentLength);
 }
 
 /**
 
   Check whether the HTTP message is using the "chunked" transfer-coding.
--
1.9.5.msysgit.1

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


Re: [edk2] [Patch] NetworkPkg/NetworkPkg.uni: Define the prompt and help information for PcdAllowHttpConnections

2017-02-07 Thread Ye, Ting
Reviewed-by: Ye Ting  

-Original Message-
From: Wu, Jiaxin 
Sent: Wednesday, February 08, 2017 12:59 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jiaxin 

Subject: [Patch] NetworkPkg/NetworkPkg.uni: Define the prompt and help 
information for PcdAllowHttpConnections

Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 
---
 NetworkPkg/NetworkPkg.uni | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/NetworkPkg.uni b/NetworkPkg/NetworkPkg.uni index 
6eecd88..d0e9b36 100644
--- a/NetworkPkg/NetworkPkg.uni
+++ b/NetworkPkg/NetworkPkg.uni
@@ -1,11 +1,11 @@
 // /** @file
 // This package provides network modules that conform to UEFI 2.4 
specification.
 //
 // This package provides network modules that conform to UEFI 2.4 
specification.
 //
-// Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+// Copyright (c) 2009 - 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  // 
http://opensource.org/licenses/bsd-license.php
@@ -44,10 +44,16 @@
 
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecUefiCertificateKeySize_PROMPT 
 #language en-US "Private Key's size."
 
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecUefiCertificateKeySize_HELP  
#language en-US "Private Key's size."
 
+#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdAllowHttpConnections_PROMPT  
#language en-US "Indicates whether HTTP connections are permitted or not."
+
+#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdAllowHttpConnections_HELP  
#language en-US "Indicates whether HTTP connections are permitted or not.\n"
+   
"TRUE  - HTTP connections are allowed.\n"
+   
"FALSE - HTTP connections are denied."
+
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecCertificateEnabled_PROMPT  
#language en-US "Enable IPsec IKEv2 Certificate Authentication."
 
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecCertificateEnabled_HELP  
#language en-US "Indicates if the IPsec IKEv2 Certificate Authentication 
feature is enabled or not.\n"

   "TRUE  - Certificate Authentication feature is enabled.\n"

   "FALSE - Does not support Certificate Authentication."
--
1.9.5.msysgit.1

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


Re: [edk2] [patch] OvmfPkg/QemuBootOrderLib: Fix NOOPT build failure

2017-02-07 Thread Jordan Justen
On 2017-02-07 21:55:52, Dandan Bi wrote:
> Cc: Jordan Justen 
> Cc: Laszlo Ersek 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi 
> ---
>  OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c 
> b/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
> index ec42214..1bb89d4 100644
> --- a/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
> +++ b/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
> @@ -306,8 +306,8 @@ MapRootBusPosToBusNr (
>  return EFI_INVALID_PARAMETER;
>}
>if (RootBusPos > ExtraRootBusMap->Count) {
>  return EFI_NOT_FOUND;
>}
> -  *RootBusNr = ExtraRootBusMap->BusNumbers[RootBusPos - 1];
> +  *RootBusNr = ExtraRootBusMap->BusNumbers[(UINT32)RootBusPos - 1];

Is this failing on IA32? If so, think UINTN would be better.

You might also want to add the impacted toolchain and arch to the
commit message.

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


[edk2] [patch] OvmfPkg/QemuBootOrderLib: Fix NOOPT build failure

2017-02-07 Thread Dandan Bi
Cc: Jordan Justen 
Cc: Laszlo Ersek 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi 
---
 OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c 
b/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
index ec42214..1bb89d4 100644
--- a/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
+++ b/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
@@ -306,8 +306,8 @@ MapRootBusPosToBusNr (
 return EFI_INVALID_PARAMETER;
   }
   if (RootBusPos > ExtraRootBusMap->Count) {
 return EFI_NOT_FOUND;
   }
-  *RootBusNr = ExtraRootBusMap->BusNumbers[RootBusPos - 1];
+  *RootBusNr = ExtraRootBusMap->BusNumbers[(UINT32)RootBusPos - 1];
   return EFI_SUCCESS;
 }
-- 
1.9.5.msysgit.1

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


Re: [edk2] [Patch][edk2-platforms] Vlv2DeviceRefCodePkg: Fixed thermal issue.

2017-02-07 Thread Wei, David
Reviewed-by: David Wei 

Thanks,
David  Wei 


-Original Message-
From: Lu, ShifeiX A 
Sent: Wednesday, February 08, 2017 1:08 PM
To: edk2-devel@lists.01.org
Cc: Wei, David 
Subject: [Patch][edk2-platforms] Vlv2DeviceRefCodePkg: Fixed thermal issue.

Fixed System auto shutdown when it reached minus 20 degree.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex 
---
 Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL 
b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL
index e63f5bc..fecc040 100644
--- a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL
+++ b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL
@@ -5,7 +5,7 @@
 ;*Family of Customer Reference Boards.*;
 ;**;
 ;**;
-;*Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved   *;
+;*Copyright (c)  1999  - 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 that accompanies this 
distribution.
@@ -69,7 +69,12 @@ Scope(\_TZ)
 {
   Store(DTS1,Local0)
 }
-Return(Add(2732,Multiply(Local0,10)))
+If (LEqual(And(Local0, 0x80), 0)) {
+  Return(Add(2732,Multiply(Local0,10)))
+} else {
+  Add(Subtract(255, Local0), 1, Local0)
+  Return(Subtract(2732,Multiply(Local0,10)))
+}
 //
 // Else return a static value if both EC and DTS are unavailable.
 //
-- 
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] Fix some typos of "according"

2017-02-07 Thread B Cran
Thanks!

Sent from my iPhone

> On Feb 7, 2017, at 10:07 PM, Gao, Liming  wrote:
> 
> Reviewed-by: Liming Gao 
> 
> To meet with edk2 patch policy, I will separate this patch per package, then 
> push it. 
> 
>> -Original Message-
>> From: Rebecca Cran [mailto:rebe...@bluestop.org]
>> Sent: Wednesday, February 08, 2017 3:41 AM
>> To: edk2-devel@lists.01.org
>> Cc: Rebecca Cran ; Tian, Feng ;
>> Zeng, Star ; Fu, Siyuan ; Wu,
>> Jiaxin ; Gao, Liming 
>> Subject: [PATCH] Fix some typos of "according"
>> 
>> Cc: Feng Tian 
>> Cc: Star Zeng 
>> Cc: Siyuan Fu 
>> Cc: Jiaxin Wu 
>> Cc: Liming Gao 
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Rebecca Cran 
>> ---
>> EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c | 2 +-
>> MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c   | 4 ++--
>> MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c  | 2 +-
>> MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c  | 2
>> +-
>> MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c  | 6
>> +++---
>> MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c  | 2
>> +-
>> MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.h  | 2
>> +-
>> MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c   | 2 +-
>> NetworkPkg/HttpBootDxe/HttpBootConfigStrings.uni  | 2 +-
>> 9 files changed, 12 insertions(+), 12 deletions(-)
>> 
>> diff --git
>> a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
>> b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
>> index 535a265046..e71b5e4e7d 100644
>> --- a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
>> +++ b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
>> @@ -854,7 +854,7 @@ GetLangCode (
>>  }
>> 
>>  //
>> -  // Convert the language accoring to the table.
>> +  // Convert the language according to the table.
>>  //
>>  for (Index = 0; LanguageConvertTable[Index].ISO639 != NULL; Index++) {
>>if (wcscmp(LanguageConvertTable[Index].ISO639, Lang) == 0) {
>> diff --git a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
>> b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
>> index eba938e2a9..6cfd35945a 100644
>> --- a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
>> +++ b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
>> @@ -785,7 +785,7 @@ SmmCoreGetMemoryMapMemoryAttributesTable (
>> //
>> 
>> /**
>> -  Set MemoryProtectionAttribute accroding to PE/COFF image section
>> alignment.
>> +  Set MemoryProtectionAttribute according to PE/COFF image section
>> alignment.
>> 
>>  @param[in]  SectionAlignmentPE/COFF section alignment
>> **/
>> @@ -1225,7 +1225,7 @@ Finish:
>> }
>> 
>> /**
>> -  Find image record accroding to image base and size.
>> +  Find image record according to image base and size.
>> 
>>  @param[in]  ImageBaseBase of PE image
>>  @param[in]  ImageSizeSize of PE image
>> diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
>> b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
>> index a4579bf043..8734291ae3 100644
>> --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
>> +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
>> @@ -396,7 +396,7 @@ HttpParseUrl (
>>  FoundAt = FALSE;
>>  for (Char = Url; Char < Url + Length; Char++) {
>>//
>> -// Update state machine accoring to next char.
>> +// Update state machine according to next char.
>>//
>>State = NetHttpParseUrlChar (*Char, State);
>> 
>> diff --git
>> a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
>> b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
>> index 74c17bd248..3dc6376215 100644
>> --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
>> +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
>> @@ -37,7 +37,7 @@ EdbDisplayMemoryUnit (
>>  UINT64 Data64;
>> 
>>  //
>> -  // Print accroding to width
>> +  // Print according to width
>>  //
>>  switch (Width) {
>>  case EdbWidthUint8:
>> diff --git
>> a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
>> b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
>> index ba62c6ac27..3ca793059f 100644
>> --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
>> +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
>> @@ -70,7 +70,7 @@ GetDirNameFromFullPath (
>> 
>> /**
>> 
>> -  Construct full path accroding to dir and file path.
>> +  Construct full path according to dir and file path.
>> 
>>  @param  DirPath - dir path
>>  @param  FilePath- file path
>> @@ -127,7 +127,7 @@ EdbSymbolTypeToStr (
>> 
>> /**
>> 
>> -  Find the symbol 

Re: [edk2] [PATCH] Fix some typos of "according"

2017-02-07 Thread Gao, Liming
Reviewed-by: Liming Gao 

To meet with edk2 patch policy, I will separate this patch per package, then 
push it. 

>-Original Message-
>From: Rebecca Cran [mailto:rebe...@bluestop.org]
>Sent: Wednesday, February 08, 2017 3:41 AM
>To: edk2-devel@lists.01.org
>Cc: Rebecca Cran ; Tian, Feng ;
>Zeng, Star ; Fu, Siyuan ; Wu,
>Jiaxin ; Gao, Liming 
>Subject: [PATCH] Fix some typos of "according"
>
>Cc: Feng Tian 
>Cc: Star Zeng 
>Cc: Siyuan Fu 
>Cc: Jiaxin Wu 
>Cc: Liming Gao 
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Rebecca Cran 
>---
> EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c | 2 +-
> MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c   | 4 ++--
> MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c  | 2 +-
> MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c  | 2
>+-
> MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c  | 6
>+++---
> MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c  | 2
>+-
> MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.h  | 2
>+-
> MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c   | 2 +-
> NetworkPkg/HttpBootDxe/HttpBootConfigStrings.uni  | 2 +-
> 9 files changed, 12 insertions(+), 12 deletions(-)
>
>diff --git
>a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
>b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
>index 535a265046..e71b5e4e7d 100644
>--- a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
>+++ b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
>@@ -854,7 +854,7 @@ GetLangCode (
>   }
>
>   //
>-  // Convert the language accoring to the table.
>+  // Convert the language according to the table.
>   //
>   for (Index = 0; LanguageConvertTable[Index].ISO639 != NULL; Index++) {
> if (wcscmp(LanguageConvertTable[Index].ISO639, Lang) == 0) {
>diff --git a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
>b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
>index eba938e2a9..6cfd35945a 100644
>--- a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
>+++ b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
>@@ -785,7 +785,7 @@ SmmCoreGetMemoryMapMemoryAttributesTable (
> //
>
> /**
>-  Set MemoryProtectionAttribute accroding to PE/COFF image section
>alignment.
>+  Set MemoryProtectionAttribute according to PE/COFF image section
>alignment.
>
>   @param[in]  SectionAlignmentPE/COFF section alignment
> **/
>@@ -1225,7 +1225,7 @@ Finish:
> }
>
> /**
>-  Find image record accroding to image base and size.
>+  Find image record according to image base and size.
>
>   @param[in]  ImageBaseBase of PE image
>   @param[in]  ImageSizeSize of PE image
>diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
>b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
>index a4579bf043..8734291ae3 100644
>--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
>+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
>@@ -396,7 +396,7 @@ HttpParseUrl (
>   FoundAt = FALSE;
>   for (Char = Url; Char < Url + Length; Char++) {
> //
>-// Update state machine accoring to next char.
>+// Update state machine according to next char.
> //
> State = NetHttpParseUrlChar (*Char, State);
>
>diff --git
>a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
>b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
>index 74c17bd248..3dc6376215 100644
>--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
>+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
>@@ -37,7 +37,7 @@ EdbDisplayMemoryUnit (
>   UINT64 Data64;
>
>   //
>-  // Print accroding to width
>+  // Print according to width
>   //
>   switch (Width) {
>   case EdbWidthUint8:
>diff --git
>a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
>b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
>index ba62c6ac27..3ca793059f 100644
>--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
>+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
>@@ -70,7 +70,7 @@ GetDirNameFromFullPath (
>
> /**
>
>-  Construct full path accroding to dir and file path.
>+  Construct full path according to dir and file path.
>
>   @param  DirPath - dir path
>   @param  FilePath- file path
>@@ -127,7 +127,7 @@ EdbSymbolTypeToStr (
>
> /**
>
>-  Find the symbol accroding to address and display symbol.
>+  Find the symbol according to address and display symbol.
>
>   @param  Address - SymbolAddress
>   @param  DebuggerPrivate - EBC Debugger private data structure
>@@ -190,7 +190,7 @@ DebuggerDisplaySymbolAccrodingToAddress (
>
> /**
>
>-  Find the 

[edk2] [Patch][edk2-platforms] Vlv2DeviceRefCodePkg: Fixed thermal issue.

2017-02-07 Thread lushifex
Fixed System auto shutdown when it reached minus 20 degree.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex 
---
 Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL 
b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL
index e63f5bc..fecc040 100644
--- a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL
+++ b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL
@@ -5,7 +5,7 @@
 ;*Family of Customer Reference Boards.*;
 ;**;
 ;**;
-;*Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved   *;
+;*Copyright (c)  1999  - 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 that accompanies this 
distribution.
@@ -69,7 +69,12 @@ Scope(\_TZ)
 {
   Store(DTS1,Local0)
 }
-Return(Add(2732,Multiply(Local0,10)))
+If (LEqual(And(Local0, 0x80), 0)) {
+  Return(Add(2732,Multiply(Local0,10)))
+} else {
+  Add(Subtract(255, Local0), 1, Local0)
+  Return(Subtract(2732,Multiply(Local0,10)))
+}
 //
 // Else return a static value if both EC and DTS are unavailable.
 //
-- 
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] MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength

2017-02-07 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 

-Original Message-
From: Wu, Jiaxin 
Sent: 2017年2月8日 12:58
To: edk2-devel@lists.01.org
Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jiaxin 

Subject: [Patch] MdeModulePkg/DxeHttpLib: Correct the return status for the 
HTTP Port/ContentLength

Replace AsciiStrDecimalToUintn with AsciiStrDecimalToUintnS to return the 
correct status for the HTTP Port/ContentLength.

Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 
---
 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c 
b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index a4579bf..ff7e799 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -1,10 +1,10 @@
 /** @file
   This library is used to share code between UEFI network stack modules.
   It provides the helper routines to parse the HTTP message byte stream.
 
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP  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  
http://opensource.org/licenses/bsd-license.php
@@ -719,13 +719,12 @@ HttpUrlGetPort (
   if (EFI_ERROR (Status)) {
 return Status;
   }
 
   PortString[ResultLength] = '\0';
-  *Port = (UINT16) AsciiStrDecimalToUintn (Url + 
Parser->FieldData[HTTP_URI_FIELD_PORT].Offset);
 
-  return  EFI_SUCCESS;
+  return AsciiStrDecimalToUintnS (Url + 
+ Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN 
+ *) Port);
 }
 
 /**
   Get the Path from a HTTP URL.
 
@@ -930,12 +929,11 @@ HttpIoParseContentLengthHeader (
   Header = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_LENGTH);
   if (Header == NULL) {
 return EFI_NOT_FOUND;
   }
 
-  *ContentLength = AsciiStrDecimalToUintn (Header->FieldValue);
-  return EFI_SUCCESS;
+  return AsciiStrDecimalToUintnS (Header->FieldValue, (CHAR8 **) NULL, 
+ ContentLength);
 }
 
 /**
 
   Check whether the HTTP message is using the "chunked" transfer-coding.
--
1.9.5.msysgit.1

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


Re: [edk2] [Patch] NetworkPkg/NetworkPkg.uni: Define the prompt and help information for PcdAllowHttpConnections

2017-02-07 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 


-Original Message-
From: Wu, Jiaxin 
Sent: 2017年2月8日 12:59
To: edk2-devel@lists.01.org
Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jiaxin 

Subject: [Patch] NetworkPkg/NetworkPkg.uni: Define the prompt and help 
information for PcdAllowHttpConnections

Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 
---
 NetworkPkg/NetworkPkg.uni | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/NetworkPkg.uni b/NetworkPkg/NetworkPkg.uni index 
6eecd88..d0e9b36 100644
--- a/NetworkPkg/NetworkPkg.uni
+++ b/NetworkPkg/NetworkPkg.uni
@@ -1,11 +1,11 @@
 // /** @file
 // This package provides network modules that conform to UEFI 2.4 
specification.
 //
 // This package provides network modules that conform to UEFI 2.4 
specification.
 //
-// Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+// Copyright (c) 2009 - 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  // 
http://opensource.org/licenses/bsd-license.php
@@ -44,10 +44,16 @@
 
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecUefiCertificateKeySize_PROMPT 
 #language en-US "Private Key's size."
 
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecUefiCertificateKeySize_HELP  
#language en-US "Private Key's size."
 
+#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdAllowHttpConnections_PROMPT  
#language en-US "Indicates whether HTTP connections are permitted or not."
+
+#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdAllowHttpConnections_HELP  
#language en-US "Indicates whether HTTP connections are permitted or not.\n"
+   
"TRUE  - HTTP connections are allowed.\n"
+   
"FALSE - HTTP connections are denied."
+
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecCertificateEnabled_PROMPT  
#language en-US "Enable IPsec IKEv2 Certificate Authentication."
 
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecCertificateEnabled_HELP  
#language en-US "Indicates if the IPsec IKEv2 Certificate Authentication 
feature is enabled or not.\n"

   "TRUE  - Certificate Authentication feature is enabled.\n"

   "FALSE - Does not support Certificate Authentication."
--
1.9.5.msysgit.1

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


Re: [edk2] [PATCH] Fix some typos of "according"

2017-02-07 Thread Wu, Jiaxin
Reviewed-by: Wu Jiaxin 


> -Original Message-
> From: Rebecca Cran [mailto:rebe...@bluestop.org]
> Sent: Wednesday, February 8, 2017 3:41 AM
> To: edk2-devel@lists.01.org
> Cc: Rebecca Cran ; Tian, Feng ;
> Zeng, Star ; Fu, Siyuan ; Wu,
> Jiaxin ; Gao, Liming 
> Subject: [PATCH] Fix some typos of "according"
> 
> Cc: Feng Tian 
> Cc: Star Zeng 
> Cc: Siyuan Fu 
> Cc: Jiaxin Wu 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Rebecca Cran 
> ---
>  EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c | 2 +-
>  MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c   | 4 ++--
>  MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c  | 2 +-
>  MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c  | 2
> +-
>  MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c  | 6
> +++---
>  MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c  | 2 +-
>  MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.h  | 2
> +-
>  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c   | 2 +-
>  NetworkPkg/HttpBootDxe/HttpBootConfigStrings.uni  | 2 +-
>  9 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git
> a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
> b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
> index 535a265046..e71b5e4e7d 100644
> --- a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
> +++ b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
> @@ -854,7 +854,7 @@ GetLangCode (
>}
> 
>//
> -  // Convert the language accoring to the table.
> +  // Convert the language according to the table.
>//
>for (Index = 0; LanguageConvertTable[Index].ISO639 != NULL; Index++) {
>  if (wcscmp(LanguageConvertTable[Index].ISO639, Lang) == 0) {
> diff --git a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
> b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
> index eba938e2a9..6cfd35945a 100644
> --- a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
> +++ b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
> @@ -785,7 +785,7 @@ SmmCoreGetMemoryMapMemoryAttributesTable (
>  //
> 
>  /**
> -  Set MemoryProtectionAttribute accroding to PE/COFF image section
> alignment.
> +  Set MemoryProtectionAttribute according to PE/COFF image section
> alignment.
> 
>@param[in]  SectionAlignmentPE/COFF section alignment
>  **/
> @@ -1225,7 +1225,7 @@ Finish:
>  }
> 
>  /**
> -  Find image record accroding to image base and size.
> +  Find image record according to image base and size.
> 
>@param[in]  ImageBaseBase of PE image
>@param[in]  ImageSizeSize of PE image
> diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
> b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
> index a4579bf043..8734291ae3 100644
> --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
> +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
> @@ -396,7 +396,7 @@ HttpParseUrl (
>FoundAt = FALSE;
>for (Char = Url; Char < Url + Length; Char++) {
>  //
> -// Update state machine accoring to next char.
> +// Update state machine according to next char.
>  //
>  State = NetHttpParseUrlChar (*Char, State);
> 
> diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
> b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
> index 74c17bd248..3dc6376215 100644
> --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
> +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
> @@ -37,7 +37,7 @@ EdbDisplayMemoryUnit (
>UINT64 Data64;
> 
>//
> -  // Print accroding to width
> +  // Print according to width
>//
>switch (Width) {
>case EdbWidthUint8:
> diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
> b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
> index ba62c6ac27..3ca793059f 100644
> --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
> +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
> @@ -70,7 +70,7 @@ GetDirNameFromFullPath (
> 
>  /**
> 
> -  Construct full path accroding to dir and file path.
> +  Construct full path according to dir and file path.
> 
>@param  DirPath - dir path
>@param  FilePath- file path
> @@ -127,7 +127,7 @@ EdbSymbolTypeToStr (
> 
>  /**
> 
> -  Find the symbol accroding to address and display symbol.
> +  Find the symbol according to address and display symbol.
> 
>@param  Address - SymbolAddress
>@param  DebuggerPrivate - EBC Debugger private data structure
> @@ -190,7 +190,7 @@ 

[edk2] [Patch] NetworkPkg/NetworkPkg.uni: Define the prompt and help information for PcdAllowHttpConnections

2017-02-07 Thread Jiaxin Wu
Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 
---
 NetworkPkg/NetworkPkg.uni | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/NetworkPkg.uni b/NetworkPkg/NetworkPkg.uni
index 6eecd88..d0e9b36 100644
--- a/NetworkPkg/NetworkPkg.uni
+++ b/NetworkPkg/NetworkPkg.uni
@@ -1,11 +1,11 @@
 // /** @file
 // This package provides network modules that conform to UEFI 2.4 
specification.
 //
 // This package provides network modules that conform to UEFI 2.4 
specification.
 //
-// Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+// Copyright (c) 2009 - 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
 // http://opensource.org/licenses/bsd-license.php
@@ -44,10 +44,16 @@
 
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecUefiCertificateKeySize_PROMPT 
 #language en-US "Private Key's size."
 
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecUefiCertificateKeySize_HELP  
#language en-US "Private Key's size."
 
+#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdAllowHttpConnections_PROMPT  
#language en-US "Indicates whether HTTP connections are permitted or not."
+
+#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdAllowHttpConnections_HELP  
#language en-US "Indicates whether HTTP connections are permitted or not.\n"
+   
"TRUE  - HTTP connections are allowed.\n"
+   
"FALSE - HTTP connections are denied."
+
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecCertificateEnabled_PROMPT  
#language en-US "Enable IPsec IKEv2 Certificate Authentication."
 
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecCertificateEnabled_HELP  
#language en-US "Indicates if the IPsec IKEv2 Certificate Authentication 
feature is enabled or not.\n"

   "TRUE  - Certificate Authentication feature is enabled.\n"

   "FALSE - Does not support Certificate Authentication."
-- 
1.9.5.msysgit.1

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


[edk2] [Patch] MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength

2017-02-07 Thread Jiaxin Wu
Replace AsciiStrDecimalToUintn with AsciiStrDecimalToUintnS to
return the correct status for the HTTP Port/ContentLength.

Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 
---
 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c 
b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index a4579bf..ff7e799 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -1,10 +1,10 @@
 /** @file
   This library is used to share code between UEFI network stack modules.
   It provides the helper routines to parse the HTTP message byte stream.
 
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 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
 http://opensource.org/licenses/bsd-license.php
@@ -719,13 +719,12 @@ HttpUrlGetPort (
   if (EFI_ERROR (Status)) {
 return Status;
   }
 
   PortString[ResultLength] = '\0';
-  *Port = (UINT16) AsciiStrDecimalToUintn (Url + 
Parser->FieldData[HTTP_URI_FIELD_PORT].Offset);
 
-  return  EFI_SUCCESS;
+  return AsciiStrDecimalToUintnS (Url + 
Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN *) Port);
 }
 
 /**
   Get the Path from a HTTP URL.
 
@@ -930,12 +929,11 @@ HttpIoParseContentLengthHeader (
   Header = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_LENGTH);
   if (Header == NULL) {
 return EFI_NOT_FOUND;
   }
 
-  *ContentLength = AsciiStrDecimalToUintn (Header->FieldValue);
-  return EFI_SUCCESS;
+  return AsciiStrDecimalToUintnS (Header->FieldValue, (CHAR8 **) NULL, 
ContentLength);
 }
 
 /**
 
   Check whether the HTTP message is using the "chunked" transfer-coding.
-- 
1.9.5.msysgit.1

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


Re: [edk2] [PATCH] MdeModulePkg: Add dynamic PCD PcdPteMemoryEncryptionAddressOrMask

2017-02-07 Thread Zeng, Star
Does Create4GPageTablesIa32Pae() also need to be updated?

Thanks,
Star
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Leo Duran
Sent: Wednesday, February 8, 2017 3:54 AM
To: edk2-de...@ml01.01.org
Cc: Laszlo Ersek ; Tian, Feng ; Brijesh 
Singh ; Zeng, Star ; Leo Duran 

Subject: [edk2] [PATCH] MdeModulePkg: Add dynamic PCD 
PcdPteMemoryEncryptionAddressOrMask

From: Brijesh Singh 

This dynamic PCD holds the address mask for page table entries when memory 
encryption is enabled on AMD processors supporting the Secure Encrypted 
Virtualization (SEV) feature.

Cc: Feng Tian 
Cc: Star Zeng 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leo Duran 
---
 MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf  |  5 -
 MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 18 ++
 MdeModulePkg/MdeModulePkg.dec|  8 
 3 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf 
b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
index 2bc41be..d62bd9b 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
@@ -6,6 +6,8 @@
 #  needed to run the DXE Foundation.
 #
 #  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+#  Copyright (c) 2017, AMD Incorporated. 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 @@ 
-111,7 +113,8 @@ [FeaturePcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress ## CONSUMES
 
 [Pcd.IA32,Pcd.X64]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable  ## 
SOMETIMES_CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable  ## 
SOMETIMES_CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask## 
CONSUMES
 
 [Pcd.IA32,Pcd.X64,Pcd.ARM,Pcd.AARCH64]
   gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack   ## 
SOMETIMES_CONSUMES
diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c 
b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
index 790f6ab..2c52389 100644
--- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
+++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
@@ -16,6 +16,8 @@
 3) IA-32 Intel(R) Architecture Software Developer's Manual Volume 3:System 
Programmer's Guide, Intel
 
 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2017, AMD Incorporated. 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 @@ -71,14 +73,14 @@ 
Split2MPageTo4K (
   //
   // Fill in 2M page entry.
   //
-  *PageEntry2M = (UINT64) (UINTN) PageTableEntry | IA32_PG_P | IA32_PG_RW;
+  *PageEntry2M = (UINT64) (UINTN) PageTableEntry | PcdGet64 
+ (PcdPteMemoryEncryptionAddressOrMask) | IA32_PG_P | IA32_PG_RW;
 
   PhysicalAddress4K = PhysicalAddress;
   for (IndexOfPageTableEntries = 0; IndexOfPageTableEntries < 512; 
IndexOfPageTableEntries++, PageTableEntry++, PhysicalAddress4K += SIZE_4KB) {
 //
 // Fill in the Page Table entries
 //
-PageTableEntry->Uint64 = (UINT64) PhysicalAddress4K;
+PageTableEntry->Uint64 = (UINT64) PhysicalAddress4K | PcdGet64 
+ (PcdPteMemoryEncryptionAddressOrMask);
 PageTableEntry->Bits.ReadWrite = 1;
 PageTableEntry->Bits.Present = 1;
 if ((PhysicalAddress4K >= StackBase) && (PhysicalAddress4K < StackBase + 
StackSize)) { @@ -116,7 +118,7 @@ Split1GPageTo2M (
   //
   // Fill in 1G page entry.
   //
-  *PageEntry1G = (UINT64) (UINTN) PageDirectoryEntry | IA32_PG_P | IA32_PG_RW;
+  *PageEntry1G = (UINT64) (UINTN) PageDirectoryEntry | PcdGet64 
+ (PcdPteMemoryEncryptionAddressOrMask) | IA32_PG_P | IA32_PG_RW;
 
   PhysicalAddress2M = PhysicalAddress;
   for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; 
IndexOfPageDirectoryEntries++, PageDirectoryEntry++, PhysicalAddress2M += 
SIZE_2MB) { @@ -129,7 +131,7 @@ Split1GPageTo2M (
   //
   // Fill in the Page Directory entries
   //
-  PageDirectoryEntry->Uint64 = (UINT64) PhysicalAddress2M;
+  PageDirectoryEntry->Uint64 = (UINT64) PhysicalAddress2M | 
+ PcdGet64 (PcdPteMemoryEncryptionAddressOrMask);
   PageDirectoryEntry->Bits.ReadWrite = 1;
   PageDirectoryEntry->Bits.Present = 1;
   PageDirectoryEntry->Bits.MustBe1 = 1; @@ -248,7 +250,7 @@ 
CreateIdentityMappingPageTables (
 //
 // Make a PML4 Entry
 //
-

Re: [edk2] [Patch][edk2-platforms/devel-MinnowBoard3] Change BIOS version to 0061

2017-02-07 Thread Lu, ShifeiX A
Reviewed-by: lushifex 

Thanks,
Shifei

-Original Message-
From: Guo, Mang 
Sent: Wednesday, February 08, 2017 10:11 AM
To: edk2-devel@lists.01.org
Cc: Wei, David; Lu, ShifeiX A
Subject: [Patch][edk2-platforms/devel-MinnowBoard3] Change BIOS version to 0061

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Mang 
---
 Platform/BroxtonPlatformPkg/BiosId.env | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Platform/BroxtonPlatformPkg/BiosId.env 
b/Platform/BroxtonPlatformPkg/BiosId.env
index e7eda3d..bed8730 100644
--- a/Platform/BroxtonPlatformPkg/BiosId.env
+++ b/Platform/BroxtonPlatformPkg/BiosId.env
@@ -15,7 +15,7 @@
 #DATE  = 150130
 #TIME  = 1017
 #
-#  Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.
+#  Copyright (c) 2008 - 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
@@ -31,5 +31,5 @@ BOARD_ID  = APLKRVP
 BOARD_REV = 3
 OEM_ID = X64
 BUILD_TYPE= D
-VERSION_MAJOR = 0060
+VERSION_MAJOR = 0061
 VERSION_MINOR = 01
--
2.10.1.windows.1

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


[edk2] [Patch][edk2-platforms/devel-MinnowBoard3] Change BIOS version to 0061

2017-02-07 Thread Guo, Mang
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Mang 
---
 Platform/BroxtonPlatformPkg/BiosId.env | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Platform/BroxtonPlatformPkg/BiosId.env 
b/Platform/BroxtonPlatformPkg/BiosId.env
index e7eda3d..bed8730 100644
--- a/Platform/BroxtonPlatformPkg/BiosId.env
+++ b/Platform/BroxtonPlatformPkg/BiosId.env
@@ -15,7 +15,7 @@
 #DATE  = 150130
 #TIME  = 1017
 #
-#  Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.
+#  Copyright (c) 2008 - 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
@@ -31,5 +31,5 @@ BOARD_ID  = APLKRVP
 BOARD_REV = 3
 OEM_ID = X64
 BUILD_TYPE= D
-VERSION_MAJOR = 0060
+VERSION_MAJOR = 0061
 VERSION_MINOR = 01
-- 
2.10.1.windows.1

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


Re: [edk2] [PATCH] Fix some typos of "according"

2017-02-07 Thread Tian, Feng
MdeModulePkg reviewed-by: Feng Tian 

Thanks
Feng

-Original Message-
From: Zeng, Star 
Sent: Wednesday, February 8, 2017 9:45 AM
To: Rebecca Cran ; edk2-devel@lists.01.org
Cc: Tian, Feng ; Fu, Siyuan ; Wu, 
Jiaxin ; Gao, Liming ; Zeng, Star 

Subject: RE: [PATCH] Fix some typos of "according"

Reviewed-by: Star Zeng 

-Original Message-
From: Rebecca Cran [mailto:rebe...@bluestop.org] 
Sent: Wednesday, February 8, 2017 3:41 AM
To: edk2-devel@lists.01.org
Cc: Rebecca Cran ; Tian, Feng ; 
Zeng, Star ; Fu, Siyuan ; Wu, Jiaxin 
; Gao, Liming 
Subject: [PATCH] Fix some typos of "according"

Cc: Feng Tian 
Cc: Star Zeng 
Cc: Siyuan Fu 
Cc: Jiaxin Wu 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Rebecca Cran 
---
 EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c | 2 +-
 MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c   | 4 ++--
 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c  | 2 +-
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c  | 2 +-
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c  | 6 +++---
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c  | 2 +-
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.h  | 2 +-
 MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c   | 2 +-
 NetworkPkg/HttpBootDxe/HttpBootConfigStrings.uni  | 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c 
b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
index 535a265046..e71b5e4e7d 100644
--- a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
+++ b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
@@ -854,7 +854,7 @@ GetLangCode (
   }
 
   //
-  // Convert the language accoring to the table.
+  // Convert the language according to the table.
   //
   for (Index = 0; LanguageConvertTable[Index].ISO639 != NULL; Index++) {
 if (wcscmp(LanguageConvertTable[Index].ISO639, Lang) == 0) { diff --git 
a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c 
b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
index eba938e2a9..6cfd35945a 100644
--- a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
+++ b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
@@ -785,7 +785,7 @@ SmmCoreGetMemoryMapMemoryAttributesTable (  //
 
 /**
-  Set MemoryProtectionAttribute accroding to PE/COFF image section alignment.
+  Set MemoryProtectionAttribute according to PE/COFF image section alignment.
 
   @param[in]  SectionAlignmentPE/COFF section alignment
 **/
@@ -1225,7 +1225,7 @@ Finish:
 }
 
 /**
-  Find image record accroding to image base and size.
+  Find image record according to image base and size.
 
   @param[in]  ImageBaseBase of PE image
   @param[in]  ImageSizeSize of PE image
diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c 
b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index a4579bf043..8734291ae3 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -396,7 +396,7 @@ HttpParseUrl (
   FoundAt = FALSE;
   for (Char = Url; Char < Url + Length; Char++) {
 //
-// Update state machine accoring to next char.
+// Update state machine according to next char.
 //
 State = NetHttpParseUrlChar (*Char, State);
 
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c 
b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
index 74c17bd248..3dc6376215 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
@@ -37,7 +37,7 @@ EdbDisplayMemoryUnit (
   UINT64 Data64;
 
   //
-  // Print accroding to width
+  // Print according to width
   //
   switch (Width) {
   case EdbWidthUint8:
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c 
b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
index ba62c6ac27..3ca793059f 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
@@ -70,7 +70,7 @@ GetDirNameFromFullPath (
 
 /**
 
-  Construct full path accroding to dir and file path.
+  Construct full path according to dir and file path.
 
   @param  DirPath - dir path
   @param  FilePath- file path
@@ -127,7 +127,7 @@ EdbSymbolTypeToStr (
 
 /**
 
-  Find the symbol accroding to address and display symbol.

Re: [edk2] [PATCH] Fix some typos of "according"

2017-02-07 Thread Zeng, Star
Reviewed-by: Star Zeng 

-Original Message-
From: Rebecca Cran [mailto:rebe...@bluestop.org] 
Sent: Wednesday, February 8, 2017 3:41 AM
To: edk2-devel@lists.01.org
Cc: Rebecca Cran ; Tian, Feng ; 
Zeng, Star ; Fu, Siyuan ; Wu, Jiaxin 
; Gao, Liming 
Subject: [PATCH] Fix some typos of "according"

Cc: Feng Tian 
Cc: Star Zeng 
Cc: Siyuan Fu 
Cc: Jiaxin Wu 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Rebecca Cran 
---
 EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c | 2 +-
 MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c   | 4 ++--
 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c  | 2 +-
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c  | 2 +-
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c  | 6 +++---
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c  | 2 +-
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.h  | 2 +-
 MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c   | 2 +-
 NetworkPkg/HttpBootDxe/HttpBootConfigStrings.uni  | 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c 
b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
index 535a265046..e71b5e4e7d 100644
--- a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
+++ b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
@@ -854,7 +854,7 @@ GetLangCode (
   }
 
   //
-  // Convert the language accoring to the table.
+  // Convert the language according to the table.
   //
   for (Index = 0; LanguageConvertTable[Index].ISO639 != NULL; Index++) {
 if (wcscmp(LanguageConvertTable[Index].ISO639, Lang) == 0) { diff --git 
a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c 
b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
index eba938e2a9..6cfd35945a 100644
--- a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
+++ b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
@@ -785,7 +785,7 @@ SmmCoreGetMemoryMapMemoryAttributesTable (  //
 
 /**
-  Set MemoryProtectionAttribute accroding to PE/COFF image section alignment.
+  Set MemoryProtectionAttribute according to PE/COFF image section alignment.
 
   @param[in]  SectionAlignmentPE/COFF section alignment
 **/
@@ -1225,7 +1225,7 @@ Finish:
 }
 
 /**
-  Find image record accroding to image base and size.
+  Find image record according to image base and size.
 
   @param[in]  ImageBaseBase of PE image
   @param[in]  ImageSizeSize of PE image
diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c 
b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index a4579bf043..8734291ae3 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -396,7 +396,7 @@ HttpParseUrl (
   FoundAt = FALSE;
   for (Char = Url; Char < Url + Length; Char++) {
 //
-// Update state machine accoring to next char.
+// Update state machine according to next char.
 //
 State = NetHttpParseUrlChar (*Char, State);
 
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c 
b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
index 74c17bd248..3dc6376215 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
@@ -37,7 +37,7 @@ EdbDisplayMemoryUnit (
   UINT64 Data64;
 
   //
-  // Print accroding to width
+  // Print according to width
   //
   switch (Width) {
   case EdbWidthUint8:
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c 
b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
index ba62c6ac27..3ca793059f 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
@@ -70,7 +70,7 @@ GetDirNameFromFullPath (
 
 /**
 
-  Construct full path accroding to dir and file path.
+  Construct full path according to dir and file path.
 
   @param  DirPath - dir path
   @param  FilePath- file path
@@ -127,7 +127,7 @@ EdbSymbolTypeToStr (
 
 /**
 
-  Find the symbol accroding to address and display symbol.
+  Find the symbol according to address and display symbol.
 
   @param  Address - SymbolAddress
   @param  DebuggerPrivate - EBC Debugger private data structure @@ -190,7 
+190,7 @@ DebuggerDisplaySymbolAccrodingToAddress (
 
 /**
 
-  Find the symbol accroding to name and display symbol.
+  Find the symbol according to name and display symbol.
 
   @param  SymbolFileName  - The Symbol File Name, NULL means for all
   @param  SymbolName 

Re: [edk2] [PATCH v3 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros

2017-02-07 Thread Laszlo Ersek
On 02/08/17 01:58, Ni, Ruiyu wrote:
> These macros comply with the spec so I had no reason to deprecate them.
> 
> But I did want to avoid using them in drivers.
> 
> Maybe I could just deprecate the two macros PCI_ACPI_UNUSED and
> PCI_BAR_NOCHANGE.
> 
> What do you think?

I'm fine either way:
- deprecating these two macros (and keeping patch #5 as-is, modulo the
  whitespace fix) sounds good,
- not deprecating these two macros (and then preserving them in OVMF
  too) sounds good as well.

What I don't really understand is, what speaks against using the two
macros if they are not deprecated / against the spec?

But, again, if you deprecate these two as well, that's totally fine by me.

Thanks!
Laszlo

> 
>  
> 
> Regards,
> 
> Ray
> 
>  
> 
> *From:*edk2-devel [mailto:edk2-devel-boun...@lists.01.org] *On Behalf Of
> *Laszlo Ersek
> *Sent:* Wednesday, February 8, 2017 1:43 AM
> *To:* Ni, Ruiyu ; edk2-de...@ml01.01.org
> *Cc:* Fan, Jeff 
> *Subject:* Re: [edk2] [PATCH v3 6/6] MdePkg/Pci22.h: Deprecate
> out-of-Spec IncompatiblePciDevice macros
> 
>  
> 
> On 02/07/17 04:33, Ruiyu Ni wrote:
>> DEVICE_ID_NOCARE is defined as 0x but Spec says (UINT64) -1
>> should be used to match any VendorId/DeviceId/RevisionId/
>> SubsystemVendorId/SubsystemDeviceId.
>> 
>> PCI_BAR_OLD_ALIGN/PCI_BAR_EVEN_ALIGN/PCI_BAR_SQUAD_ALIGN/
>> PCI_BAR_DQUAD_ALIGN are defined but Spec doesn't have such
>> definitions.
>> 
>> PCI_BAR_ALL is defined as 0xFF but Spec says (UINT64) -1 should be
>> used to match all BARs.
>> 
>> All of the above macros are marked as deprecated.
>> 
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Ruiyu Ni >
>> Reviewed-by: Liming Gao >
>> Cc: Jeff Fan >
>> ---
>>  MdePkg/Include/IndustryStandard/Pci22.h | 24 +---
>>  1 file changed, 17 insertions(+), 7 deletions(-)
>> 
>> diff --git a/MdePkg/Include/IndustryStandard/Pci22.h 
>> b/MdePkg/Include/IndustryStandard/Pci22.h
>> index 4cf8389..5dec65d 100644
>> --- a/MdePkg/Include/IndustryStandard/Pci22.h
>> +++ b/MdePkg/Include/IndustryStandard/Pci22.h
>> @@ -7,7 +7,7 @@
>>  PC Card Standard, 8.0
>>  PCI Power Management Interface Specifiction, Revision 1.2
>>  
>> -  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
>> +  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
>>Copyright (c) 2014 - 2015, Hewlett-Packard Development Company, L.P.
>>This program and the accompanying materials  
>>are licensed and made available under the terms and conditions of the BSD 
>> License 
>> @@ -780,14 +780,25 @@ typedef struct {
>>///
>>  } EFI_PCI_CAPABILITY_HOTPLUG;
>>  
>> -#define DEVICE_ID_NOCARE0x
>> +///
>> +/// Below macros (till PCI_BAR_NOCHANGE) were used by 
>> EfiIncompatiblePciDeviceSupport Protocol.
>> +///
>> +#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
>> +
>> +///
>> +/// [ATTENTION] These macros are deprecated because they don't match Spec 
>> or not defined in Spec.
>> +///
>> +#define DEVICE_ID_NOCARE0x ///< Deprecated. Value 
>> doesn't match Spec.
>> +#define PCI_BAR_OLD_ALIGN   0xULL  ///< Deprecated. Value 
>> isn't defined in Spec.
>> +#define PCI_BAR_EVEN_ALIGN  0xFFFEULL  ///< Deprecated. Value 
>> isn't defined in Spec.
>> +#define PCI_BAR_SQUAD_ALIGN 0xFFFDULL  ///< Deprecated. Value 
>> isn't defined in Spec.
>> +#define PCI_BAR_DQUAD_ALIGN 0xFFFCULL  ///< Deprecated. Value 
>> isn't defined in Spec.
>> +#define PCI_BAR_ALL 0xFF   ///< Deprecated. Value 
>> doesn't match Spec.
>> +
>> +#endif
>>  
>>  #define PCI_ACPI_UNUSED 0
>>  #define PCI_BAR_NOCHANGE0
> 
> Any particular reason for not deprecating these two macros? Is it an
> oversight, or is it intentional to keep them?
> 
> (If they comply with the spec, then replacing them in patch #5 seems
> unwarranted.)
> 
> Thanks,
> Laszlo
> 
>> -#define PCI_BAR_OLD_ALIGN   0xULL
>> -#define PCI_BAR_EVEN_ALIGN  0xFFFEULL
>> -#define PCI_BAR_SQUAD_ALIGN 0xFFFDULL
>> -#define PCI_BAR_DQUAD_ALIGN 0xFFFCULL
>>  
>>  #define PCI_BAR_IDX00x00
>>  #define PCI_BAR_IDX10x01
>> @@ -795,7 +806,6 @@ typedef struct {
>>  #define PCI_BAR_IDX30x03
>>  #define PCI_BAR_IDX40x04
>>  #define PCI_BAR_IDX50x05
>> -#define PCI_BAR_ALL 0xFF
>>  
>>  ///
>>  /// EFI PCI Option ROM definitions
>> 
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org 
> https://lists.01.org/mailman/listinfo/edk2-devel
> 

___
edk2-devel mailing list
edk2-devel@lists.01.org

Re: [edk2] [PATCH] Fix some typos of "according"

2017-02-07 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 

-Original Message-
From: Rebecca Cran [mailto:rebe...@bluestop.org] 
Sent: 2017年2月8日 3:41
To: edk2-devel@lists.01.org
Cc: Rebecca Cran ; Tian, Feng ; 
Zeng, Star ; Fu, Siyuan ; Wu, Jiaxin 
; Gao, Liming 
Subject: [PATCH] Fix some typos of "according"

Cc: Feng Tian 
Cc: Star Zeng 
Cc: Siyuan Fu 
Cc: Jiaxin Wu 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Rebecca Cran 
---
 EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c | 2 +-
 MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c   | 4 ++--
 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c  | 2 +-
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c  | 2 +-
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c  | 6 +++---
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c  | 2 +-
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.h  | 2 +-
 MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c   | 2 +-
 NetworkPkg/HttpBootDxe/HttpBootConfigStrings.uni  | 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c 
b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
index 535a265046..e71b5e4e7d 100644
--- a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
+++ b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
@@ -854,7 +854,7 @@ GetLangCode (
   }
 
   //
-  // Convert the language accoring to the table.
+  // Convert the language according to the table.
   //
   for (Index = 0; LanguageConvertTable[Index].ISO639 != NULL; Index++) {
 if (wcscmp(LanguageConvertTable[Index].ISO639, Lang) == 0) { diff --git 
a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c 
b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
index eba938e2a9..6cfd35945a 100644
--- a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
+++ b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
@@ -785,7 +785,7 @@ SmmCoreGetMemoryMapMemoryAttributesTable (  //
 
 /**
-  Set MemoryProtectionAttribute accroding to PE/COFF image section alignment.
+  Set MemoryProtectionAttribute according to PE/COFF image section alignment.
 
   @param[in]  SectionAlignmentPE/COFF section alignment
 **/
@@ -1225,7 +1225,7 @@ Finish:
 }
 
 /**
-  Find image record accroding to image base and size.
+  Find image record according to image base and size.
 
   @param[in]  ImageBaseBase of PE image
   @param[in]  ImageSizeSize of PE image
diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c 
b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index a4579bf043..8734291ae3 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -396,7 +396,7 @@ HttpParseUrl (
   FoundAt = FALSE;
   for (Char = Url; Char < Url + Length; Char++) {
 //
-// Update state machine accoring to next char.
+// Update state machine according to next char.
 //
 State = NetHttpParseUrlChar (*Char, State);
 
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c 
b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
index 74c17bd248..3dc6376215 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
@@ -37,7 +37,7 @@ EdbDisplayMemoryUnit (
   UINT64 Data64;
 
   //
-  // Print accroding to width
+  // Print according to width
   //
   switch (Width) {
   case EdbWidthUint8:
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c 
b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
index ba62c6ac27..3ca793059f 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
@@ -70,7 +70,7 @@ GetDirNameFromFullPath (
 
 /**
 
-  Construct full path accroding to dir and file path.
+  Construct full path according to dir and file path.
 
   @param  DirPath - dir path
   @param  FilePath- file path
@@ -127,7 +127,7 @@ EdbSymbolTypeToStr (
 
 /**
 
-  Find the symbol accroding to address and display symbol.
+  Find the symbol according to address and display symbol.
 
   @param  Address - SymbolAddress
   @param  DebuggerPrivate - EBC Debugger private data structure @@ -190,7 
+190,7 @@ DebuggerDisplaySymbolAccrodingToAddress (
 
 /**
 
-  Find the symbol accroding to name and display symbol.
+  Find the symbol according to name and display symbol.
 
   @param  SymbolFileName  - The Symbol File Name, NULL means for all
   @param  SymbolName  - The Symbol Name, 

Re: [edk2] [PATCH v3 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros

2017-02-07 Thread Ni, Ruiyu
These macros comply with the spec so I had no reason to deprecate them.
But I did want to avoid using them in drivers.
Maybe I could just deprecate the two macros PCI_ACPI_UNUSED and 
PCI_BAR_NOCHANGE.
What do you think?


Regards,
Ray

From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
Ersek
Sent: Wednesday, February 8, 2017 1:43 AM
To: Ni, Ruiyu ; edk2-de...@ml01.01.org
Cc: Fan, Jeff 
Subject: Re: [edk2] [PATCH v3 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec 
IncompatiblePciDevice macros

On 02/07/17 04:33, Ruiyu Ni wrote:
> DEVICE_ID_NOCARE is defined as 0x but Spec says (UINT64) -1
> should be used to match any VendorId/DeviceId/RevisionId/
> SubsystemVendorId/SubsystemDeviceId.
>
> PCI_BAR_OLD_ALIGN/PCI_BAR_EVEN_ALIGN/PCI_BAR_SQUAD_ALIGN/
> PCI_BAR_DQUAD_ALIGN are defined but Spec doesn't have such
> definitions.
>
> PCI_BAR_ALL is defined as 0xFF but Spec says (UINT64) -1 should be
> used to match all BARs.
>
> All of the above macros are marked as deprecated.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni >
> Reviewed-by: Liming Gao >
> Cc: Jeff Fan >
> ---
>  MdePkg/Include/IndustryStandard/Pci22.h | 24 +---
>  1 file changed, 17 insertions(+), 7 deletions(-)
>
> diff --git a/MdePkg/Include/IndustryStandard/Pci22.h 
> b/MdePkg/Include/IndustryStandard/Pci22.h
> index 4cf8389..5dec65d 100644
> --- a/MdePkg/Include/IndustryStandard/Pci22.h
> +++ b/MdePkg/Include/IndustryStandard/Pci22.h
> @@ -7,7 +7,7 @@
>  PC Card Standard, 8.0
>  PCI Power Management Interface Specifiction, Revision 1.2
>
> -  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
> +  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
>Copyright (c) 2014 - 2015, Hewlett-Packard Development Company, L.P.
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -780,14 +780,25 @@ typedef struct {
>///
>  } EFI_PCI_CAPABILITY_HOTPLUG;
>
> -#define DEVICE_ID_NOCARE0x
> +///
> +/// Below macros (till PCI_BAR_NOCHANGE) were used by 
> EfiIncompatiblePciDeviceSupport Protocol.
> +///
> +#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
> +
> +///
> +/// [ATTENTION] These macros are deprecated because they don't match Spec or 
> not defined in Spec.
> +///
> +#define DEVICE_ID_NOCARE0x ///< Deprecated. Value 
> doesn't match Spec.
> +#define PCI_BAR_OLD_ALIGN   0xULL  ///< Deprecated. Value 
> isn't defined in Spec.
> +#define PCI_BAR_EVEN_ALIGN  0xFFFEULL  ///< Deprecated. Value 
> isn't defined in Spec.
> +#define PCI_BAR_SQUAD_ALIGN 0xFFFDULL  ///< Deprecated. Value 
> isn't defined in Spec.
> +#define PCI_BAR_DQUAD_ALIGN 0xFFFCULL  ///< Deprecated. Value 
> isn't defined in Spec.
> +#define PCI_BAR_ALL 0xFF   ///< Deprecated. Value 
> doesn't match Spec.
> +
> +#endif
>
>  #define PCI_ACPI_UNUSED 0
>  #define PCI_BAR_NOCHANGE0

Any particular reason for not deprecating these two macros? Is it an
oversight, or is it intentional to keep them?

(If they comply with the spec, then replacing them in patch #5 seems
unwarranted.)

Thanks,
Laszlo

> -#define PCI_BAR_OLD_ALIGN   0xULL
> -#define PCI_BAR_EVEN_ALIGN  0xFFFEULL
> -#define PCI_BAR_SQUAD_ALIGN 0xFFFDULL
> -#define PCI_BAR_DQUAD_ALIGN 0xFFFCULL
>
>  #define PCI_BAR_IDX00x00
>  #define PCI_BAR_IDX10x01
> @@ -795,7 +806,6 @@ typedef struct {
>  #define PCI_BAR_IDX30x03
>  #define PCI_BAR_IDX40x04
>  #define PCI_BAR_IDX50x05
> -#define PCI_BAR_ALL 0xFF
>
>  ///
>  /// EFI PCI Option ROM definitions
>

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


Re: [edk2] [Patch] BaseTools: Fix the bug to parse the short varname in map file

2017-02-07 Thread Gao, Liming
Reviewed-by: Liming Gao 

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Yonghong 
Zhu
Sent: Tuesday, February 7, 2017 8:31 PM
To: edk2-devel@lists.01.org
Cc: Gao, Liming 
Subject: [edk2] [Patch] BaseTools: Fix the bug to parse the short varname in 
map file

current in the map file, there have two ways for var to save its offset,
if the varname is short, then the offset will in the same line with
varname, otherwise, it saved in the next line.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu 
---
 BaseTools/Source/Python/Common/Misc.py | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Misc.py 
b/BaseTools/Source/Python/Common/Misc.py
index 43d0818..1a5968a 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -1,9 +1,9 @@
 ## @file
 # Common routines used by all tools
 #
-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 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
 # http://opensource.org/licenses/bsd-license.php
 #
@@ -91,14 +91,20 @@ def _parseForGCC(lines, efifilepath, varnames):
 if status == 3:
 m = re.match('^([\w_\.]+) +([\da-fA-Fx]+) +([\da-fA-Fx]+)$', line)
 if m != None:
 sections.append(m.groups(0))
 for varname in varnames:
-m = re.match(".data.(%s)$" % varname, line)
+Str = ''
+m = re.match("^.data.(%s)" % varname, line)
 if m != None:
-if lines[index + 1]:
-m = re.match('^([\da-fA-Fx]+) +([\da-fA-Fx]+)', 
lines[index + 1].strip())
+m = re.match(".data.(%s)$" % varname, line)
+if m != None:
+Str = lines[index + 1]
+else:
+Str = line[len(".data.%s" % varname):]
+if Str:
+m = re.match('^([\da-fA-Fx]+) +([\da-fA-Fx]+)', 
Str.strip())
 if m != None:
 varoffset.append((varname, int(m.groups(0)[0], 16) 
, int(sections[-1][1], 16), sections[-1][0]))
 
 if not varoffset:
 return []
-- 
2.6.1.windows.1

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


[edk2] [PATCH] MdeModulePkg: Add dynamic PCD PcdPteMemoryEncryptionAddressOrMask

2017-02-07 Thread Leo Duran
From: Brijesh Singh 

This dynamic PCD holds the address mask for page table entries when memory
encryption is enabled on AMD processors supporting the Secure Encrypted
Virtualization (SEV) feature.

Cc: Feng Tian 
Cc: Star Zeng 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leo Duran 
---
 MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf  |  5 -
 MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 18 ++
 MdeModulePkg/MdeModulePkg.dec|  8 
 3 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf 
b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
index 2bc41be..d62bd9b 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
@@ -6,6 +6,8 @@
 #  needed to run the DXE Foundation.
 #
 #  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+#  Copyright (c) 2017, AMD Incorporated. 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
@@ -111,7 +113,8 @@ [FeaturePcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress ## CONSUMES
 
 [Pcd.IA32,Pcd.X64]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable  ## 
SOMETIMES_CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable  ## 
SOMETIMES_CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask## 
CONSUMES
 
 [Pcd.IA32,Pcd.X64,Pcd.ARM,Pcd.AARCH64]
   gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack   ## 
SOMETIMES_CONSUMES
diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c 
b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
index 790f6ab..2c52389 100644
--- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
+++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
@@ -16,6 +16,8 @@
 3) IA-32 Intel(R) Architecture Software Developer's Manual Volume 3:System 
Programmer's Guide, Intel
 
 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2017, AMD Incorporated. 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
@@ -71,14 +73,14 @@ Split2MPageTo4K (
   //
   // Fill in 2M page entry.
   //
-  *PageEntry2M = (UINT64) (UINTN) PageTableEntry | IA32_PG_P | IA32_PG_RW;
+  *PageEntry2M = (UINT64) (UINTN) PageTableEntry | PcdGet64 
(PcdPteMemoryEncryptionAddressOrMask) | IA32_PG_P | IA32_PG_RW;
 
   PhysicalAddress4K = PhysicalAddress;
   for (IndexOfPageTableEntries = 0; IndexOfPageTableEntries < 512; 
IndexOfPageTableEntries++, PageTableEntry++, PhysicalAddress4K += SIZE_4KB) {
 //
 // Fill in the Page Table entries
 //
-PageTableEntry->Uint64 = (UINT64) PhysicalAddress4K;
+PageTableEntry->Uint64 = (UINT64) PhysicalAddress4K | PcdGet64 
(PcdPteMemoryEncryptionAddressOrMask);
 PageTableEntry->Bits.ReadWrite = 1;
 PageTableEntry->Bits.Present = 1;
 if ((PhysicalAddress4K >= StackBase) && (PhysicalAddress4K < StackBase + 
StackSize)) {
@@ -116,7 +118,7 @@ Split1GPageTo2M (
   //
   // Fill in 1G page entry.
   //
-  *PageEntry1G = (UINT64) (UINTN) PageDirectoryEntry | IA32_PG_P | IA32_PG_RW;
+  *PageEntry1G = (UINT64) (UINTN) PageDirectoryEntry | PcdGet64 
(PcdPteMemoryEncryptionAddressOrMask) | IA32_PG_P | IA32_PG_RW;
 
   PhysicalAddress2M = PhysicalAddress;
   for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; 
IndexOfPageDirectoryEntries++, PageDirectoryEntry++, PhysicalAddress2M += 
SIZE_2MB) {
@@ -129,7 +131,7 @@ Split1GPageTo2M (
   //
   // Fill in the Page Directory entries
   //
-  PageDirectoryEntry->Uint64 = (UINT64) PhysicalAddress2M;
+  PageDirectoryEntry->Uint64 = (UINT64) PhysicalAddress2M | PcdGet64 
(PcdPteMemoryEncryptionAddressOrMask);
   PageDirectoryEntry->Bits.ReadWrite = 1;
   PageDirectoryEntry->Bits.Present = 1;
   PageDirectoryEntry->Bits.MustBe1 = 1;
@@ -248,7 +250,7 @@ CreateIdentityMappingPageTables (
 //
 // Make a PML4 Entry
 //
-PageMapLevel4Entry->Uint64 = (UINT64)(UINTN)PageDirectoryPointerEntry;
+PageMapLevel4Entry->Uint64 = (UINT64)(UINTN)PageDirectoryPointerEntry | 
PcdGet64 (PcdPteMemoryEncryptionAddressOrMask);
 PageMapLevel4Entry->Bits.ReadWrite = 1;
 PageMapLevel4Entry->Bits.Present = 1;
 
@@ -262,7 +264,7 @@ CreateIdentityMappingPageTables (
   //
   // Fill in the Page Directory entries
   //
-  PageDirectory1GEntry->Uint64 = (UINT64)PageAddress;
+  PageDirectory1GEntry->Uint64 = 

[edk2] [PATCH] MdeModulePkg: Add dynamic PCD

2017-02-07 Thread Leo Duran
The new PcdPteMemoryEncryptionAddressOrMask dynamic PCD holds the address
mask for page table entries when memory encryption is enabled on AMD
processors supporting the Secure Encrypted Virtualization (SEV) feature.

This mask should be applied when creating 1:1 virtual to physical mapping 
tables.
For example, the OvmfPkg sets the PCD when launching SEV-enabled guests.

Brijesh Singh (1):
  MdeModulePkg: Add dynamic PCD PcdPteMemoryEncryptionAddressOrMask

 MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf  |  5 -
 MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 18 ++
 MdeModulePkg/MdeModulePkg.dec|  8 
 3 files changed, 22 insertions(+), 9 deletions(-)

-- 
1.9.1

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


[edk2] [PATCH] Fix some typos of "according"

2017-02-07 Thread Rebecca Cran
Cc: Feng Tian 
Cc: Star Zeng 
Cc: Siyuan Fu 
Cc: Jiaxin Wu 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Rebecca Cran 
---
 EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c | 2 +-
 MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c   | 4 ++--
 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c  | 2 +-
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c  | 2 +-
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c  | 6 +++---
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c  | 2 +-
 MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.h  | 2 +-
 MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c   | 2 +-
 NetworkPkg/HttpBootDxe/HttpBootConfigStrings.uni  | 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c 
b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
index 535a265046..e71b5e4e7d 100644
--- a/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
+++ b/EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
@@ -854,7 +854,7 @@ GetLangCode (
   }
 
   //
-  // Convert the language accoring to the table.
+  // Convert the language according to the table.
   //
   for (Index = 0; LanguageConvertTable[Index].ISO639 != NULL; Index++) {
 if (wcscmp(LanguageConvertTable[Index].ISO639, Lang) == 0) {
diff --git a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c 
b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
index eba938e2a9..6cfd35945a 100644
--- a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
+++ b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
@@ -785,7 +785,7 @@ SmmCoreGetMemoryMapMemoryAttributesTable (
 //
 
 /**
-  Set MemoryProtectionAttribute accroding to PE/COFF image section alignment.
+  Set MemoryProtectionAttribute according to PE/COFF image section alignment.
 
   @param[in]  SectionAlignmentPE/COFF section alignment
 **/
@@ -1225,7 +1225,7 @@ Finish:
 }
 
 /**
-  Find image record accroding to image base and size.
+  Find image record according to image base and size.
 
   @param[in]  ImageBaseBase of PE image
   @param[in]  ImageSizeSize of PE image
diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c 
b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index a4579bf043..8734291ae3 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -396,7 +396,7 @@ HttpParseUrl (
   FoundAt = FALSE;
   for (Char = Url; Char < Url + Length; Char++) {
 //
-// Update state machine accoring to next char.
+// Update state machine according to next char.
 //
 State = NetHttpParseUrlChar (*Char, State);
 
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c 
b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
index 74c17bd248..3dc6376215 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c
@@ -37,7 +37,7 @@ EdbDisplayMemoryUnit (
   UINT64 Data64;
 
   //
-  // Print accroding to width
+  // Print according to width
   //
   switch (Width) {
   case EdbWidthUint8:
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c 
b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
index ba62c6ac27..3ca793059f 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c
@@ -70,7 +70,7 @@ GetDirNameFromFullPath (
 
 /**
 
-  Construct full path accroding to dir and file path.
+  Construct full path according to dir and file path.
 
   @param  DirPath - dir path
   @param  FilePath- file path
@@ -127,7 +127,7 @@ EdbSymbolTypeToStr (
 
 /**
 
-  Find the symbol accroding to address and display symbol.
+  Find the symbol according to address and display symbol.
 
   @param  Address - SymbolAddress
   @param  DebuggerPrivate - EBC Debugger private data structure
@@ -190,7 +190,7 @@ DebuggerDisplaySymbolAccrodingToAddress (
 
 /**
 
-  Find the symbol accroding to name and display symbol.
+  Find the symbol according to name and display symbol.
 
   @param  SymbolFileName  - The Symbol File Name, NULL means for all
   @param  SymbolName  - The Symbol Name, NULL means for all
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c 
b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c
index 472158b8f9..26a86548b4 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c
@@ -1178,7 +1178,7 @@ EdbShowDisasm (
 
 /**
 
-  Get register value accroding to the system context, and 

Re: [edk2] [PATCH v3 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros

2017-02-07 Thread Laszlo Ersek
On 02/07/17 04:33, Ruiyu Ni wrote:
> DEVICE_ID_NOCARE is defined as 0x but Spec says (UINT64) -1
> should be used to match any VendorId/DeviceId/RevisionId/
> SubsystemVendorId/SubsystemDeviceId.
> 
> PCI_BAR_OLD_ALIGN/PCI_BAR_EVEN_ALIGN/PCI_BAR_SQUAD_ALIGN/
> PCI_BAR_DQUAD_ALIGN are defined but Spec doesn't have such
> definitions.
> 
> PCI_BAR_ALL is defined as 0xFF but Spec says (UINT64) -1 should be
> used to match all BARs.
> 
> All of the above macros are marked as deprecated.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni 
> Reviewed-by: Liming Gao 
> Cc: Jeff Fan 
> ---
>  MdePkg/Include/IndustryStandard/Pci22.h | 24 +---
>  1 file changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/MdePkg/Include/IndustryStandard/Pci22.h 
> b/MdePkg/Include/IndustryStandard/Pci22.h
> index 4cf8389..5dec65d 100644
> --- a/MdePkg/Include/IndustryStandard/Pci22.h
> +++ b/MdePkg/Include/IndustryStandard/Pci22.h
> @@ -7,7 +7,7 @@
>  PC Card Standard, 8.0
>  PCI Power Management Interface Specifiction, Revision 1.2
>  
> -  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
> +  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
>Copyright (c) 2014 - 2015, Hewlett-Packard Development Company, L.P.
>This program and the accompanying materials  
>are licensed and made available under the terms and conditions of the BSD 
> License 
> @@ -780,14 +780,25 @@ typedef struct {
>///
>  } EFI_PCI_CAPABILITY_HOTPLUG;
>  
> -#define DEVICE_ID_NOCARE0x
> +///
> +/// Below macros (till PCI_BAR_NOCHANGE) were used by 
> EfiIncompatiblePciDeviceSupport Protocol.
> +///
> +#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
> +
> +///
> +/// [ATTENTION] These macros are deprecated because they don't match Spec or 
> not defined in Spec.
> +///
> +#define DEVICE_ID_NOCARE0x ///< Deprecated. Value 
> doesn't match Spec.
> +#define PCI_BAR_OLD_ALIGN   0xULL  ///< Deprecated. Value 
> isn't defined in Spec.
> +#define PCI_BAR_EVEN_ALIGN  0xFFFEULL  ///< Deprecated. Value 
> isn't defined in Spec.
> +#define PCI_BAR_SQUAD_ALIGN 0xFFFDULL  ///< Deprecated. Value 
> isn't defined in Spec.
> +#define PCI_BAR_DQUAD_ALIGN 0xFFFCULL  ///< Deprecated. Value 
> isn't defined in Spec.
> +#define PCI_BAR_ALL 0xFF   ///< Deprecated. Value 
> doesn't match Spec.
> +
> +#endif
>  
>  #define PCI_ACPI_UNUSED 0
>  #define PCI_BAR_NOCHANGE0

Any particular reason for not deprecating these two macros? Is it an
oversight, or is it intentional to keep them?

(If they comply with the spec, then replacing them in patch #5 seems
unwarranted.)

Thanks,
Laszlo

> -#define PCI_BAR_OLD_ALIGN   0xULL
> -#define PCI_BAR_EVEN_ALIGN  0xFFFEULL
> -#define PCI_BAR_SQUAD_ALIGN 0xFFFDULL
> -#define PCI_BAR_DQUAD_ALIGN 0xFFFCULL
>  
>  #define PCI_BAR_IDX00x00
>  #define PCI_BAR_IDX10x01
> @@ -795,7 +806,6 @@ typedef struct {
>  #define PCI_BAR_IDX30x03
>  #define PCI_BAR_IDX40x04
>  #define PCI_BAR_IDX50x05
> -#define PCI_BAR_ALL 0xFF
>  
>  ///
>  /// EFI PCI Option ROM definitions
> 

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


Re: [edk2] [PATCH v3 5/6] OvmfPkg/IncompatiblePci: Do not use deprecated macros

2017-02-07 Thread Laszlo Ersek
On 02/07/17 04:33, Ruiyu Ni wrote:
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni 
> Cc: Laszlo Ersek 
> ---
>  .../IncompatiblePciDeviceSupport.c  | 13 
> +++--
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git 
> a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c 
> b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
> index b6ff128..df9eb60 100644
> --- a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
> +++ b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
> @@ -4,6 +4,7 @@
>is not present), conserving 32-bit MMIO aperture for 32-bit BARs.
>  
>Copyright (C) 2016, Red Hat, Inc.
> +  Copyright (c) 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
> @@ -66,19 +67,19 @@ STATIC CONST MMIO64_PREFERENCE mConfiguration = {
>  )
>),
>  ACPI_ADDRESS_SPACE_TYPE_MEM,   // ResType
> -PCI_ACPI_UNUSED,   // GenFlag
> -PCI_ACPI_UNUSED,   // SpecificFlag
> +0, // GenFlag
> +0, // SpecificFlag
>  64,// AddrSpaceGranularity:
> //   aperture selection 
> hint
> //   for BAR allocation

PCI_ACPI_UNUSED expands to 0, so this is fine.


> -PCI_ACPI_UNUSED,   // AddrRangeMin
> -PCI_BAR_OLD_ALIGN, // AddrRangeMax:
> +0, // AddrRangeMin
> +0, // AddrRangeMax:
> //   no special alignment
> //   for affected BARs

PCI_BAR_OLD_ALIGN used to expand to 0xULL.

In patch #2, the condtion that checks PCI_BAR_OLD_ALIGN is extended to
cover both 0 (employed here) and the new macro OLD_ALIGN (which is being
introduced in the same patch #2, for the old compat value
0xULL).

So this looks good too.


> -PCI_BAR_ALL,   // AddrTranslationOffset:
> +MAX_UINT64,   // AddrTranslationOffset:
> //   hint covers all
> //   eligible BARs

PCI_BAR_ALL expands to 0xFF. Patch #2 updates PciBusDxe to cover both
0xFF and MAX_UINT64. Okay.

However, I notice whitespace corruption here: the "//" to the right of
MAX_UINT64 no longer lines up with the rest of the comments.

> -PCI_BAR_NOCHANGE   // AddrLen:
> +0  // AddrLen:
> //   use probed BAR size
>},
>//
> 

PCI_BAR_NOCHANGE expands to 0, so this is fine.

Ray, please fix up the whitespace corruption on the MAX_UINT64 line,
before committing the patch. With that fixed:

Reviewed-by: Laszlo Ersek 

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


[edk2] Testing SMM with QEMU, KVM and libvirt

2017-02-07 Thread Laszlo Ersek
Hi,

I've added the following article to the TianoCore wiki:

https://github.com/tianocore/tianocore.github.io/wiki/Testing-SMM-with-QEMU,-KVM-and-libvirt

It should help both Windows and Linux desktop users build a KVM test
machine / environment that closely resembles mine. Such an environment
is useful for testing and regression-testing new MP and SMM features and
bugfixes.

The initial setup is not short, but once you got it up and running, it's
very simple to rebuild OVMF with the edk2 changes, install the firmware
binary in the right place (see the article) and then click the Play
button on the Fedora 25 and Windows 10 guests, to see the changes in action.

If you have smaller updates or structural reorgs for the document,
there's no need to ask me, just go ahead and do them.

If some significant information is missing that you'd like me to add, I
think I'd prefer new TianoCore BZs at this time (Product: Tianocore
Feature Requests, Component: Web Content, Assignee: yours truly). I
don't know when I'll have time again to dig into this.

Sorry if I forgot someone off the CC list.

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


[edk2] [Patch] BaseTools: Fix the bug to parse the short varname in map file

2017-02-07 Thread Yonghong Zhu
current in the map file, there have two ways for var to save its offset,
if the varname is short, then the offset will in the same line with
varname, otherwise, it saved in the next line.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu 
---
 BaseTools/Source/Python/Common/Misc.py | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Misc.py 
b/BaseTools/Source/Python/Common/Misc.py
index 43d0818..1a5968a 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -1,9 +1,9 @@
 ## @file
 # Common routines used by all tools
 #
-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 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
 # http://opensource.org/licenses/bsd-license.php
 #
@@ -91,14 +91,20 @@ def _parseForGCC(lines, efifilepath, varnames):
 if status == 3:
 m = re.match('^([\w_\.]+) +([\da-fA-Fx]+) +([\da-fA-Fx]+)$', line)
 if m != None:
 sections.append(m.groups(0))
 for varname in varnames:
-m = re.match(".data.(%s)$" % varname, line)
+Str = ''
+m = re.match("^.data.(%s)" % varname, line)
 if m != None:
-if lines[index + 1]:
-m = re.match('^([\da-fA-Fx]+) +([\da-fA-Fx]+)', 
lines[index + 1].strip())
+m = re.match(".data.(%s)$" % varname, line)
+if m != None:
+Str = lines[index + 1]
+else:
+Str = line[len(".data.%s" % varname):]
+if Str:
+m = re.match('^([\da-fA-Fx]+) +([\da-fA-Fx]+)', 
Str.strip())
 if m != None:
 varoffset.append((varname, int(m.groups(0)[0], 16) 
, int(sections[-1][1], 16), sections[-1][0]))
 
 if not varoffset:
 return []
-- 
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 v3 2/2] OvmfPkg/SmmControl2Dxe: select broadcast SMI if available

2017-02-07 Thread Laszlo Ersek
On 02/07/17 10:56, Jordan Justen wrote:
> On 2017-01-31 03:02:21, Laszlo Ersek wrote:
>> When writing to IO port 0xB2 (ICH9_APM_CNT), QEMU by default injects an
>> SMI only on the VCPU that is writing the port.
> 
> I'm still annoyed that qemu didn't follow chipset hardware in handling
> the b2 port. I know this is long passed any possibility of doing
> anything about it, but it is also my last chance to complain. :)

It was difficult to come up with a QEMU design that everyone was willing
to accept (it was a tough community effort, really -- sort of walking a
fine line), and then getting the QEMU patches right (as defined by QEMU
maintainers) was again super difficult to me, despite the patches' small
size.

So yes, I can (quite selfishly :)) agree that "just doing the broadcast"
would have been better.

I'm much relieved that the feature seems to be converging finally, on
both sides.

> 
>> This has exposed corner
>> cases and strange behavior with edk2 code, which generally expects a
>> software SMI to affect all CPUs at once. We've experienced instability
>> despite the fact that OVMF sets PcdCpuSmmApSyncTimeout and
>> PcdCpuSmmSyncMode differently from the UefiCpuPkg defaults, such that they
>> match QEMU's unicast SMIs better. (Refer to edk2 commits 9b1e378811ff and
>> bb0f18b0bce6.)
>>
>> Using the new fw_cfg-based SMI feature negotiation in QEMU (see commits
>> 50de920b372b "hw/isa/lpc_ich9: add SMI feature negotiation via fw_cfg" and
>> 5ce45c7a2b15 "hw/isa/lpc_ich9: add broadcast SMI feature"), we can ask
>> QEMU to broadcast SMIs. Extensive testing from earlier proves that
>> broadcast SMIs are only reliable if we use the UefiCpuPkg defaults for the
>> above PCDs. With those settings however, the broadcast is very reliable --
>> the most reliable configuration encountered thus far.
> 
> Given my experience with SMI's we could see more unexpected corner
> cases. It seems that SMM is all corner cases. :)

Processor mode changes, multiprocessing, and security impact. What could
go wrong! :)

> 
> Series Reviewed-by: Jordan Justen 

\o/ Hooray! Thank you!

Pushed as 7c609a144b66..a316d7ac91d3.

Cheers!
Laszlo

> 
>>
>> Therefore negotiate broadcast SMIs with QEMU, and if the negotiation is
>> successful, dynamically revert the PCDs to the UefiCpuPkg defaults.
>>
>> Setting the PCDs in this module is safe:
>>
>> - only PiSmmCpuDxeSmm consumes them,
>>
>> - PiSmmCpuDxeSmm is a DXE_SMM_DRIVER, launched by the SMM_CORE
>>   (MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf),
>>
>> - the SMM_CORE is launched by the SMM IPL runtime DXE driver
>>   (MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf),
>>
>> - the SMM IPL has a DEPEX on EFI_SMM_CONTROL2_PROTOCOL,
>>
>> - OvmfPkg/SmmControl2Dxe produces that protocol.
>>
>> The end result is that PiSmmCpuDxeSmm cannot be dispatched before
>> SmmControl2Dxe installs EFI_SMM_CONTROL2_PROTOCOL and returns from its
>> entry point. Hence we can set the PCD's consumed by PiSmmCpuDxeSmm in
>> SmmControl2Dxe.
>>
>> Cc: Jordan Justen 
>> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=230
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Laszlo Ersek 
>> ---
>>
>> Notes:
>> v3:
>> - replace the ICH9_APM_STS-based feature negotiation with the new
>>   writeable fw_cfg kind
>>
>>  OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf |   8 +
>>  OvmfPkg/SmmControl2Dxe/SmiFeatures.h  |  49 +++
>>  OvmfPkg/SmmControl2Dxe/SmiFeatures.c  | 324 
>>  OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c   |  21 ++
>>  4 files changed, 402 insertions(+)
>>
>> diff --git a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf 
>> b/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
>> index 0e9f98c2871c..31c80bd4448c 100644
>> --- a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
>> +++ b/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
>> @@ -35,32 +35,40 @@ [Defines]
>>  #
>>  # The following information is for reference only and not required by the 
>> build tools.
>>  #
>>  #  VALID_ARCHITECTURES   = IA32 X64
>>  #
>>  
>>  [Sources]
>> +  SmiFeatures.h
>> +  SmiFeatures.c
>>SmmControl2Dxe.c
>>  
>>  [Packages]
>>MdePkg/MdePkg.dec
>>OvmfPkg/OvmfPkg.dec
>> +  UefiCpuPkg/UefiCpuPkg.dec
>>  
>>  [LibraryClasses]
>>BaseLib
>>DebugLib
>>IoLib
>> +  MemoryAllocationLib
>>PcdLib
>>PciLib
>>QemuFwCfgLib
>>UefiBootServicesTableLib
>>UefiDriverEntryPoint
>>  
>>  [Protocols]
>>gEfiS3SaveStateProtocolGuid   ## SOMETIMES_CONSUMES
>>gEfiSmmControl2ProtocolGuid   ## PRODUCES
>>  
>> +[Pcd]
>> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout ## SOMETIMES_PRODUCES
>> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode  ## SOMETIMES_PRODUCES
>> +
>>  [FeaturePcd]
>>gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire
>>  
>>  [Depex]
>>TRUE
>> diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.h 
>> b/OvmfPkg/SmmControl2Dxe/SmiFeatures.h
>> new file mode 100644
>> 

Re: [edk2] [PATCH 0/2] MdeModulePkg/AcpiTableDxe: improve FADT.{DSDT, X_DSDT} mutual exclusion

2017-02-07 Thread Zeng, Star
Laszlo,

I will give feedback tomorrow (PRC time) to this series, sorry for late.

Also Cc Jiewen.

Thanks,
Star
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
Ersek
Sent: Thursday, February 2, 2017 1:57 AM
To: edk2-devel-01 
Cc: Tian, Feng ; Michael Tsirkin ; 
Ard Biesheuvel ; Phil Dennis-Jordan 
; Leo Duran ; Al Stone 
; Zeng, Star 
Subject: [edk2] [PATCH 0/2] MdeModulePkg/AcpiTableDxe: improve FADT.{DSDT, 
X_DSDT} mutual exclusion

Patch #2 explains it all.

Repo:   https://github.com/lersek/edk2/
Branch: fadt_dsdt

NOTE for people on the CC list:

If you are not presently subscribed to edk2-devel and wish to comment on this 
series publicly, you need to subscribe first, and wait for the subscription 
request to *complete* (see your inbox), *before* sending your followup. This is 
not ideal, but edk2-devel requires subscription before reflecting messages from 
someone.

Subscribe at . Thanks.

Cc: Al Stone 
Cc: Ard Biesheuvel 
Cc: Feng Tian 
Cc: Igor Mammedov 
Cc: Leo Duran 
Cc: Michael Tsirkin 
Cc: Phil Dennis-Jordan 
Cc: Star Zeng 

Laszlo Ersek (2):
  MdeModulePkg/AcpiTableDxe: condense whitespace around
FADT.{DSDT,X_DSDT}
  MdeModulePkg/AcpiTableDxe: improve FADT.{DSDT,X_DSDT} mutual exclusion

 MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 82 

 1 file changed, 67 insertions(+), 15 deletions(-)

--
2.9.3

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


Re: [edk2] [PATCH v3 2/2] OvmfPkg/SmmControl2Dxe: select broadcast SMI if available

2017-02-07 Thread Jordan Justen
On 2017-01-31 03:02:21, Laszlo Ersek wrote:
> When writing to IO port 0xB2 (ICH9_APM_CNT), QEMU by default injects an
> SMI only on the VCPU that is writing the port.

I'm still annoyed that qemu didn't follow chipset hardware in handling
the b2 port. I know this is long passed any possibility of doing
anything about it, but it is also my last chance to complain. :)

> This has exposed corner
> cases and strange behavior with edk2 code, which generally expects a
> software SMI to affect all CPUs at once. We've experienced instability
> despite the fact that OVMF sets PcdCpuSmmApSyncTimeout and
> PcdCpuSmmSyncMode differently from the UefiCpuPkg defaults, such that they
> match QEMU's unicast SMIs better. (Refer to edk2 commits 9b1e378811ff and
> bb0f18b0bce6.)
> 
> Using the new fw_cfg-based SMI feature negotiation in QEMU (see commits
> 50de920b372b "hw/isa/lpc_ich9: add SMI feature negotiation via fw_cfg" and
> 5ce45c7a2b15 "hw/isa/lpc_ich9: add broadcast SMI feature"), we can ask
> QEMU to broadcast SMIs. Extensive testing from earlier proves that
> broadcast SMIs are only reliable if we use the UefiCpuPkg defaults for the
> above PCDs. With those settings however, the broadcast is very reliable --
> the most reliable configuration encountered thus far.

Given my experience with SMI's we could see more unexpected corner
cases. It seems that SMM is all corner cases. :)

Series Reviewed-by: Jordan Justen 

> 
> Therefore negotiate broadcast SMIs with QEMU, and if the negotiation is
> successful, dynamically revert the PCDs to the UefiCpuPkg defaults.
> 
> Setting the PCDs in this module is safe:
> 
> - only PiSmmCpuDxeSmm consumes them,
> 
> - PiSmmCpuDxeSmm is a DXE_SMM_DRIVER, launched by the SMM_CORE
>   (MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf),
> 
> - the SMM_CORE is launched by the SMM IPL runtime DXE driver
>   (MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf),
> 
> - the SMM IPL has a DEPEX on EFI_SMM_CONTROL2_PROTOCOL,
> 
> - OvmfPkg/SmmControl2Dxe produces that protocol.
> 
> The end result is that PiSmmCpuDxeSmm cannot be dispatched before
> SmmControl2Dxe installs EFI_SMM_CONTROL2_PROTOCOL and returns from its
> entry point. Hence we can set the PCD's consumed by PiSmmCpuDxeSmm in
> SmmControl2Dxe.
> 
> Cc: Jordan Justen 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=230
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Laszlo Ersek 
> ---
> 
> Notes:
> v3:
> - replace the ICH9_APM_STS-based feature negotiation with the new
>   writeable fw_cfg kind
> 
>  OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf |   8 +
>  OvmfPkg/SmmControl2Dxe/SmiFeatures.h  |  49 +++
>  OvmfPkg/SmmControl2Dxe/SmiFeatures.c  | 324 
>  OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c   |  21 ++
>  4 files changed, 402 insertions(+)
> 
> diff --git a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf 
> b/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> index 0e9f98c2871c..31c80bd4448c 100644
> --- a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> +++ b/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> @@ -35,32 +35,40 @@ [Defines]
>  #
>  # The following information is for reference only and not required by the 
> build tools.
>  #
>  #  VALID_ARCHITECTURES   = IA32 X64
>  #
>  
>  [Sources]
> +  SmiFeatures.h
> +  SmiFeatures.c
>SmmControl2Dxe.c
>  
>  [Packages]
>MdePkg/MdePkg.dec
>OvmfPkg/OvmfPkg.dec
> +  UefiCpuPkg/UefiCpuPkg.dec
>  
>  [LibraryClasses]
>BaseLib
>DebugLib
>IoLib
> +  MemoryAllocationLib
>PcdLib
>PciLib
>QemuFwCfgLib
>UefiBootServicesTableLib
>UefiDriverEntryPoint
>  
>  [Protocols]
>gEfiS3SaveStateProtocolGuid   ## SOMETIMES_CONSUMES
>gEfiSmmControl2ProtocolGuid   ## PRODUCES
>  
> +[Pcd]
> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout ## SOMETIMES_PRODUCES
> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode  ## SOMETIMES_PRODUCES
> +
>  [FeaturePcd]
>gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire
>  
>  [Depex]
>TRUE
> diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.h 
> b/OvmfPkg/SmmControl2Dxe/SmiFeatures.h
> new file mode 100644
> index ..9d5f1dbcb57e
> --- /dev/null
> +++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.h
> @@ -0,0 +1,49 @@
> +/**@file
> +  Negotiate SMI features with QEMU, and configure UefiCpuPkg/PiSmmCpuDxeSmm
> +  accordingly.
> +
> +  Copyright (C) 2016-2017, Red Hat, Inc.
> +
> +  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
> +  http://opensource.org/licenses/bsd-license.php
> +
> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
> WITHOUT
> +  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +**/
> +
> +#ifndef __SMI_FEATURES_H__
> +#define __SMI_FEATURES_H__
> +
> +#include 
> 

Re: [edk2] [PATCH] SignedCapsulePkg/EdkiiSystemCapsuleLib: Fix logic error.

2017-02-07 Thread wang xiaofeng
Hi Jiewen,
   The fix is OK  for me. Reviewed-by Wang,Cloud





At 2017-02-07 14:33:45, "Jiewen Yao"  wrote:
>This patch fixes https://bugzilla.tianocore.org/show_bug.cgi?id=367
>
>Cc: Wang Cloud 
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Jiewen Yao 
>---
> SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git 
>a/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c 
>b/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c
>index dfd8d10..62be8eb 100644
>--- a/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c
>+++ b/SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.c
>@@ -643,7 +643,7 @@ CapsuleAuthenticateSystemFirmware (
>   return EFI_SECURITY_VIOLATION;
> }
>   } else {
>-if (CurrentImageFmpInfo->Version < 
>ImageFmpInfo->LowestSupportedImageVersion) {
>+if (ImageFmpInfo->Version < 
>CurrentImageFmpInfo->LowestSupportedImageVersion) {
>   *LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_INCORRECT_VERSION;
>   DEBUG((DEBUG_INFO, "LowestSupportedImageVersion check - fail\n"));
>   return EFI_SECURITY_VIOLATION;
>-- 
>2.7.4.windows.1
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ArmPkg: Bug #361 fix Watchdog PCDs

2017-02-07 Thread Ard Biesheuvel
On 6 February 2017 at 19:05,   wrote:
> From: Alexei 
>
> "ARM Generic Watchdog base addresses must be declared as UINT64 values"
> https://bugzilla.tianocore.org/show_bug.cgi?id=361
>
> PcdGenericWatchdogControlBase & PcdGenericWatchdogRefreshBase
> are declared as UINT32 values in ArmPkg.dec, but for platforms
> with addresses in the memory range above 4GB this causes build
> error F000: Too large PCD value for datum type [UINT32]
> of PCD gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Alexei Fedorov 
> Signed-off-by: Evan Lloyd 

Applied, thanks.

> ---
>  ArmPkg/ArmPkg.dec   |  6 +++---
>  ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdog.h | 10 +-
>  2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec
> index 
> 090ed99513669e32aee2f083e1dcf8327be40842..8e9cf199becc65a9f6fe08e2d5b216bc2af4c31d
>  100644
> --- a/ArmPkg/ArmPkg.dec
> +++ b/ArmPkg/ArmPkg.dec
> @@ -2,7 +2,7 @@
>  # ARM processor package.
>  #
>  # Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.
> -# Copyright (c) 2011 - 2015, ARM Limited. All rights reserved.
> +# Copyright (c) 2011 - 2017, ARM Limited. All rights reserved.
>  #
>  #This program and the accompanying materials
>  #are licensed and made available under the terms and conditions of the 
> BSD License
> @@ -252,8 +252,8 @@ [PcdsFixedAtBuild.common, PcdsDynamic.common]
># ARM Generic Watchdog
>#
>
> -  
> gArmTokenSpaceGuid.PcdGenericWatchdogControlBase|0x2A44|UINT32|0x0007
> -  
> gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase|0x2A45|UINT32|0x0008
> +  
> gArmTokenSpaceGuid.PcdGenericWatchdogControlBase|0x2A44|UINT64|0x0007
> +  
> gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase|0x2A45|UINT64|0x0008
>gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum|93|UINT32|0x0009
>
>#
> diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdog.h 
> b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdog.h
> index 
> 578fd1e85f8e11b42e546f92123fd041a2d3b153..9e2aebcfd5e557269bbc36556dbcbc8f6809aeb0
>  100644
> --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdog.h
> +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdog.h
> @@ -1,6 +1,6 @@
>  /** @file
>  *
> -*  Copyright (c) 2013-2014, ARM Limited. All rights reserved.
> +*  Copyright (c) 2013-2017, ARM Limited. All rights reserved.
>  *
>  *  This program and the accompanying materials
>  *  are licensed and made available under the terms and conditions of the BSD
> @@ -15,12 +15,12 @@
>  #define __GENERIC_WATCHDOG_H__
>
>  // Refresh Frame:
> -#define GENERIC_WDOG_REFRESH_REG  ((UINT32)FixedPcdGet32 
> (PcdGenericWatchdogRefreshBase) + 0x000)
> +#define GENERIC_WDOG_REFRESH_REG  ((UINTN)FixedPcdGet64 
> (PcdGenericWatchdogRefreshBase) + 0x000)
>
>  // Control Frame:
> -#define GENERIC_WDOG_CONTROL_STATUS_REG   ((UINT32)FixedPcdGet32 
> (PcdGenericWatchdogControlBase) + 0x000)
> -#define GENERIC_WDOG_OFFSET_REG   ((UINT32)FixedPcdGet32 
> (PcdGenericWatchdogControlBase) + 0x008)
> -#define GENERIC_WDOG_COMPARE_VALUE_REG((UINT32)FixedPcdGet32 
> (PcdGenericWatchdogControlBase) + 0x010)
> +#define GENERIC_WDOG_CONTROL_STATUS_REG   ((UINTN)FixedPcdGet64 
> (PcdGenericWatchdogControlBase) + 0x000)
> +#define GENERIC_WDOG_OFFSET_REG   ((UINTN)FixedPcdGet64 
> (PcdGenericWatchdogControlBase) + 0x008)
> +#define GENERIC_WDOG_COMPARE_VALUE_REG((UINTN)FixedPcdGet64 
> (PcdGenericWatchdogControlBase) + 0x010)
>
>  // Values of bit 0 of the Control/Status Register
>  #define GENERIC_WDOG_ENABLED  1
> --
> Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH V2 5/6] SecurityPkg/Password: Add Password based UserAuthentication modules.

2017-02-07 Thread Jiewen Yao
This password based user authentication is to verify user when a user
wants to enter BIOS setup page.

The DXE driver registers report status code listener.
When it gets (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_PC_USER_SETUP) progress
code, it will let the user input password.
If and only if the user inputs the right password, the status code handler
will return and let the setup driver continue running.
If the user inputs the wrong password, the status code handler will let
user try again.
If the user inputs the wrong password 3 times, the status code handler will
reset the system.

The DXE driver also register a setup page in setup browser, so that
user may update the password.

The DXE driver uses SMI to let SMM driver do the password verification
and management.

The SMM driver registers SMI handler to perform the request from DXE.
The password must meet below criteria:
1) Length >= 8 char
2) It must include lower case, upper case, number and symbol.
3) It must not duplicate with 5 previous password.
If above criteria is met, the password will be saved to a read only UEFI
variable. The format is password hash+salt, which is generated by
Pkcs5HashPassword algorithm (SHA256+1000 iteration).

If the SMM driver gets wrong password 3 times, the interface is locked
and does not accept more request.

If the SMM driver will detect IsPasswordCleared() at the entry point and
clear the password if IsPasswordCleared() is TRUE. This can be used when
the user forgets the password.

Cc: Qin Long 
Cc: Chao Zhang 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao 
---
 SecurityPkg/Password/UserAuthentication/KeyService.c | 210 
++
 SecurityPkg/Password/UserAuthentication/KeyService.h | 122 

 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.c  | 718 

 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.h  | 115 

 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.inf|  79 
+++
 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.uni|  22 
+
 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxeExtra.uni   |  20 
+
 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxeFormset.h   |  30 
+
 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxePassword.c  | 301 

 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxeStrings.uni |  29 
+
 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxeVfr.vfr |  38 
++
 SecurityPkg/Password/UserAuthentication/UserAuthenticationGuid.h |  65 
++
 SecurityPkg/Password/UserAuthentication/UserAuthenticationSmm.c  | 672 
++
 SecurityPkg/Password/UserAuthentication/UserAuthenticationSmm.inf|  70 
++
 SecurityPkg/Password/UserAuthentication/UserAuthenticationSmm.uni|  22 
+
 SecurityPkg/Password/UserAuthentication/UserAuthenticationSmmExtra.uni   |  20 
+
 16 files changed, 2533 insertions(+)

diff --git a/SecurityPkg/Password/UserAuthentication/KeyService.c 
b/SecurityPkg/Password/UserAuthentication/KeyService.c
new file mode 100644
index 000..81aa2f9
--- /dev/null
+++ b/SecurityPkg/Password/UserAuthentication/KeyService.c
@@ -0,0 +1,210 @@
+/** @file
+  Password key service.
+
+Copyright (c) 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
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include "KeyService.h"
+
+#define DEFAULT_AES_KEY_BIT_SIZE   256
+#define DEFAULT_PBKDF2_ITERATION_COUNT 1000
+
+/**
+  Compares the contents of two buffers with slow algorithm
+
+  This function compares Length bytes of SourceBuffer to Length bytes of 
DestinationBuffer.
+  If all Length bytes of the two buffers are identical, then 0 is returned.  
Otherwise, the
+  value returned is the first mismatched byte in SourceBuffer subtracted from 
the first
+  mismatched byte in DestinationBuffer.
+
+  If Length > 0 and DestinationBuffer is NULL, then ASSERT().
+  If Length > 0 and SourceBuffer is NULL, then ASSERT().
+  If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then 
ASSERT().
+  If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
+
+  @param  DestinationBuffer The pointer to the destination buffer to compare.
+  @param  SourceBuffer  The pointer to the source buffer to compare.
+  @param  LengthThe number of bytes to compare.
+
+  @return 0 All Length bytes of the two buffers 

[edk2] [PATCH V2 3/6] SecurityPkg/include: Add PlatformPasswordLib lib class.

2017-02-07 Thread Jiewen Yao
This lib is to indicate if the password is cleared.

Cc: Qin Long 
Cc: Chao Zhang 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao 
---
 SecurityPkg/Include/Library/PlatformPasswordLib.h | 54 
 SecurityPkg/SecurityPkg.dec   |  4 ++
 2 files changed, 58 insertions(+)

diff --git a/SecurityPkg/Include/Library/PlatformPasswordLib.h 
b/SecurityPkg/Include/Library/PlatformPasswordLib.h
new file mode 100644
index 000..79067d2
--- /dev/null
+++ b/SecurityPkg/Include/Library/PlatformPasswordLib.h
@@ -0,0 +1,54 @@
+/** @file
+  Provides a platform-specific method to return password policy.
+
+Copyright (c) 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
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PLATFORM_PASSWORD_LIB_H__
+#define __PLATFORM_PASSWORD_LIB_H__
+
+/**
+  This function is called at password driver entrypoint.
+  This function should be called only once, to clear the password.
+
+  This function provides a way to reset the password, just in case
+  the platform owner forgets the password.
+  The platform should provide a secure way to make sure
+  only the platform owner is allowed to clear password.
+
+  Once the password is cleared, the platform should provide a way
+  to set a new password.
+
+  @retval TRUE  There is a platform request to clear the password.
+  @retval FALSE There is no platform request to clear the password.
+**/
+BOOLEAN
+EFIAPI
+IsPasswordCleared (
+  VOID
+  );
+
+/**
+  This function is called if the password driver finds that the password is 
not enrolled,
+  when the password is required to input.
+
+  This function should return the action accroding to platform policy.
+
+  @retval TRUE  The caller should force the user to enroll the password.
+  @retval FALSE The caller may skip the password enroll.
+**/
+BOOLEAN
+EFIAPI
+NeedEnrollPassword (
+  VOID
+  );
+
+#endif
diff --git a/SecurityPkg/SecurityPkg.dec b/SecurityPkg/SecurityPkg.dec
index da2f84f..7050d3e 100644
--- a/SecurityPkg/SecurityPkg.dec
+++ b/SecurityPkg/SecurityPkg.dec
@@ -93,6 +93,10 @@
   #
   OpalPasswordSupportLib|Include/Library/OpalPasswordSupportLib.h
 
+  ##  @libraryclass  Provides a platform-specific method to return password 
policy.
+  #
+  PlatformPasswordLib|Include/Library/PlatformPasswordLib.h
+
 [Guids]
   ## Security package token space guid.
   # Include/Guid/SecurityPkgTokenSpace.h
-- 
2.7.4.windows.1

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


[edk2] [PATCH V2 2/6] SecurityPkg/dec: Add PcdPasswordCleared.

2017-02-07 Thread Jiewen Yao
This PCD is to indicate if the password is cleared.

Cc: Qin Long 
Cc: Chao Zhang 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao 
---
 SecurityPkg/SecurityPkg.dec |  6 ++
 SecurityPkg/SecurityPkg.uni | 10 ++
 2 files changed, 16 insertions(+)

diff --git a/SecurityPkg/SecurityPkg.dec b/SecurityPkg/SecurityPkg.dec
index b556fb6..da2f84f 100644
--- a/SecurityPkg/SecurityPkg.dec
+++ b/SecurityPkg/SecurityPkg.dec
@@ -446,6 +446,12 @@
   # @Prompt Initial setting of TCG2 Persistent Firmware Management Flags
   
gEfiSecurityPkgTokenSpaceGuid.PcdTcg2PhysicalPresenceFlags|0x300E2|UINT32|0x0001001B
 
+  ## Indicate whether the password is cleared.
+  # When it is configured to Dynamic or DynamicEx, it can be set through 
detection using
+  # a platform-specific method (e.g. Board Jumper set) in a actual platform in 
early boot phase.
+  # @Prompt The passowrd clear status
+  gEfiSecurityPkgTokenSpaceGuid.PcdPasswordCleared|FALSE|BOOLEAN|0x0001001C
+
 [PcdsDynamic, PcdsDynamicEx]
 
   ## This PCD indicates Hash mask for TPM 2.0.
diff --git a/SecurityPkg/SecurityPkg.uni b/SecurityPkg/SecurityPkg.uni
index 17d36c0..ffc097e 100644
--- a/SecurityPkg/SecurityPkg.uni
+++ b/SecurityPkg/SecurityPkg.uni
@@ -219,6 +219,16 @@
 "When it is configured to Dynamic or DynamicEx, it can be set through 
detection using "
 "a platform-specific method (e.g. Button pressed) in a actual platform in 
early boot phase."
 
+#string STR_gEfiSecurityPkgTokenSpaceGuid_PcdPasswordCleared_PROMPT
+#language en-US
+"The passowrd clear status"
+
+#string STR_gEfiSecurityPkgTokenSpaceGuid_PcdPasswordCleared_HELP
+#language en-US
+"Indicate whether the password is cleared. "
+"When it is configured to Dynamic or DynamicEx, it can be set through 
detection using "
+"a platform-specific method (e.g. Board Jumper set) in a actual platform in 
early boot phase."
+
 #string STR_gEfiSecurityPkgTokenSpaceGuid_PcdPkcs7CertBuffer_PROMPT  #language 
en-US "One PKCS7 cert used to verify Recovery and Capsule Update images"
 
 #string STR_gEfiSecurityPkgTokenSpaceGuid_PcdPkcs7CertBuffer_HELP  #language 
en-US "Provides one PKCS7 cert used to verify Recovery and Capsule Update 
images\n"
-- 
2.7.4.windows.1

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


[edk2] [PATCH V2 6/6] SecurityPkg/dsc: add Password authentication module.

2017-02-07 Thread Jiewen Yao
Cc: Qin Long 
Cc: Chao Zhang 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao 
---
 SecurityPkg/SecurityPkg.dsc | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
index dee9241..d337a26 100644
--- a/SecurityPkg/SecurityPkg.dsc
+++ b/SecurityPkg/SecurityPkg.dsc
@@ -75,6 +75,7 @@
   TcgStorageOpalLib|SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalLib.inf
   
OpalPasswordSupportLib|SecurityPkg/Library/OpalPasswordSupportLib/OpalPasswordSupportLib.inf
   
ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.inf
+  
PlatformPasswordLib|SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf
 
 [LibraryClasses.common.PEIM]
   PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
@@ -328,6 +329,12 @@
   SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalPasswordDxe.inf
   SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.inf
 
+  #
+  # Password
+  #
+  SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.inf
+  SecurityPkg/Password/UserAuthentication/UserAuthenticationSmm.inf
+
 [Components.IPF]
   SecurityPkg/VariableAuthenticated/EsalVariableDxeSal/EsalVariableDxeSal.inf
 
-- 
2.7.4.windows.1

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


[edk2] [PATCH V2 4/6] SecurityPkg/PlatformPasswordLibNull: Add PlatformPasswordLib instance.

2017-02-07 Thread Jiewen Yao
This lib instance is to return if the password is cleared based upon PCD.

Cc: Qin Long 
Cc: Chao Zhang 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao 
---
 SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.c   | 84 

 SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf | 44 
++
 SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.uni | 24 
++
 3 files changed, 152 insertions(+)

diff --git 
a/SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.c 
b/SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.c
new file mode 100644
index 000..9722607
--- /dev/null
+++ b/SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.c
@@ -0,0 +1,84 @@
+/** @file
+  NULL PlatformPasswordLib instance does NOT really detect whether the 
password is cleared
+  but returns the PCD value directly. This instance can be used to verify 
security
+  related features during platform enabling and development. It should be 
replaced
+  by a platform-specific method(e.g. Button pressed) in a real platform for 
product.
+
+Copyright (c) 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
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+BOOLEAN   mPasswordCleared  = FALSE;
+
+/**
+  This function is called at password driver entrypoint.
+  This function should be called only once, to clear the password.
+
+  This function provides a way to reset the password, just in case
+  the platform owner forgets the password.
+  The platform should provide a secure way to make sure
+  only the platform owner is allowed to clear password.
+
+  Once the password is cleared, the platform should provide a way
+  to set a new password.
+
+  @retval TRUE  There is a platform request to clear the password.
+  @retval FALSE There is no platform request to clear the password.
+**/
+BOOLEAN
+EFIAPI
+IsPasswordCleared (
+  VOID
+  )
+{
+  return mPasswordCleared;
+}
+
+/**
+  This function is called if the password driver finds that the password is 
not enrolled,
+  when the password is required to input.
+
+  This function should return the action accroding to platform policy.
+
+  @retval TRUE  The caller should force the user to enroll the password.
+  @retval FALSE The caller may skip the password enroll.
+**/
+BOOLEAN
+EFIAPI
+NeedEnrollPassword (
+  VOID
+  )
+{
+  return FALSE;
+}
+
+
+/**
+  Save password clear state from a PCD to mPasswordCleared.
+
+  @param  ImageHandle   ImageHandle of the loaded driver.
+  @param  SystemTable   Pointer to the EFI System Table.
+
+  @retval  EFI_SUCCESS  PcdPasswordCleared is got successfully.
+
+**/
+EFI_STATUS
+EFIAPI
+PlatformPasswordLibNullConstructor (
+  IN EFI_HANDLEImageHandle,
+  IN EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+
+  mPasswordCleared = PcdGetBool(PcdPasswordCleared);
+
+  return EFI_SUCCESS;
+}
+
diff --git 
a/SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf 
b/SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf
new file mode 100644
index 000..74e9bda
--- /dev/null
+++ b/SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf
@@ -0,0 +1,44 @@
+## @file
+#  NULL platform password library instance that returns the password clear 
state based upon PCD.
+#
+#  NULL PlatformPasswordLib instance does NOT really detect whether the 
password is cleared
+#  but returns the PCD value directly. This instance can be used to verify 
security
+#  related features during platform enabling and development. It should be 
replaced
+#  by a platform-specific method(e.g. Button pressed) in a real platform for 
product.
+#
+# Copyright (c) 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
+# http://opensource.org/licenses/bsd-license.php
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010006
+  BASE_NAME  = PlatformPasswordLibNull
+  MODULE_UNI_FILE= PlatformPasswordLibNull.uni
+  FILE_GUID  = 27417BCA-0CCD-4089-9711-AD069A33C555
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING 

[edk2] [PATCH V2 0/6] Add password support

2017-02-07 Thread Jiewen Yao
 V2 
1) Add SmmCommunicationBufferProtocol dependency.
2) Cleanup header file and copyright to 2017.
3) Add missing UserAuthenticationSmm.uni.
4) Rename KeyLib.h/c to KeyService.h/c to avoid confusing.

 V1 
This series patch adds password support in EDKII.

This password based user authentication is to verify user when a user
wants to enter BIOS setup page.

The detail information is added in [PATCH 5/6].


Jiewen Yao (6):
  CryptoPkg:SmmCryptLib: Add real Pkcs5Pbkdf2.c.
  SecurityPkg/dec: Add PcdPasswordCleared.
  SecurityPkg/include: Add PlatformPasswordLib lib class.
  SecurityPkg/PlatformPasswordLibNull: Add PlatformPasswordLib instance.
  SecurityPkg/Password: Add Password based UserAuthentication modules.
  SecurityPkg/dsc: add Password authentication module.

 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf   |   4 
+-
 SecurityPkg/Include/Library/PlatformPasswordLib.h|  54 
++
 SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.c|  84 
+++
 SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf  |  44 
++
 SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.uni  |  24 
+
 SecurityPkg/Password/UserAuthentication/KeyService.c | 210 
++
 SecurityPkg/Password/UserAuthentication/KeyService.h | 122 

 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.c  | 718 

 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.h  | 115 

 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.inf|  79 
+++
 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.uni|  22 
+
 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxeExtra.uni   |  20 
+
 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxeFormset.h   |  30 
+
 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxePassword.c  | 301 

 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxeStrings.uni |  29 
+
 SecurityPkg/Password/UserAuthentication/UserAuthenticationDxeVfr.vfr |  38 
++
 SecurityPkg/Password/UserAuthentication/UserAuthenticationGuid.h |  65 
++
 SecurityPkg/Password/UserAuthentication/UserAuthenticationSmm.c  | 672 
++
 SecurityPkg/Password/UserAuthentication/UserAuthenticationSmm.inf|  70 
++
 SecurityPkg/Password/UserAuthentication/UserAuthenticationSmm.uni|  22 
+
 SecurityPkg/Password/UserAuthentication/UserAuthenticationSmmExtra.uni   |  20 
+
 SecurityPkg/SecurityPkg.dec  |  10 
+
 SecurityPkg/SecurityPkg.dsc  |   7 
+
 SecurityPkg/SecurityPkg.uni  |  10 
+
 24 files changed, 2768 insertions(+), 2 deletions(-)
 create mode 100644 SecurityPkg/Include/Library/PlatformPasswordLib.h
 create mode 100644 
SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.c
 create mode 100644 
SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf
 create mode 100644 
SecurityPkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.uni
 create mode 100644 SecurityPkg/Password/UserAuthentication/KeyService.c
 create mode 100644 SecurityPkg/Password/UserAuthentication/KeyService.h
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.c
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.h
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.inf
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationDxe.uni
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationDxeExtra.uni
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationDxeFormset.h
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationDxePassword.c
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationDxeStrings.uni
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationDxeVfr.vfr
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationGuid.h
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationSmm.c
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationSmm.inf
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationSmm.uni
 create mode 100644 
SecurityPkg/Password/UserAuthentication/UserAuthenticationSmmExtra.uni

-- 
2.7.4.windows.1

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


[edk2] [PATCH V2 1/6] CryptoPkg:SmmCryptLib: Add real Pkcs5Pbkdf2.c.

2017-02-07 Thread Jiewen Yao
Cc: Qin Long 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao 
---
 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
index df44184..e00a230 100644
--- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
@@ -11,7 +11,7 @@
 #  functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and 
 #  authenticode signature verification functions are not supported in this 
instance.
 #
-#  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+#  Copyright (c) 2010 - 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
@@ -52,7 +52,7 @@
   Cipher/CryptArc4Null.c
   Pk/CryptRsaBasic.c
   Pk/CryptRsaExtNull.c
-  Pk/CryptPkcs5Pbkdf2Null.c
+  Pk/CryptPkcs5Pbkdf2.c
   Pk/CryptPkcs7SignNull.c
   Pk/CryptPkcs7Verify.c
   Pk/CryptDhNull.c
-- 
2.7.4.windows.1

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