Re: [edk2] [PATCH v2] PeiLib : Inform UEFI memory to Linux

2017-09-19 Thread Sakar Arora
The DXE core dispatcher relies on the available memory to allocate space for loading the rest of the modules from the UEFI image. If we declare the UEFI image memory space (from which DXE dispatcher reads the efi modules) open to allocation, it might lead to data corruption, depending on the

Re: [edk2] Storing Non volatile variables on SD/NAND

2017-09-19 Thread Andrew Fish
> On Sep 19, 2017, at 10:09 PM, Udit Kumar wrote: > >>> On Sep 19, 2017, at 9:27 PM, Udit Kumar wrote: >>> >>> On 18 September 2017 at 22:28, Udit Kumar wrote: > Thanks Vladimir, > With your design, you did delayed

Re: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU driver

2017-09-19 Thread Wang, Jian J
Jiewen, Any comments on this patch? -Original Message- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Jian J Wang Sent: Tuesday, September 19, 2017 2:10 PM To: edk2-devel@lists.01.org Cc: Kinney, Michael D ; Laszlo Ersek

Re: [edk2] Storing Non volatile variables on SD/NAND

2017-09-19 Thread Udit Kumar
> > On Sep 19, 2017, at 9:27 PM, Udit Kumar wrote: > > > > > >> On 18 September 2017 at 22:28, Udit Kumar wrote: > >>> Thanks Vladimir, > >>> With your design, you did delayed write to eMMC due to sharing with > >>> OS. But it works for you:) Say if eMMC

Re: [edk2] [Patch 0/2] Correct PI EfiGcdMemoryTypePersistent definition

2017-09-19 Thread Zeng, Star
Reviewed-by: Star Zeng -Original Message- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Liming Gao Sent: Wednesday, September 20, 2017 12:03 PM To: edk2-devel@lists.01.org Subject: [edk2] [Patch 0/2] Correct PI EfiGcdMemoryTypePersistent

Re: [edk2] Storing Non volatile variables on SD/NAND

2017-09-19 Thread Andrew Fish
> On Sep 19, 2017, at 9:27 PM, Udit Kumar wrote: > > >> On 18 September 2017 at 22:28, Udit Kumar wrote: >>> Thanks Vladimir, >>> With your design, you did delayed write to eMMC due to sharing with >>> OS. But it works for you:) Say if eMMC controllers

Re: [edk2] Storing Non volatile variables on SD/NAND

2017-09-19 Thread Udit Kumar
> On 18 September 2017 at 22:28, Udit Kumar wrote: > > Thanks Vladimir, > > With your design, you did delayed write to eMMC due to sharing with > > OS. But it works for you:) Say if eMMC controllers offers you a > > status bit, if eMMC storage is being used for not. Then

[edk2] [Patch 0/2] Correct PI EfiGcdMemoryTypePersistent definition

2017-09-19 Thread Liming Gao
Liming Gao (2): MdePkg: Correct EfiGcdMemoryTypePersistent name to follow PI spec MdeModulePkg: Update DxeCore to consume PI EfiGcdMemoryTypePersistent MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 4 ++-- MdeModulePkg/Core/Dxe/Mem/Page.c | 4 ++-- MdePkg/Include/Pi/PiDxeCis.h | 6 +- 3 files

[edk2] [Patch 1/2] MdePkg: Correct EfiGcdMemoryTypePersistent name to follow PI spec

2017-09-19 Thread Liming Gao
PI spec defines EfiGcdMemoryTypePersistent name, MdePkg uses EfiGcdMemoryTypePersistentMemory name. So, EfiGcdMemoryTypePersistent is added. And, EfiGcdMemoryTypePersistentMemory is kept for compatility. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao

[edk2] [Patch 2/2] MdeModulePkg: Update DxeCore to consume PI EfiGcdMemoryTypePersistent

2017-09-19 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao --- MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 4 ++-- MdeModulePkg/Core/Dxe/Mem/Page.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c

[edk2] [Patch] MdeModulePkg/DxeNetLib: Check the actual packet size before trim data from Nbuf.

2017-09-19 Thread Fu Siyuan
In NetbufTrim() function, the NetBuf TotalSize should be checked with 0 before making the trim operation, otherwise the function will fall into infinite loop. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Cc: Wu Jiaxin

[edk2] [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Correct Names.

2017-09-19 Thread lushifex
Correct Boot Option Names. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: lushifex --- .../Include/Library/GenericBdsLib.h| 5 ++- .../Library/GenericBdsLib/BdsBoot.c| 51 +-

Re: [edk2] Failed to clear configuration in Ip4Config2 Protocol

2017-09-19 Thread Wu, Jiaxin
Hi Karunakar, DNS Device Path is used to list all the instances of the DNS server address. If there are multiple DNS server address reported from DHCP server, it will like the Spec example: Dns(192.168.22.100, 192.168.22.101). Here, according your DNS Node, there is only one DNS server

Re: [edk2] [PATCH 1/1] ArmPkg/ArmSvcLib: Add ArmSvcLib implementation.

2017-09-19 Thread Ard Biesheuvel
Hi Supreeth, On 19 September 2017 at 12:55, Supreeth Venkatesh wrote: > This patch adds a library that enables invocation of SVCs from Exception > Level EL0. It will be used by the Standalone MM environment to request > services from a software running in a privileged

[edk2] [PATCH 1/1] ArmPkg/ArmSvcLib: Add ArmSvcLib implementation.

2017-09-19 Thread Supreeth Venkatesh
This patch adds a library that enables invocation of SVCs from Exception Level EL0. It will be used by the Standalone MM environment to request services from a software running in a privileged EL e.g. ARM Trusted Firmware. The library is a derived directly from Arm SMC Library. Contributed-under:

Re: [edk2] [PATCH 0/3] OvmfPkg/QemuVideoDxe/VbeShim: handle PAM1 register on Q35 correctly

2017-09-19 Thread Laszlo Ersek
On 09/19/17 21:18, Laszlo Ersek wrote: > Repo: https://github.com/lersek/edk2.git > Branch: vbe_shim_q35_pam > > Fix the long-standing OVMF/Q35 bug recently exposed by a QEMU change, > and reported under . > > Aleksei, can you please fetch the

[edk2] [PATCH 2/3] OvmfPkg/QemuVideoDxe/VbeShim: rename Status to Segment0AllocationStatus

2017-09-19 Thread Laszlo Ersek
This clarifies the purpose of the local variable in InstallVbeShim(). Cc: Aleksei Kovura Cc: Gerd Hoffmann Cc: Igor Mammedov Cc: Jordan Justen Cc: Ruiyu Ni Ref:

[edk2] [PATCH 1/3] OvmfPkg/CsmSupportLib: move PAM register addresses to IndustryStandard

2017-09-19 Thread Laszlo Ersek
* Introduce the PIIX4_PAM* and MCH_PAM* macros under "OvmfPkg/Include/IndustryStandard". These macros capture the PAM register offsets (in PCI config space) on the respective Memory Controller B/D/F, from the respective data sheets. * Under IndustryStandard, introduce the

[edk2] [PATCH 0/3] OvmfPkg/QemuVideoDxe/VbeShim: handle PAM1 register on Q35 correctly

2017-09-19 Thread Laszlo Ersek
Repo: https://github.com/lersek/edk2.git Branch: vbe_shim_q35_pam Fix the long-standing OVMF/Q35 bug recently exposed by a QEMU change, and reported under . Aleksei, can you please fetch the branch, build it, and report back with your Tested-by if

[edk2] [PATCH 3/3] OvmfPkg/QemuVideoDxe/VbeShim: handle PAM1 register on Q35 correctly

2017-09-19 Thread Laszlo Ersek
In commit db27e9f3d8f0 ("OvmfPkg/LegacyRegion: Support legacy region manipulation of Q35", 2016-03-15), Ray extended the OvmfPkg/Csm/CsmSupportLib PAM register manipulation to Q35. However, we missed that the same should be done to the QemuVideoDxe VBE Shim as well. The omission has caused no

Re: [edk2] [PATCH 5/6] MdeModulePkg/Crc32: Fix possible out of range left shift

2017-09-19 Thread Paolo Bonzini
On 19/09/2017 13:43, Hao Wu wrote: >NewValue = 0; >for (Index = 0; Index < 32; Index++) { > -if ((Value & (1 << Index)) != 0) { > - NewValue = NewValue | (1 << (31 - Index)); > +if ((Value & (((UINT32)1) << Index)) != 0) { > + NewValue = NewValue | (((UINT32)1) << (31 -

Re: [edk2] [PATCH 4/6] MdeModulePkg/DxeNetLib: Fix negative value left shift

2017-09-19 Thread Paolo Bonzini
On 19/09/2017 13:43, Hao Wu wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=698 > > Within function NetRandomInitSeed(), left shift a negative value is used > in: > "~Time.Hour << 24" > > which involves undefined behavior. > > Since Time.Hour is of type UINT8 (range from 0 to 23),

Re: [edk2] [PATCH 3/6] MdeModulePkg/Tpl: Fix negative value left shift

2017-09-19 Thread Paolo Bonzini
On 19/09/2017 13:43, Hao Wu wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=695 > > Within function CoreRestoreTpl(), left shift a negative value -2 is used > in: > "while (((-2 << NewTpl) & gEventPending) != 0) {" > > which involves undefined behavior. > > According to the C11

Re: [edk2] [PATCH] BaseTools/tools_def AARCH64: enable frame pointers for RELEASE builds

2017-09-19 Thread Ard Biesheuvel
On 17 September 2017 at 22:06, Gao, Liming wrote: > Reviewed-by: Liming Gao > [...] >>> >>> So remove -fomit-frame-pointer altogether this time. >>> >>> Contributed-under: TianoCore Contribution Agreement 1.1 >>> Signed-off-by: Ard Biesheuvel

Re: [edk2] [PATCH v2] ArmPkg/PlatformBootManagerLib: process pending capsules

2017-09-19 Thread Ard Biesheuvel
On 18 September 2017 at 03:16, Leif Lindholm wrote: > On Fri, Sep 15, 2017 at 04:03:32PM -0700, Ard Biesheuvel wrote: >> Process any capsule HOBs that were left for us by CapsulePei. This >> involves calling ProcessCapsules() twice, as explained in the comment >> in

Re: [edk2] Storing Non volatile variables on SD/NAND

2017-09-19 Thread Ard Biesheuvel
On 18 September 2017 at 22:28, Udit Kumar wrote: > Thanks Vladimir, > With your design, you did delayed write to eMMC due to sharing with OS. But > it works for you:) > Say if eMMC controllers offers you a status bit, if eMMC storage is being > used for not. Then this >

Re: [edk2] [PATCH 2/2] MdePkg/BaseLib: Avoid reading content beyond string boundary

2017-09-19 Thread Ni, Ruiyu
Reviewed-by: Ruiyu Ni -Original Message- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Hao Wu Sent: Tuesday, September 19, 2017 7:39 PM To: edk2-devel@lists.01.org Cc: Wu, Hao A ; Ni, Ruiyu ; Kinney,

Re: [edk2] [PATCH 1/2] ShellPkg/Shell: Avoid reading content beyond string boundary

2017-09-19 Thread Ni, Ruiyu
Reviewed-by: Ruiyu Ni -Original Message- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Hao Wu Sent: Tuesday, September 19, 2017 7:39 PM To: edk2-devel@lists.01.org Cc: Wu, Hao A ; Ni, Ruiyu ; Carsey,

Re: [edk2] [PATCH 1/2] ShellPkg/Shell: Avoid reading content beyond string boundary

2017-09-19 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey > -Original Message- > From: Wu, Hao A > Sent: Tuesday, September 19, 2017 4:39 AM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A ; Ni, Ruiyu ; > Carsey, Jaben ; Shi, Steven >

Re: [edk2] [PATCH v2] PeiLib : Inform UEFI memory to Linux

2017-09-19 Thread Ard Biesheuvel
On 19 September 2017 at 01:07, Sakar Arora wrote: > This change will create the possibility for memory space holding the UEFI > image to be over-written by the DXE core code, since this space will then be > available for allocation. Yes. But why does this matter after the

Re: [edk2] [PATCH v2] PeiLib : Inform UEFI memory to Linux

2017-09-19 Thread Udit Kumar
Thanks for this, If memory is marked as reserved by HobList then gDS->AddMemorySpace will return error 15. No ? Regards Udit > -Original Message- > From: Sakar Arora [mailto:sakar.ar...@arm.com] > Sent: Tuesday, September 19, 2017 4:51 PM > To: Udit Kumar ;

[edk2] [PATCH 6/6] MdeModulePkg/AtaAtapiPassThru: Fix possible out of range left shift

2017-09-19 Thread Hao Wu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=699 Within function AhciModeInitialization(), left shift operations of 'BIT0' in the following statements: "if ((PortImplementBitMap & (BIT0 << Port)) != 0) {" will incur possible out of range left shift when Port is 31, since "1 << 31" is

[edk2] [PATCH 2/6] MdeModulePkg/PrintLib: Fix possible negative value left shift

2017-09-19 Thread Hao Wu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=702 Within function InternalPrintLibSPrintMarker(), possible left shift of a negative value is found in: "(*(ArgumentString + 1) << 8)" which involves undefined behavior. Since '*(ArgumentString + 1)' is of type CONST CHAR8 (signed), it will

[edk2] [PATCH 3/6] MdeModulePkg/Tpl: Fix negative value left shift

2017-09-19 Thread Hao Wu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=695 Within function CoreRestoreTpl(), left shift a negative value -2 is used in: "while (((-2 << NewTpl) & gEventPending) != 0) {" which involves undefined behavior. According to the C11 spec, Section 6.5.7: > 4 The result of E1 << E2 is E1

[edk2] [PATCH 0/6] Resolve undefined behaviours in left shift OPs

2017-09-19 Thread Hao Wu
The series resolves two kinds of undefined behaviours in left shift operations: a. Left-shifting negative values; b. Left-shifting that incurs the result being out of range. Cc: Steven Shi Cc: Michael Kinney Cc: Liming Gao

[edk2] [PATCH 5/6] MdeModulePkg/Crc32: Fix possible out of range left shift

2017-09-19 Thread Hao Wu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=697 Within function ReverseBits(), left shift operations of 1 in the following statements: "(1 << Index)" and "(1 << (31 - Index))" will incur possible out of range left shift when Index is either 0 or 31, since "1 << 31" is possible to exceed

[edk2] [PATCH 4/6] MdeModulePkg/DxeNetLib: Fix negative value left shift

2017-09-19 Thread Hao Wu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=698 Within function NetRandomInitSeed(), left shift a negative value is used in: "~Time.Hour << 24" which involves undefined behavior. Since Time.Hour is of type UINT8 (range from 0 to 23), hence ~Time.Hour will be a negative value (of type

[edk2] [PATCH 1/6] MdePkg/PrintLib: Fix possible negative value left shift

2017-09-19 Thread Hao Wu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=702 Within function InternalPrintLibSPrintMarker(), possible left shift of a negative value is found in: "(*(ArgumentString + 1) << 8)" which involves undefined behavior. Since '*(ArgumentString + 1)' is of type CONST CHAR8 (signed), it will

[edk2] [PATCH 1/2] ShellPkg/Shell: Avoid reading content beyond string boundary

2017-09-19 Thread Hao Wu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=690 Within function EfiShellGetDevicePathFromFilePath(), when the input parameter 'Path' string is like: "FS0:" It is possible for the below statement: "if (*(Path+StrLen(MapName)+1) == CHAR_NULL) {" to read the content 1 byte beyond the

[edk2] [PATCH 2/2] MdePkg/BaseLib: Avoid reading content beyond string boundary

2017-09-19 Thread Hao Wu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=705 As mentioned in the above Bugzilla link by Steven, within the function PathCleanUpDirectories(), when executing command: "cd ." under Shell, the input parameter 'Path' string will have string length less than 2. Hence, it is possible for

[edk2] [PATCH 0/2] Avoid consuming content beyond string boundaries

2017-09-19 Thread Hao Wu
The series adds checks to avoid reading content beyond string boundaries. Cc: Steven Shi Cc: Ruiyu Ni Cc: Jaben Carsey Cc: Michael Kinney Cc: Liming Gao Hao Wu (2):

Re: [edk2] [PATCH v2] PeiLib : Inform UEFI memory to Linux

2017-09-19 Thread Sakar Arora
You could use the DXE services method gDS->AddMemorySpace to add this memory space to the global gMemoryMap. This is the memory map linux efi stub reads to get information about all the available system memory. Thanks, Sakar -Original Message- From: Udit Kumar

Re: [edk2] Failed to clear configuration in Ip4Config2 Protocol

2017-09-19 Thread Karunakar P
Hi Jiaxin, Many thanks for your help. After the successful HTTP boot DNS parsing, I can see the DNS Node, But it have bit difference form UEFI2.7 spec //../MAC(D8CB8ADEBBAA,0x0)/IPv4(0.0.0.0)/Dns(192.168.184.1)/Uri(https://www.cloudboot.com:443/EFI/Shell.efi)

Re: [edk2] [PATCH v2] PeiLib : Inform UEFI memory to Linux

2017-09-19 Thread Udit Kumar
Thanks Sakar, I am wondering, how we can add this memory before OS, please suggest. I guess, we cannot add in HobList when we are in DXE or BDS. Regards Udit > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Sakar > Arora > Sent: Tuesday,

Re: [edk2] [PATCH v2] PeiLib : Inform UEFI memory to Linux

2017-09-19 Thread Sakar Arora
This change will create the possibility for memory space holding the UEFI image to be over-written by the DXE core code, since this space will then be available for allocation. Any such change, if required, should be done just before booting the OS. -Original Message- From: edk2-devel

Re: [edk2] [PATCH V5] MdeModulePkg/DxeCore: Fixed Interface returned by CoreOpenProtocol

2017-09-19 Thread Zeng, Star
Thanks all the Tested-by and Reviewed-by. The new UEFI spec 2.7a has been published at http://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_7_A%20Sept%206.pdf which includes the spec change "1815 OpenProtocol() / EFI_ALREADY_STARTED should output existent Interface" that is

Re: [edk2] [Patch V2] BaseTools: Fix a bug to correct SourceFileList

2017-09-19 Thread Gao, Liming
Reviewed-by: Liming Gao >-Original Message- >From: Zhu, Yonghong >Sent: Monday, September 18, 2017 12:24 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [Patch V2] BaseTools: Fix a bug to correct SourceFileList > >We met a case that

[edk2] [Patch V2] Build spec: add description for build with binary cache

2017-09-19 Thread Yonghong Zhu
V2: change the option name to --binary-destination and --binary-source. fixes:https://bugzilla.tianocore.org/show_bug.cgi?id=689 Cc: Liming Gao Cc: Michael Kinney Cc: Kevin W Shaw Contributed-under: TianoCore

[edk2] [PATCH v2] PeiLib : Inform UEFI memory to Linux

2017-09-19 Thread Meenakshi Aggarwal
While creating Hob list, ArmPlatformPkg is hiding UEFI memory. whereas this memory can be used by OS. This patch, allows OS to use UEFI code area. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Udit Kumar Signed-off-by: Meenakshi Aggarwal

[edk2] [Patch V2] BaseTools: add support for BIOS build with binary cache

2017-09-19 Thread Yonghong Zhu
V2: change the option name to --binary-destination and --binary-source. Add three new options: --hash enables hash-based caching during build process. when --hash is enabled, build tool will base on the module hash value to do the incremental build, without --hash, build tool will base on the

[edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU driver

2017-09-19 Thread Jian J Wang
There're two issues here actually. >From GCD perspective, its SetMemorySpaceAttributes() method doesn't accept page related attributes. That means users cannot use it to change page attributes, and have to turn to CPU arch protocol to do it, which is not be allowed by PI spec. >From CpuDxe

[edk2] [PATCH 2/2] MdeModulePkg/Core: Fix out-of-sync issue in GCD

2017-09-19 Thread Jian J Wang
>From GCD perspective, its SetMemorySpaceAttributes() method doesn't accept page related attributes. That means users cannot use it to change page attributes, and have to turn to CPU arch protocol to do it, which is not be allowed by PI spec. Cc: Jiewen Yao Cc: Eric Dong

[edk2] [PATCH 1/2] UefiCpuPkg/CpuDxe: Fix out-of-sync issue in CpuDxe

2017-09-19 Thread Jian J Wang
>From CpuDxe driver perspective, it doesn't update GCD memory attributes from current page table setup during its initialization. So the memory attributes in GCD might not reflect all memory attributes in real world. Cc: Eric Dong Cc: Jiewen Yao Cc:

Re: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU driver

2017-09-19 Thread Wang, Jian J
I found there's a logic hole in code. A new patch will be sent out. -Original Message- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Jian J Wang Sent: Monday, September 18, 2017 11:09 AM To: edk2-devel@lists.01.org Cc: Kinney, Michael D