Re: [edk2] question about setuping IDT in UEFI boot procedure

2014-10-27 Thread Fan, Jeff
For the case 32bit PEI + 64Bit DXE, we need to load 64bit IDT table to capture exceptions happened in long mode because 32bit IDT table cannot work in long mode. For the case 32bit PEI + 32bit DXE, we could use the 32bit IDT table setup in SEC/PEI and needn't to load new 32bit IDT table. -O

Re: [edk2] question about setuping IDT in UEFI boot procedure

2014-10-27 Thread TigerLiu
Hi, Jeff: Got it! Thanks a lot! For creating IDT in SEC/PEI phase, is it just for source level debug purpose? Usually, PEI should turn off interrupt, right? Best wishes, - Original Message - From: Fan, Jeff [mailto:jeff@intel.com] Sent: 2014年10月27日 15:04 To: edk2-devel@lists.sourcefo

Re: [edk2] question about setuping IDT in UEFI boot procedure

2014-10-27 Thread Fan, Jeff
No. It’s SEC's responsibility to setup IDT table to capture CPU exceptions in SEC/PEI phases. Please refer to AsmWriteIdtr() in OvmfPkg\Sec\SecMain.c. Debug Agent Lib in Source Level Debug Package is just to overwrite original IDT entries to provide source debugging feature. Jeff -Original

[edk2] [RFC PATCH v6 10/27] UefiCpuPkg/CpuDxe: implement Mp Protocol: WhoAmI()

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 51 ++- UefiCpuPkg/CpuDxe/CpuMp.h | 31 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/UefiCpuPk

[edk2] [RFC PATCH v6 23/27] UefiCpuPkg/MpService: avoid reset AP still hold a lock

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 9 + UefiCpuPkg/CpuDxe/CpuMp.h | 1 + 2 files changed, 10 insertions(+) diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index b718465..6fcafc2 100644 --- a/U

[edk2] [RFC PATCH v6 11/27] UefiCpuPkg/CpuDxe: implement Mp Protocol:GetNumberOfProcessors()

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 82 ++- UefiCpuPkg/CpuDxe/CpuMp.h | 44 + 2 files changed, 125 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/

[edk2] [RFC PATCH v6 13/27] UefiCpuPkg/CpuDxe: implement Mp Protocol:EnableDisableAP()

2014-10-27 Thread Chen Fan
Due to the implementation of AcquireSpinLock() is not MP safe, so we should use AcquireSpinLockOrFail directly instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 186 +- UefiCpuPkg/

[edk2] [RFC PATCH v6 18/27] UefiCpuPkg/MpService: move settimer out to InitMpSystemData

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 128 -- 1 file changed, 78 insertions(+), 50 deletions(-) diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index 8482cdf..

[edk2] [RFC PATCH v6 02/27] UefiCpuPkg/CpuDxe: Add ApEntryPointInC

2014-10-27 Thread Chen Fan
From: Jordan Justen This is the function the AP assembly code will expect to call after getting a lock and setting up the stack. Only one AP will enter this routine at a time. If ApEntryPointInC exits, then the assembly code will loop around to grab the lock, setup the stack, and call ApEntryPo

[edk2] [RFC PATCH v6 09/27] UefiCpuPkg/CpuDxe: introduce MP_SYSTEM_DATA for Mp Service Protocol

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuDxe.inf | 1 + UefiCpuPkg/CpuDxe/CpuMp.c| 89 +++- UefiCpuPkg/CpuDxe/CpuMp.h| 47 +++ UefiCpuPkg/UefiCpuPkg.dsc| 1 +

[edk2] [RFC PATCH v6 24/27] UefiCpuPkg/MpService: avoid dead lock caused by CheckAllAPsStatus

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 40 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index 6fcafc2..7f6312c

[edk2] [RFC PATCH v6 26/27] UefiCpuPkg/CpuDxe: install Mp Service protocol

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index 3668f05..f950832 100644 --- a/UefiCpuPkg/CpuDxe/CpuMp.c +++ b/U

[edk2] [RFC PATCH v6 25/27] UefiCpuPkg/CpuDxe: Startup APs

2014-10-27 Thread Chen Fan
This sequence should happen: * CpuMp.c: Allocate a stack for the APs * ApStartup.c: Send Start IPI to wake APs in 16-bit real mode * MpAsm.S: AP enters CpuDxe driver code without stack - AP grabs a lock - AP sets up stack - AP calls CpuMp.c:ApEntryPointInC Contributed-under: TianoCore Contri

[edk2] [RFC PATCH v6 08/27] UefiCpuPkg/CpuDxe: introduce EFI_MP_SERVICES_PROTOCOL

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuDxe.inf | 1 + UefiCpuPkg/CpuDxe/CpuMp.c| 10 ++ UefiCpuPkg/CpuDxe/CpuMp.h| 2 ++ 3 files changed, 13 insertions(+) diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.inf b/UefiCpuPkg/Cp

[edk2] [RFC PATCH v6 03/27] UefiCpuPkg/CpuDxe: Add stackless assembly AP entry points

2014-10-27 Thread Chen Fan
From: Jordan Justen The AP startup code simply jumps into this code with the CpuDxe driver without setting up a stack for the processor. Therefore, this code must setup the stack before calling into C code. This is the basic flow: * AP enters CpuDxe driver code (AsmApEntryPoint) without stack

[edk2] [RFC PATCH v6 19/27] UefiCpuPkg/MpService: Simply Lock usage

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 89 +-- 1 file changed, 47 insertions(+), 42 deletions(-) diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index e97fb5c..

[edk2] [RFC PATCH v6 16/27] UefiCpuPkg/CpuDxe: implement Mp Services:SwitchBSP()

2014-10-27 Thread Chen Fan
by now, SwitchBSP() always return UNSUPPORTED Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 51 ++- UefiCpuPkg/CpuDxe/CpuMp.h | 43 +++ 2 files change

[edk2] [RFC PATCH v6 01/27] UefiCpuPkg/CpuDxe: Add no-op InitializeMpSupport

2014-10-27 Thread Chen Fan
From: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- UefiCpuPkg/CpuDxe/CpuDxe.c | 3 +++ UefiCpuPkg/CpuDxe/CpuDxe.inf | 2 ++ UefiCpuPkg/CpuDxe/CpuMp.c| 28 UefiCpuPkg/CpuDxe/CpuMp.h| 27 +++

[edk2] [RFC PATCH v6 20/27] UefiCpuPkg/MpService: avoid next timer getting into CheckAllAPsStatus()

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index 1759f16..1ef1cf3 100644 --- a/UefiC

[edk2] [RFC PATCH v6 06/27] UefiCpuPkg/CpuDxe: introduce two PCD value

2014-10-27 Thread Chen Fan
introduce PCD value: PcdCpuMaxLogicalProcessorNumber and PcdCpuApStackSize, used for initialize APs stacks. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuDxe.inf | 4 UefiCpuPkg/CpuDxe/CpuMp.c| 41 ++

[edk2] [RFC PATCH v6 00/27] Introduce Mp Service protocol to UefiCpuPkg

2014-10-27 Thread Chen Fan
This series patchset try to implement Mp Service protocol in UefiCpuPkg, Jordan had implemented the startup APs code, and I try to add more initialization code to let all APs work up, this Mp Service protocol's implementation used EmulatorPkg/MpService for reference. this patches works on my github

[edk2] [RFC PATCH v6 04/27] UefiCpuPkg/CpuDxe: Move GDT structures into CpuGdt.h

2014-10-27 Thread Chen Fan
From: Jordan Justen We'll want to use the structures for AP startup. Note: It seems previously we were not using '#pragma pack ()' in CpuGdt.c. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- UefiCpuPkg/CpuDxe/CpuGdt.c | 52 +-

[edk2] [RFC PATCH v6 27/27] UefiCpuPkg/CpuDxe: add Mp Service TestCase (!upstream)

2014-10-27 Thread Chen Fan
NOTE: this patches is for testing temporary. So it should be ignore when adding to main tree. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuDxe.c| 2 + UefiCpuPkg/CpuDxe/CpuDxe.inf | 1 + UefiCpuPkg/CpuDxe/CpuMp.h | 9 +

[edk2] [RFC PATCH v6 07/27] UefiCpuPkg/CpuDxe: Switch Ap Stack to NewStack

2014-10-27 Thread Chen Fan
All APs use the same common stack to initialization. after initialization, APs should switch to the stack of its own. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 26 ++ 1 file changed, 26 insertions(+) d

[edk2] [RFC PATCH v6 05/27] UefiCpuPkg/CpuDxe: Add StartApsStackless routine

2014-10-27 Thread Chen Fan
From: Jordan Justen This routine starts the APs and directs them to run the specified code. The specified code is entered without a stack being available. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- UefiCpuPkg/CpuDxe/ApStartup.asm | 111 +++

[edk2] [RFC PATCH v6 14/27] UefiCpuPkg/CpuDxe: implement Mp Protocol:StartupThisAP()

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 344 +- UefiCpuPkg/CpuDxe/CpuMp.h | 117 2 files changed, 460 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/CpuDxe/C

[edk2] [RFC PATCH v6 21/27] UefiCpuPkg/CpuDxe: split out StartupCode from StartApsStackless()

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/ApStartup.c | 54 --- UefiCpuPkg/CpuDxe/CpuMp.c | 3 +++ UefiCpuPkg/CpuDxe/CpuMp.h | 27 ++ 3 files changed, 66 insertions(+),

[edk2] [RFC PATCH v6 12/27] UefiCpuPkg/CpuDxe: implement Mp Services:GetProcessorInfo()

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 52 ++- UefiCpuPkg/CpuDxe/CpuMp.h | 34 +++ 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/UefiCp

[edk2] [RFC PATCH v6 17/27] UefiCpuPkg/CpuDxe: Ap do loop routine to execute procedure

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 33 - 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index 3ea6ff0..8482cdf 100644 -

[edk2] [RFC PATCH v6 15/27] UefiCpuPkg/CpuDxe: implement Mp Services:StartupAllAPs()

2014-10-27 Thread Chen Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/CpuMp.c | 436 +- UefiCpuPkg/CpuDxe/CpuMp.h | 160 + 2 files changed, 595 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/CpuDxe/

[edk2] [RFC PATCH v6 22/27] UefiCpuPkg/CpuDxe: introduce ResetApStackless()

2014-10-27 Thread Chen Fan
If timeout expires before AP returns from Procedure, the AP should be terminated, we introduce ResetApStackLess() to send init IPI to let AP exit Procedurce and re-available. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan --- UefiCpuPkg/CpuDxe/ApStartup.c | 19 ++

Re: [edk2] Firmware Volume Block Protocol

2014-10-27 Thread Gao, Liming
Hi, DxeCore has FVB notify function to call FVB protocol to check whether a FV image is there. DxeCore will read FV header, then base on header length to read the whole FV header, last check FV header. If your FV is not PI FFS format, its FV header length field is invalid that causes DxeCore

[edk2] Get BlockIo protocol from Ata Device based on Port and Multiplier Port

2014-10-27 Thread Rafael Machado
Hi everyone. I have a system, that has a Storage device. This device can be detected at Port 0, Multiplier 0 by the EFI_ATA_PASS_THRU_PROTOCOL.GetNextDevice() *typedef EFI_STATUS* *(EFIAPI *EFI_ATA_PASS_THRU_GET_NEXT_DEVICE) (* *IN EFI_ATA_PASS_THRU_PROTOCOL *This,* *IN UINT16 Port,* *IN OUT UINT

Re: [edk2] EDK2: Add #ifndef/#endif and remove trailing white space

2014-10-27 Thread Bruce Cran
On 10/23/2014 12:59 PM, Leahy, Leroy P wrote: > Attached is an updated patch without the comments. > > Attestation: > > I have made the following change to support Google. > > Submission: > > Code clean-up: Remove trailing spaces and add #ifndef/#endif around > NULL, MAX and MIN. There's an existi

Re: [edk2] [Xen-devel] [PATCH v4 00/19] Introducing Xen PV block driver to OVMF

2014-10-27 Thread Anthony PERARD
On Fri, Oct 24, 2014 at 04:29:39PM -0700, Jordan Justen wrote: > Can you make these changes: > > OvmfPkg: Introduce XenBus Protocol. > OvmfPkg/Include/Protocol/XenBus.h > Use standard EDK II BSD license header. Done. > OvmfPkg/XenBusDxe: Add Grant Table functions. > OvmfPkg/XenBusDxe/GrantTable.

Re: [edk2] Edk2Setup.bat doesn't inherit %PATH% from calling shell

2014-10-27 Thread Hauch, Larry
Hi, Actually, ORIGINAL_PATH is not a local variable, but is used as a flag so that when Edk2Setup (or edksetup) is run multiple times in the same command prompt window, the EDK II BaseTools path does not get added more than one time, along with other changes to the PATH. The design allowed for u

Re: [edk2] Firmware Volume Block Protocol

2014-10-27 Thread Narinder Dhillon
Hi Liming, Yes, the patch helped and now the initialization is not stuck in a loop. When UEFI runs for the first time, eMMC flash device is blank and there will not be any information or FVB header. Would UEFI create one ? Or do I have to create a volume first before UEFI will start using it ? Tha

[edk2] UDK2014.SP1: UefiHandleParsingLib now consumes gEfiShellDynamicCommandProtocolGuid?

2014-10-27 Thread Bruce Cran
I have code that uses UefiHandleParsingLib that builds using UDK2014 but not using the latest UDK2014.SP1 code: it appears that UefiHandleParsingLib now depends on gEfiShellDynamicCommandProtocolGuid. Should it be listed as being consumed in UefiHandleParsingLib.inf, or would I need to add it to m

Re: [edk2] Firmware Volume Block Protocol

2014-10-27 Thread Andrew Fish
> On Oct 27, 2014, at 12:11 PM, Narinder Dhillon wrote: > > Hi Liming, > > Yes, the patch helped and now the initialization is not stuck in a loop. > When UEFI runs for the first time, eMMC flash device is blank and there will > not be any information or FVB header. Would UEFI create one ? Or

Re: [edk2] Edk2Setup.bat doesn't inherit %PATH% from calling shell

2014-10-27 Thread Scott Duplichan
Hauch, Larry [mailto:larry.ha...@intel.com] wrote: ]Hi, ]Actually, ORIGINAL_PATH is not a local variable, but is used as a flag so that when Edk2Setup (or edksetup) is run multiple times ]in the same command prompt window, the EDK II BaseTools path does not get added more than one time, along w

[edk2] [PATCH v3 0/6] OVMF: Adding support for Qemu Q35 machine type

2014-10-27 Thread Gabriel L. Somlo
New in version 3: - patches 6 and 7 from earlier v2 now merged into a single PCI/ACPI initialization patch; PIIX4 initialization of PCI_INTERRUPT_LINE register re-added (in cleaned up form) as per Paolo's recommendation, with a "FIXME" comment stating we should look for a way to init

[edk2] [PATCH v3 2/6] OvmfPkg: PlatformPei: Platform specific ACPI power management setup

2014-10-27 Thread Gabriel L. Somlo
Set up ACPI power management using registers determined based on the underlying (PIIX4 or Q35/MCH) platform type. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gabriel Somlo --- OvmfPkg/PlatformPei/Platform.c | 42 +++--- 1 file change

[edk2] [PATCH v3 3/6] OvmfPkg: Add PCD for Host Bridge dev. ID (PcdOvmfHostBridgePciDevId)

2014-10-27 Thread Gabriel L. Somlo
Set from PEI, this PCD allows subsequent stages (specifically DXE_DRIVER and DXE_RUNTIME_DRIVER) to infer the underlying platform type (e.g. PIIX4 or Q35/MCH) without the need to further query the Host Bridge for its Device ID. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by:

[edk2] [PATCH v3 4/6] OvmfPkg: AcpiTimerLib: Split into multiple phase-specific instances

2014-10-27 Thread Gabriel L. Somlo
Remove local power management register access macros in favor of factored-out ones in OvmfPkg/Include/OvmfPlatforms.h Next, AcpiTimerLib is split out into three instances, for use during various stages: - BaseRom: used during SEC, PEI_CORE, and PEIM; - Dxe: used during DXE_DRIVER and DXE_

[edk2] [PATCH v3 5/6] OvmfPkg: CsmSupportLib: Set/use platform specific legacy interrupt device

2014-10-27 Thread Gabriel L. Somlo
Use a PCD set from PEI to determine the legacy interrupt device number appropriate for the underlying platform type during protocol initialization. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gabriel Somlo --- OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf | 3 +++ OvmfP

[edk2] [PATCH v3 6/6] OvmfPkg: PlatformBdsLib: Platform dependent PCI/IRQ initialization

2014-10-27 Thread Gabriel L. Somlo
Merge PciInitialization() and AcpiInitialization() into a single function, PciAcpiInitialization(), and use a PCD set during PEI to detect the underlying platform type (PIIX4 or Q35/MCH) and therefore the addresses of the registers to be initialized. Add LNK[A-H] routing target initialization for

[edk2] [PATCH v3 1/6] OvmfPkg: Factor out platform detection (q35 vs. piix4)

2014-10-27 Thread Gabriel L. Somlo
Introduce macros to detect the underlying platform and access its ACPI power management registers, based on querying the host bridge device ID. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gabriel Somlo --- OvmfPkg/Include/OvmfPlatforms.h | 49 ++