Re: [edk2] [PATCH] IntelSiliconPkg IntelVTdDxe: Signal AcpiNotificationFunc() initially

2018-01-03 Thread Yao, Jiewen
Reviewed-by: jiewen@intel.com > -Original Message- > From: Zeng, Star > Sent: Thursday, January 4, 2018 11:31 AM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen > Subject: [PATCH] IntelSiliconPkg IntelVTdDxe: Signal

Re: [edk2] [PATCH] IntelSiliconPkg IntelVTdDxe: Use TPL to protect list/engine operation

2018-01-03 Thread Zeng, Star
Got it and agree. I will keep TPL_CALLBACK for ExitBootServices/LegacyBoot. Thanks, Star -Original Message- From: Yao, Jiewen Sent: Thursday, January 4, 2018 2:17 PM To: Yao, Jiewen ; Zeng, Star ; edk2-devel@lists.01.org Subject: RE: [PATCH]

Re: [edk2] [PATCH] IntelSiliconPkg IntelVTdDxe: Use TPL to protect list/engine operation

2018-01-03 Thread Yao, Jiewen
Correct typo. > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Yao, > Jiewen > Sent: Thursday, January 4, 2018 2:14 PM > To: Zeng, Star ; edk2-devel@lists.01.org > Subject: Re: [edk2] [PATCH] IntelSiliconPkg IntelVTdDxe:

Re: [edk2] [Patch] MdeModulePkg/DxeUdpIoLib: Did some code enhancement for UdpIoLib

2018-01-03 Thread Fu, Siyuan
Hi, Fan + If Udp version is not Udp4 or Udp6, then ASSERT(). It's better to update "Udp4" and "Udp6" to " UDP_IO_UDP4_VERSION" and " UDP_IO_UDP6_VERSION" Other parts are good with me. Reviewed-by: Fu Siyuan > -Original Message- > From: edk2-devel

Re: [edk2] [PATCH] IntelSiliconPkg IntelVTdDxe: Support early SetAttributes()

2018-01-03 Thread Yao, Jiewen
Reviewed-by: jiewen@intel.com > -Original Message- > From: Zeng, Star > Sent: Thursday, January 4, 2018 11:34 AM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen > Subject: [PATCH] IntelSiliconPkg IntelVTdDxe: Support early

Re: [edk2] [PATCH] IntelSiliconPkg IntelVTdDxe: Use TPL to protect list/engine operation

2018-01-03 Thread Yao, Jiewen
It is good to have lock for linked list management. However, I do not think we should update TPM for ExitBootServices/LegacyBoot. I purposely use TPL_CALLBACK to make sure VTd is tear down later, so that other driver can stop DMA before that. Thank you Yao Jiewen > -Original Message-

[edk2] [Patch] MdeModulePkg/DxeUdpIoLib: Did some code enhancement for UdpIoLib

2018-01-03 Thread fanwang2
From: Wang Fan * Added some ASSERT descriptions for library APIs. * Added "Optional" option for Context parameter in UdpIoCancelDgrams(). * Added function return status check for UdpIoFreeIo(). Cc: Ye Ting Cc: Fu Siyuan Cc: Jiaxin Wu

[edk2] [PATCH] IntelSiliconPkg IntelVTdDxe: Support early SetAttributes()

2018-01-03 Thread Star Zeng
Support early SetAttributes() before DMAR table is installed. Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- .../Feature/VTd/IntelVTdDxe/DmaProtection.c| 147 +

[edk2] [PATCH] IntelSiliconPkg IntelVTdDxe: Use TPL to protect list/engine operation

2018-01-03 Thread Star Zeng
Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- IntelSiliconPkg/Feature/VTd/IntelVTdDxe/BmDma.c| 19 ++--- .../Feature/VTd/IntelVTdDxe/DmaProtection.c| 8 +++---

[edk2] [PATCH] IntelSiliconPkg IntelVTdDxe: Signal AcpiNotificationFunc() initially

2018-01-03 Thread Star Zeng
Signal AcpiNotificationFunc() initially for the case that DMAR table has been installed when creating event. Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng ---

[edk2] [Patch 4/4] NetworkPkg: Add more parameter or return status check in UDP6 driver

2018-01-03 Thread fanwang2
From: Wang Fan In UDP6Dxe, there are several places that may be enhanced to check input parameters and returned status. This patch is to fix these issues. Cc: Ye Ting Cc: Jiaxin Wu Cc: Fu Siyuan

[edk2] [Patch 2/4] NetworkPkg: Fix a memory leak issue in UDP6 driver

2018-01-03 Thread fanwang2
From: Wang Fan In UDP6Dxe Udp6Groups(), the code return directly without free the buffer allocated for McastIp when JoinFlag is TRUE. It is a memory leak issue that needs to be fixed. This patch is to fix this issue. Cc: Ye Ting Cc: Jiaxin Wu

[edk2] [Patch 3/4] NetworkPkg: Fix some coding style issues in UDP6 driver

2018-01-03 Thread fanwang2
From: Wang Fan In UDP6Dxe, there are some coding style issues, this patch is to fix these issues. Cc: Ye Ting Cc: Jiaxin Wu Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by:

[edk2] [Patch 0/4] Fix some issues in Udp6Dxe

2018-01-03 Thread fanwang2
From: Wang Fan See descriptions in each patch. Wang Fan (4): NetworkPkg: Add ASSERT error handling for UDP6 driver NetworkPkg: Fix a memory leak issue in UDP6 driver NetworkPkg: Fix some coding style issues in UDP6 driver NetworkPkg: Add more parameter or return

[edk2] [Patch 1/4] NetworkPkg: Add ASSERT error handling for UDP6 driver

2018-01-03 Thread fanwang2
From: Wang Fan In Udp6Dxe, there are several places use ASSERT to check returned value. But these errors should be handled if they occur, this patch is to fix this issue. Cc: Ye Ting Cc: Jiaxin Wu Cc: Fu Siyuan

[edk2] [PATCH v2] UefiCpuPkg/MpInitLib: fix wrong base address set as Stack Guard

2018-01-03 Thread Jian J Wang
> v2 changes: > a. Use each AP's ApTopOfStack to get the stack base address instead of >cpu0's ApTopOfStack which is actually set incorrectly before. > b. Fix cpu0's ApTopOfStack initialization. > c. Fix wrong debug print format. The reason is that DXE part initialization will reuse the stack

Re: [edk2] [RFC v4 4/6] UefiCpuPkg/CpuExceptionHandlerLib: Add helper to valid memory addresses

2018-01-03 Thread Yao, Jiewen
5) For CR4, please use meaning definition for BIT4/BIT5. if ((Cr4 & BIT4) != 0 && (*PageDirEntry & BIT7) != 0) { if (((Cr4 & BIT5) != 0 && (UINT64)LinearAddress > 0xFULL) || 6) For IA32 PAE/PSE calculation, same comment for 3 and 4. 7) Last but not least important, would you please

Re: [edk2] [PATCH] UefiCpuPkg/MpInitLib: fix wrong base address set as Stack Guard

2018-01-03 Thread Wang, Jian J
A correction: although BSP doesn't need it, we still need to initialize its ApTopOfStack correctly because the MP service supports BSP/AP exchange. So I think the line 1501 should be changed to InitializeApData (CpuMpData, 0, 0, CpuMpData->Buffer + CpuMpData->CpuApStackSize); instead of

Re: [edk2] [RFC v4 4/6] UefiCpuPkg/CpuExceptionHandlerLib: Add helper to valid memory addresses

2018-01-03 Thread Yao, Jiewen
Some suggestion: 1) I am not sure if it is proper to use ASSERT in an exception handler, because we know something is wrong. ASSERT ((PhysicalAddress & (sizeof (*Pml4TableEntry) - 1)) == 0); I suggest we just do the check, and return FALSE, if the prerequisite is not satisfied. 2) Can we

Re: [edk2] [PATCH] UefiCpuPkg/MpInitLib: fix wrong base address set as Stack Guard

2018-01-03 Thread Wang, Jian J
Laszlo, More explanations: [UefiCpuPkg\Library\MpInitLib\MpLib.c] According to the code, the BSP's (CpuInfoInHob[0].ApTopOfStack) is initialized to the bottom of the stack (line 1501) but AP's ApTopOfStack is correctly initialized (line 598). Although my calculation is correct, I think it'd be

Re: [edk2] [RFC v4 5/6] UefiCpuPkg/CpuExceptionHandlerLib: Ensure valid frame/stack pointers

2018-01-03 Thread Yao, Jiewen
Some suggestion: 1) Would you please use meaning definition for BIT2? if ((SegmentSelector & BIT2) == 0) { 2) Can we just use (SegmentSelector & ~0x7) for below? ((SegmentSelector >> 3) * 8) 3) Below calculation seems wrong. Should it be: SegDescLimitInBytes = (UINTN)SegDescLimit * SIZE_4KB

Re: [edk2] [Patch 0/5] Refine PXE driver code logic

2018-01-03 Thread Fu, Siyuan
Hi, Sriram So far as I know we don't have plan to remove the MdeModulePkg copy, but we are taking priority to fix the NetworkPkg ones for these duplicate drivers. BestRegards Fu Siyuan > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of >

Re: [edk2] [RFC v4 0/6] Stack trace support in X64 exception handling

2018-01-03 Thread Yao, Jiewen
Thanks Paulo. I tried to apply the patch series to latest code, but fail with below message. Have you rebased to latest code? === git.exe am --3way --ignore-space-change --keep-cr

Re: [edk2] [PATCH] UefiCpuPkg/MpInitLib: fix wrong base address set as Stack Guard

2018-01-03 Thread Wang, Jian J
Laszlo, I revisited code of MpInitLib. I found that CPU_INFO_IN_HOB.ApTopOfStack was assigned to CpuMpData->Buffer in MpInitLibInitialize() (line1501) InitializeApData (CpuMpData, 0, 0, CpuMpData->Buffer); but in (line598) ApTopOfStack = CpuMpData->Buffer + (ProcessorNumber + 1) *

Re: [edk2] [PATCH] UefiCpuPkg/MpInitLib: fix wrong base address set as Stack Guard

2018-01-03 Thread Laszlo Ersek
(CC Jeff) Sorry about the delay. I have some light comments below; I expect at least a few of them to be incorrect :) On 12/29/17 09:36, Jian J Wang wrote: > The reason is that DXE part initialization will reuse the stack allocated > at PEI phase, if MP was initialized before. Some code added

Re: [edk2] [edk2-CCodingStandardsSpecification PATCH 5/5] Fix Chapter 5 Typos

2018-01-03 Thread Laszlo Ersek
On 01/03/18 12:22, evan.ll...@arm.com wrote: > From: Evan Lloyd > > 5.1.1 - Replace "less" with "fewer" (because columns is plural and > countable) > 5.1.5 - Correct tense. (because the C specification still defines...) > Insert full stop. > Insert

Re: [edk2] [RFC v4 4/6] UefiCpuPkg/CpuExceptionHandlerLib: Add helper to valid memory addresses

2018-01-03 Thread Brian J. Johnson
On 12/28/2017 10:39 PM, Paulo Alcantara wrote: + // + // Check if paging is disabled + // + if ((Cr0 & BIT31) == 0) { +// +// If CR4.PAE bit is set, then the linear (or physical) address supports +// only up to 36 bits. +// +if (((Cr4 & BIT5) != 0 && (UINT64)LinearAddress

Re: [edk2] [edk2-CCodingStandardsSpecification PATCH 4/5] Fix Chapter 4 Typo

2018-01-03 Thread Laszlo Ersek
On 01/03/18 12:22, evan.ll...@arm.com wrote: > From: Evan Lloyd > > 4.1.3.2 - remove "See" from 'as specified in See "File Heading"' > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Evan Lloyd > --- >

Re: [edk2] [edk2-CCodingStandardsSpecification PATCH 3/5] Fix Chapter 3 Typos

2018-01-03 Thread Laszlo Ersek
On 01/03/18 12:22, evan.ll...@arm.com wrote: > From: Evan Lloyd > > 3_quick_reference.md has some obviously invalid extra characters at the > end of line 55 ( ",). This patch removes them. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Evan

Re: [edk2] [edk2-CCodingStandardsSpecification PATCH 2/5] Fix Chapter 2 Typos

2018-01-03 Thread Laszlo Ersek
On 01/03/18 12:22, evan.ll...@arm.com wrote: > From: Evan Lloyd > > 2.1 Accessibility - remove erroneous "as" > 2.1 Confirmation - insert missing full stop > 2.1 Forgiveness - excise superfluous "errors" > 2.1 Standard techniques - remove redundant "be to" > >

Re: [edk2] [edk2-CCodingStandardsSpecification PATCH 1/5] Fix Chapter 1 Typos

2018-01-03 Thread Laszlo Ersek
On 01/03/18 12:22, evan.ll...@arm.com wrote: > From: Evan Lloyd > > 1.1 Abstract - replace "then" with "can" (to make meaningful) > 1.2 Rationale - change > "commit to conforming to standards of this specification" > to commit to conforming with the

Re: [edk2] [PATCH v2 01/13] ArmPlatformPkg: Tidy Lcd code: Coding standard

2018-01-03 Thread Evan Lloyd
Hi Ard > -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: 02 January 2018 15:21 > To: Evan Lloyd > Cc: edk2-devel@lists.01.org; Matteo Carlini ; > eif.lindh...@linaro.org; nd > Subject: Re:

Re: [edk2] [PATCH] BaseTools/DevicePath: fix GCC build error in print_mem(), and clean it up

2018-01-03 Thread Laszlo Ersek
On 01/03/18 09:37, Zhu, Yonghong wrote: > I pushed this fix first since it blocked some GCC tool chain. > > SHA-1: 9a6b445bc2e6e2db6f67ab3cc425d5831aa1b7c8 > > Best Regards, > Zhu Yonghong Thank you! Laszlo > > > -Original Message- > From: Zhu, Yonghong > Sent: Wednesday, January

Re: [edk2] 答复: [RFC v4 1/6] UefiCpuPkg/CpuExceptionHandlerLib/X64: Add stack trace support

2018-01-03 Thread Paulo Alcantara
Hi Jeff, On 1/3/2018 6:53 AM, Fan Jeff wrote: Paulo, I did not receive your #0 patch. So, I reply #1 here. Your serial of patches should work for IA32/X64 GCC and IA32 MSFT. I suggest you could push this serial of patches as soon as pass UefiCpuPkg owner/reviewers’ review and validation,

Re: [edk2] 答复: [RFC v4 5/6] UefiCpuPkg/CpuExceptionHandlerLib: Ensure valid frame/stack pointers

2018-01-03 Thread Paulo Alcantara
On 1/3/2018 6:45 AM, Fan Jeff wrote: Paulo, +    if (!IsLogicalAddressValid (SystemContext, +    SystemContext.SystemContextIa32->Ss, +    (UINTN)Ebp) || +    !IsLogicalAddressValid (SystemContext, +   

Re: [edk2] 答复: [RFC v4 4/6] UefiCpuPkg/CpuExceptionHandlerLib: Add helper to valid memory addresses

2018-01-03 Thread Paulo Alcantara
Hi Jeff, On 1/3/2018 6:42 AM, Fan Jeff wrote: Paul, +  // +  // Calculate physical address of PML4E +  // +  PhysicalAddress = (UINT64)Cr3 & (((1ULL << MaxPhyAddrBits) - 1) << 12); +  PhysicalAddress |= (((UINT64)LinearAddress >> 39) & 0x1FF) << 3; + Should not pass VS build, instead you

[edk2] [edk2-CCodingStandardsSpecification PATCH 4/5] Fix Chapter 4 Typo

2018-01-03 Thread evan . lloyd
From: Evan Lloyd 4.1.3.2 - remove "See" from 'as specified in See "File Heading"' Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Evan Lloyd --- 4_naming_conventions/README.md | 418 ++-- 1 file changed, 209

[edk2] [edk2-CCodingStandardsSpecification PATCH 5/5] Fix Chapter 5 Typos

2018-01-03 Thread evan . lloyd
From: Evan Lloyd 5.1.1 - Replace "less" with "fewer" (because columns is plural and countable) 5.1.5 - Correct tense. (because the C specification still defines...) Insert full stop. Insert comma. 5.1.8 - Correct "provided" to "proven". 5.1.9 - remove

[edk2] [edk2-CCodingStandardsSpecification PATCH 1/5] Fix Chapter 1 Typos

2018-01-03 Thread evan . lloyd
From: Evan Lloyd 1.1 Abstract - replace "then" with "can" (to make meaningful) 1.2 Rationale - change "commit to conforming to standards of this specification" to commit to conforming with the standards of this specification 1.3 Scope - add

[edk2] [edk2-CCodingStandardsSpecification PATCH 0/5] Typographic Corrections

2018-01-03 Thread evan . lloyd
From: Evan Lloyd https://bugzilla.tianocore.org/show_bug.cgi?id=839 This patch set contains a number of minor typographical corrections. They have no specific theme, being only that set of things I happened to notice during recent code review sessions where I was frequently

[edk2] [edk2-CCodingStandardsSpecification PATCH 3/5] Fix Chapter 3 Typos

2018-01-03 Thread evan . lloyd
From: Evan Lloyd 3_quick_reference.md has some obviously invalid extra characters at the end of line 55 ( ",). This patch removes them. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Evan Lloyd --- 3_quick_reference.md | 2 +- 1

[edk2] [edk2-CCodingStandardsSpecification PATCH 2/5] Fix Chapter 2 Typos

2018-01-03 Thread evan . lloyd
From: Evan Lloyd 2.1 Accessibility - remove erroneous "as" 2.1 Confirmation - insert missing full stop 2.1 Forgiveness - excise superfluous "errors" 2.1 Standard techniques - remove redundant "be to" Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Evan

Re: [edk2] [PATCH edk2-platforms v2 14/18] ARM/VExpressPkg: Reserving framebuffer at build

2018-01-03 Thread Evan Lloyd
> -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: 23 December 2017 16:03 > To: Evan Lloyd > Cc: edk2-devel@lists.01.org; Arvind Chauhan ; > Daniil Egranov ; Thomas Abraham >

[edk2] 答复: [RFC v4 1/6] UefiCpuPkg/CpuExceptionHandlerLib/X64: Add stack trace support

2018-01-03 Thread Fan Jeff
Paulo, I did not receive your #0 patch. So, I reply #1 here. Your serial of patches should work for IA32/X64 GCC and IA32 MSFT. I suggest you could push this serial of patches as soon as pass UefiCpuPkg owner/reviewers’ review and validation, And then I could send my x64 MSFT support

[edk2] 答复: [RFC v4 6/6] UefiCpuPkg/CpuExceptionHandlerLib: Correctly print IP addresses

2018-01-03 Thread Fan Jeff
Paulo, Thanks. Reviewed-by: Jeff Fan Jeff From: edk2-devel on behalf of Paulo Alcantara Sent: Friday, December 29, 2017 12:39:39 PM To:

[edk2] 答复: [RFC v4 5/6] UefiCpuPkg/CpuExceptionHandlerLib: Ensure valid frame/stack pointers

2018-01-03 Thread Fan Jeff
Paulo, +if (!IsLogicalAddressValid (SystemContext, +SystemContext.SystemContextIa32->Ss, +(UINTN)Ebp) || +!IsLogicalAddressValid (SystemContext, +SystemContext.SystemContextIa32->Ss, +

[edk2] 答复: [RFC v4 4/6] UefiCpuPkg/CpuExceptionHandlerLib: Add helper to valid memory addresses

2018-01-03 Thread Fan Jeff
Paul, + // + // Calculate physical address of PML4E + // + PhysicalAddress = (UINT64)Cr3 & (((1ULL << MaxPhyAddrBits) - 1) << 12); + PhysicalAddress |= (((UINT64)LinearAddress >> 39) & 0x1FF) << 3; + Should not pass VS build, instead you could use LShiftU64/RShiftU64 to do 64bit shift

Re: [edk2] [PATCH] BaseTools/DevicePath: fix GCC build error in print_mem(), and clean it up

2018-01-03 Thread Zhu, Yonghong
I pushed this fix first since it blocked some GCC tool chain. SHA-1: 9a6b445bc2e6e2db6f67ab3cc425d5831aa1b7c8 Best Regards, Zhu Yonghong -Original Message- From: Zhu, Yonghong Sent: Wednesday, January 3, 2018 9:27 AM To: Laszlo Ersek ; edk2-devel-01