Re: [edk2] [PATCH edk2-platforms 0/3] Cover letter:Pci Emulation and SATA support

2018-01-04 Thread Ard Biesheuvel
On 5 January 2018 at 06:47, Meenakshi Aggarwal wrote: > Hi Ard, > > I tried NonDiscoverablePciDeviceDxe with Xhci today and unfortunately it also > didnt work. > > I didnt debug it much but XhciInitializeDevice() and UsbEnumerateNewDev() is > failing. > Are you

Re: [edk2] [PATCH edk2-platforms 0/3] Cover letter:Pci Emulation and SATA support

2018-01-04 Thread Meenakshi Aggarwal
Hi Ard, I tried NonDiscoverablePciDeviceDxe with Xhci today and unfortunately it also didnt work. I didnt debug it much but XhciInitializeDevice() and UsbEnumerateNewDev() is failing. XhcSetBiosOwnership: called to set BIOS ownership XhcResetHC! XhcInitSched:DCBAA=0xFE949000 XhcInitSched:

Re: [edk2] [PATCH] OvmfPkg/BaseMemEncryptSevLib: Enable protection for newly added page table

2018-01-04 Thread Ni, Ruiyu
On 1/5/2018 9:10 AM, Wang, Jian J wrote: Add Cc to Ruiyu, who has plan to consolidate page table manipulation method. He may want to share more information. Yes I do have a plan to create a page table library to abstract all page table manipulations. I will share more details in a separate

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

2018-01-04 Thread Wang, Jian J
Glad to know. That saves me time to write my own case:) Regards, Jian From: Fan Jeff [mailto:vanjeff_...@hotmail.com] Sent: Friday, January 05, 2018 11:05 AM To: Yao, Jiewen ; Wang, Jian J ; Laszlo Ersek ; edk2-devel@lists.01.org

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

2018-01-04 Thread Fan Jeff
Cool. PI SCT is better and easier. Jeff 发件人: Yao, Jiewen 发送时间: 2018年1月5日 10:58 收件人: Wang, Jian J; Fan Jeff; Laszlo Ersek; edk2-devel@lists.01.org

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

2018-01-04 Thread Yao, Jiewen
Good. I also suggest we run PI-SCT to make sure it is well tested. Thank you Yao Jiewen From: Wang, Jian J Sent: Friday, January 5, 2018 10:56 AM To: Fan Jeff ; Laszlo Ersek ; edk2-devel@lists.01.org Cc: Yao, Jiewen ; Dong, Eric

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

2018-01-04 Thread Wang, Jian J
I see. Thanks a lot! Regards, Jian > -Original Message- > From: Chaganty, Rangasai V > Sent: Friday, January 05, 2018 10:55 AM > To: Fan Jeff ; Wang, Jian J > ; Laszlo Ersek ; edk2- > de...@lists.01.org > Cc: Yao, Jiewen

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

2018-01-04 Thread Wang, Jian J
Got it. Many thanks! Regards, Jian From: Fan Jeff [mailto:vanjeff_...@hotmail.com] Sent: Friday, January 05, 2018 10:50 AM To: Wang, Jian J ; Laszlo Ersek ; edk2-devel@lists.01.org Cc: Yao, Jiewen ; Dong, Eric

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

2018-01-04 Thread Chaganty, Rangasai V
APIC_BASE MSR 1BH (BIT8) should tell us if the executing thread is BSP or not. This MSR is defined in SDM. -Original Message- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Fan Jeff Sent: Thursday, January 04, 2018 6:50 PM To: Wang, Jian J ;

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

2018-01-04 Thread Fan Jeff
Sorry, Dump the APICID, not CPUID. Jeff 发件人: Fan Jeff 发送时间: 2018年1月5日 10:48 收件人: Wang, Jian J; Laszlo Ersek; edk2-devel@lists.01.org 抄送: Yao,

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

2018-01-04 Thread Fan Jeff
You may use MP->SwitchBSP() to do BSP switch and then dump BSP’s CPUID to know if the switch is successfully. Jeff From: Wang, Jian J Sent: Friday, January 5, 2018 9:57:31 AM To: Fan Jeff; Laszlo Ersek; edk2-devel@lists.01.org Cc: Yao,

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

2018-01-04 Thread Wang, Jian J
Hi Jeff, Do you think the change is OK? Do you know how to test switching BSP? Regards, Jian From: Fan Jeff [mailto:vanjeff_...@hotmail.com] Sent: Friday, January 05, 2018 9:40 AM To: Laszlo Ersek ; Wang, Jian J ; edk2-devel@lists.01.org Cc: Yao,

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

2018-01-04 Thread Fan Jeff
Laszlo, Firstly, SwitchBSP() is one service of MP defined in PI spec. For real case, I think multiple socket system(with different processor stepping) may use this service for purpose. Thanks! Jeff 发件人: Laszlo Ersek 发送时间: 2018年1月4日 20:21 收件人: Wang, Jian

Re: [edk2] [PATCH] OvmfPkg/BaseMemEncryptSevLib: Enable protection for newly added page table

2018-01-04 Thread Wang, Jian J
Add Cc to Ruiyu, who has plan to consolidate page table manipulation method. He may want to share more information. Regards, Jian > -Original Message- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: Friday, January 05, 2018 3:07 AM > To: Brijesh Singh ;

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

2018-01-04 Thread Wang, Jian J
I'm not familiar with BSP/AP switch code either. I just happen to see code comments mentioned switching BSP/AP. So I think it would be better to initialize cpu 0 the same way as others. No matter what, as what the field name implies, ApTopOfStack should never be used to store stack base

Re: [edk2] [PATCH] OvmfPkg/BaseMemEncryptSevLib: Enable protection for newly added page table

2018-01-04 Thread Brijesh Singh
Hi Laszlo, On 01/04/2018 01:07 PM, Laszlo Ersek wrote: meta comment: please also CC Ard on OvmfPkg patches; he too co-maintains OvmfPkg. I will keep that in mind and include Ard on all OvmfPkg patches. The following line is missing, from above your S-o-b: Contributed-under: TianoCore

Re: [edk2] [PATCH edk2-platforms v2 06/18] ARM/VExpressPkg: Add and update debug ASSERTS

2018-01-04 Thread Ard Biesheuvel
On 4 January 2018 at 19:51, Evan Lloyd wrote: > > >> -Original Message- >> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] >> Sent: 04 January 2018 19:24 >> To: Girish Pathak >> Cc: Evan Lloyd ; Matteo Carlini >>

Re: [edk2] [PATCH edk2-platforms v2 06/18] ARM/VExpressPkg: Add and update debug ASSERTS

2018-01-04 Thread Evan Lloyd
> -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: 04 January 2018 19:24 > To: Girish Pathak > Cc: Evan Lloyd ; Matteo Carlini > ; nd ; edk2-devel@lists.01.org; > Thomas

Re: [edk2] FW: [tianocore/edk2] BaseTools: Barf on unknown HOST_ARCH in C Makefile (#122)

2018-01-04 Thread Chema Gonzalez
Added similar changes to `BaseTools/Source/C/Makefiles/header.makefile`. Thanks, -Chema On Fri, Dec 29, 2017 at 7:17 AM, Gao, Liming wrote: > I suggest GNUmakefile also adds this condition to report error message if > HOST_ARCH is not set correctly. > >> -Original

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

2018-01-04 Thread Evan Lloyd
> -Original Message- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: 03 January 2018 16:56 > To: Evan Lloyd ; edk2-devel@lists.01.org > Cc: "ard.biesheu...@linaro.org"@arm.com; > "leif.lindh...@linaro.org"@arm.com; > "matteo.carl...@arm.com"@arm.com;

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

2018-01-04 Thread Evan Lloyd
Hi Laszlo > -Original Message- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: 03 January 2018 16:51 > To: Evan Lloyd ; edk2-devel@lists.01.org > Cc: "ard.biesheu...@linaro.org"@arm.com; > "leif.lindh...@linaro.org"@arm.com; > "matteo.carl...@arm.com"@arm.com;

Re: [edk2] [PATCH edk2-platforms v2 06/18] ARM/VExpressPkg: Add and update debug ASSERTS

2018-01-04 Thread Ard Biesheuvel
On 4 January 2018 at 18:55, Girish Pathak wrote: > Hi Ard, > >> -Original Message- >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of >> Ard Biesheuvel >> Sent: 23 December 2017 14:12 >> To: Evan Lloyd >> Cc:

Re: [edk2] [PATCH] OvmfPkg/BaseMemEncryptSevLib: Enable protection for newly added page table

2018-01-04 Thread Laszlo Ersek
Hi Brijesh, meta comment: please also CC Ard on OvmfPkg patches; he too co-maintains OvmfPkg. More below: On 01/04/18 18:06, Brijesh Singh wrote: > Commit 2ac1730bf2a5 (MdeModulePkg/DxeIpl: Mark page table as read-only) > sets the memory pages used for page table as read-only after paging is >

Re: [edk2] [PATCH edk2-platforms v2 06/18] ARM/VExpressPkg: Add and update debug ASSERTS

2018-01-04 Thread Girish Pathak
Hi Ard, > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of > Ard Biesheuvel > Sent: 23 December 2017 14:12 > To: Evan Lloyd > Cc: "matteo.carl...@arm.com"@arm.com; > "leif.lindh...@linaro.org"@arm.com; "n...@arm.com"@arm.com;

[edk2] [PATCH] OvmfPkg/BaseMemEncryptSevLib: Enable protection for newly added page table

2018-01-04 Thread Brijesh Singh
Commit 2ac1730bf2a5 (MdeModulePkg/DxeIpl: Mark page table as read-only) sets the memory pages used for page table as read-only after paging is setup and sets CR0.WP to protect CPU modifying the read-only pages. The commit causes #PF when MemEncryptSevClearPageEncMask() or

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

2018-01-04 Thread Laszlo Ersek
On 01/04/18 04:09, Jian J Wang wrote: >> 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 end result of

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

2018-01-04 Thread Paulo Alcantara
"Yao, Jiewen" writes: Hi Jiewen, > For 7), you are right that we disable IA32 paging by default. > However, we do support IA32 PAE in DxeIpl. Please refer to > MdeModulePkg\Core\DxeIplPeim\Ia32\DxeLoadFunc.c > == > PageTables = 0; >

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

2018-01-04 Thread Yao, Jiewen
Thank you! For 7), you are right that we disable IA32 paging by default. However, we do support IA32 PAE in DxeIpl. Please refer to MdeModulePkg\Core\DxeIplPeim\Ia32\DxeLoadFunc.c == PageTables = 0; BuildPageTablesIa32Pae = (BOOLEAN) (PcdGetBool (PcdSetNxForStack) &&

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

2018-01-04 Thread Paulo Alcantara
"Yao, Jiewen" writes: Hi Jiewen, > I tried to apply the patch series to latest code, but fail with below message. > > Have you rebased to latest code? Hrm - I thought I did before sending out v4. Sorry for that. I'll make sure to rebase it against latest master before

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

2018-01-04 Thread Paulo Alcantara
"Yao, Jiewen" writes: > 5) For CR4, please use meaning definition for BIT4/BIT5. > if ((Cr4 & BIT4) != 0 && (*PageDirEntry & BIT7) != 0) { > if (((Cr4 & BIT5) != 0 && (UINT64)LinearAddress > 0xFULL) || OK. > > 6) For IA32 PAE/PSE calculation, same comment

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

2018-01-04 Thread Paulo Alcantara
"Yao, Jiewen" writes: Hi 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

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

2018-01-04 Thread Paulo Alcantara
"Brian J. Johnson" writes: Hi Brian, > 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 >> +

Re: [edk2] [PATCH edk2-platforms 0/3] Cover letter:Pci Emulation and SATA support

2018-01-04 Thread Meenakshi Aggarwal
> -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Thursday, January 04, 2018 5:03 PM > To: Meenakshi Aggarwal > Cc: star.z...@intel.com; eric.d...@intel.com; Leif Lindholm > ; Kinney, Michael D >

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

2018-01-04 Thread Laszlo Ersek
On 01/04/18 02:45, Wang, Jian J wrote: > 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,

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

2018-01-04 Thread Laszlo Ersek
On 01/04/18 02:09, Wang, Jian J wrote: > 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 >

Re: [edk2] [PATCH edk2-platforms 0/3] Cover letter:Pci Emulation and SATA support

2018-01-04 Thread Ard Biesheuvel
On 4 January 2018 at 11:27, Meenakshi Aggarwal wrote: > Hi Ard, > > > I tried using NonDiscoverablePciDeviceDxe driver for SATA (AHCI), but on > using this my SATA drive is not been detected by UEFI. > > Below is the reason of error: > > From EnumerateAttachedDevice()

Re: [edk2] [PATCH edk2-platforms 0/3] Cover letter:Pci Emulation and SATA support

2018-01-04 Thread Meenakshi Aggarwal
Hi Ard, I tried using NonDiscoverablePciDeviceDxe driver for SATA (AHCI), but on using this my SATA drive is not been detected by UEFI. Below is the reason of error: >From EnumerateAttachedDevice() function AhciModeInitialization() function gets >called. In AhciModeInitialization() under

[edk2] [Patch] BaseTools: Add back the cc71d8 version's fix

2018-01-04 Thread Yonghong Zhu
The version cc71d8's fix was washed out by structure pcd report patch. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu --- BaseTools/Source/Python/build/BuildReport.py | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-)

[edk2] [Patch] BaseTools: Not print SKUID info for PCD when it is only Single SKUID

2018-01-04 Thread Yonghong Zhu
when it is only single SKUID, we don't need to print the SKUID info for every PCD since in the Global section there already have this info. For DefaultStore, we use same rule. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu ---