GetProcessorInfo() can return the information for index#0 CPU.
Other suggestions look good to me.

-----Original Message-----
From: Xu, Min M <min.m...@intel.com> 
Sent: Wednesday, March 16, 2022 4:32 PM
To: Ni, Ray <ray...@intel.com>; devel@edk2.groups.io
Cc: Brijesh Singh <brijesh.si...@amd.com>; Aktas, Erdem 
<erdemak...@google.com>; James Bottomley <j...@linux.ibm.com>; Yao, Jiewen 
<jiewen....@intel.com>; Tom Lendacky <thomas.lenda...@amd.com>; Dong, Eric 
<eric.d...@intel.com>; Kumar, Rahul1 <rahul1.ku...@intel.com>; Gerd Hoffmann 
<kra...@redhat.com>
Subject: RE: [PATCH V8 13/47] UefiCpuPkg: Enable Tdx support in MpInitLib

On March 15, 2022 3:58 PM, Ni Ray wrote:
> 
> Min,
> I don't quite understand.
> 
> Of all MP services, the TDX version only supports:
> * GetNumberOfProcessors
> * GetProcessorInfo
> 
> And even when TDX MP returns 3 or 4 threads from GetNumberOfProcessors(),
> StartupAllAPs() is an NOP.
> Will that cause any issue?
> 
> Can you avoid running MP driver when TDX is enabled?
MP Driver cannot be skipped in td guest. Because there are other drivers depend 
on the protocol (gEfiMpServiceProtocolGuid) which is produced by MP driver.

MP service of Td guest is different from the current MP service in EDK2. Td 
guest implement the MP service by the mechanism of mailbox. Please see [TDVF] 
4.3 TDVF AP Handling & [GHCI] 4.1 ACPI MADT Multiprocessor Wakeup Table.
[TDVF] 
https://www.intel.com/content/dam/develop/external/us/en/documents/tdx-virtual-firmware-design-guide-rev-1.01.pdf
[GHCI] 
https://www.intel.com/content/dam/develop/external/us/en/documents/intel-tdx-guest-hypervisor-communication-interface-1.0-344426-002.pdf

So here is my suggestion to this problem.
In MpInitLib if it is Td guest, then GetNumberOfProcessors just return 
(NumberOfProcessors=1, NumberOfEnabledProcessors=1). Because only the BSP is 
workable at this moment.
GetProcessorInfo returns EFI_UNSUPPORTED. Because in current stage Td guest 
doesn't have the MP Service requirement.

What's your thought?

Thanks
Min


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87626): https://edk2.groups.io/g/devel/message/87626
Mute This Topic: https://groups.io/mt/89725404/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to