[edk2-devel] [PATCH V8 13/47] UefiCpuPkg: Enable Tdx support in MpInitLib

Min Xu min.m.xu at intel.com
Wed Mar 16 08:32:05 UTC 2022


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 (#87625): https://edk2.groups.io/g/devel/message/87625
Mute This Topic: https://groups.io/mt/89725404/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list