On 10/22/15 02:12, Fan, Jeff wrote:
> Jordan,
> 
> CPU ID only could get the max logical processor number supported in current 
> socket. It cannot handle multi-sockets case.
> 
> Yes. We could promote PcdCpuMaxLogicalProcessorNumber to dynamic type. But we 
> need find one reliable way like you said to set it before CPU MP PEI not only 
> CPU MP DXE.

Could a NULL library work, to be linked into either CPU MP PEI or CPU MP
DXE (whichever is used by a platform)? At least for OVMF, this would
work. (See for example the series at git commit range 3d8ac52a..c3db5a8c.)

Another idea (a bit over-engineered, admittedly):
(1) CPU MP DXE should just use the PCD
(2) if the platform in question doesn't include the CPU MP PEIM, then
    it should set the PCD for (1) in another (Platform) PEIM. This
    provides good flexibility for such platforms.
(3) If a platform uses the CPU MP PEIM, then:
(3a) for (1), the CPU MP PEIM itself should set the PCD
(3b) a new PPI could be introduced -- a data structure with one field,
     the max number of processors
(3c) CPU MP PEIM would have a depex on this PPI, and use it for its own
     purposes, as well as for (3a)
(3d) the platform PEIM would produce the PPI.

In other words, it would be a stack of dependencies:
- CPU MP DXE wants the PCD, regardless of what sets it
- CPU MP PEIM wants the PPI, regardless of what produces it.
  The PEIM sets the PCD unconditionally, based on the PPI data.
- dependent on the given platform, the Platform PEIM could set the PCD
  for the CPU MP DXE driver, or install the PPI for the CPU MP PEIM.

Unfortunately this would require updates for all platforms that
currently include the CPU MP PEIM. (The new depex would prevent it from
being dispatched otherwise.)

Myself I'd prefer the NULL library, but that might not be flexible
enough for all platforms.

Thanks
Laszlo



> 
> Thanks!
> Jeff
> 
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Jordan 
> Justen
> Sent: Thursday, October 22, 2015 5:42 AM
> To: Kinney, Michael D; Laszlo Ersek; Kinney, Michael D
> Cc: Alex Williamson; edk2-de...@ml01.01.org; Xiao Guangrong; Eduardo Habkost
> Subject: Re: [edk2] [PATCH] OvmfPkg: increase MP services startup timeout
> 
> On 2015-10-21 14:19:40, Kinney, Michael D wrote:
>> Laszlo,
>>
>> We have the PCD that specifies the max CPUs.
>>
>>   ## Specifies max supported number of Logical Processors.
>>   # @Prompt Configure max supported number of Logical Processors
>>   
>> gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|64|UINT32|0x
>> 00000002
> 
> It would need to be changed to a dynamic PCD.
> 
> In terms of determining the number of logical processors, can't the cpuid 
> function help? I'm not sure how QEMU handles that though.
> (Vaguely I remember something like cpuid only help with a single core... So, 
> if QEMU presents as multiple cores, then maybe it can't
> help.)
> 
> We'd need a reliable way to set the PCD before CpuDxe runs.
> 
> -Jordan
> 
>> We could exit the wait loop as soon as the number of detected CPUs 
>> matches PcdCpuMaxLogicalProcessorNumber.
> _______________________________________________
> 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-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to