Files
system76-edk2/UefiCpuPkg/Library/MpInitLib/MpIntelTdx.h
Min Xu 88da06ca76 UefiCpuPkg: Enable Tdx support in MpInitLib
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429

In TDVF BSP and APs are simplified. BSP is the vCPU-0, while the others
are treated as APs.

So MP intialization is rather simple. ApWorker is not supported, BSP is
always the working processor, while the APs are just in a
wait-for-precedure state.

Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
2022-04-02 08:15:12 +00:00

70 lines
2.7 KiB
C

/** @file
CPU MP Initialize Library header file for Td guest.
Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef MP_INTEL_TDX_H_
#define MP_INTEL_TDX_H_
#include <PiPei.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Uefi/UefiBaseType.h>
#include <Protocol/MpService.h>
/**
Gets detailed MP-related information on the requested processor at the
instant this call is made. This service may only be called from the BSP.
@param[in] ProcessorNumber The handle number of processor.
@param[out] ProcessorInfoBuffer A pointer to the buffer where information for
the requested processor is deposited.
@param[out] HealthData Return processor health data.
@retval EFI_SUCCESS Processor information was returned.
@retval EFI_DEVICE_ERROR The calling processor is an AP.
@retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL.
@retval EFI_NOT_FOUND The processor with the handle specified by
ProcessorNumber does not exist in the platform.
@retval EFI_NOT_READY MP Initialize Library is not initialized.
**/
EFI_STATUS
TdxMpInitLibGetProcessorInfo (
IN UINTN ProcessorNumber,
OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer,
OUT EFI_HEALTH_FLAGS *HealthData OPTIONAL
);
/**
Retrieves the number of logical processor in the platform and the number of
those logical processors that are enabled on this boot. This service may only
be called from the BSP.
@param[out] NumberOfProcessors Pointer to the total number of logical
processors in the system, including the BSP
and disabled APs.
@param[out] NumberOfEnabledProcessors Pointer to the number of enabled logical
processors that exist in system, including
the BSP.
@retval EFI_SUCCESS The number of logical processors and enabled
logical processors was retrieved.
@retval EFI_DEVICE_ERROR The calling processor is an AP.
@retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL and NumberOfEnabledProcessors
is NULL.
@retval EFI_NOT_READY MP Initialize Library is not initialized.
**/
EFI_STATUS
TdxMpInitLibGetNumberOfProcessors (
OUT UINTN *NumberOfProcessors, OPTIONAL
OUT UINTN *NumberOfEnabledProcessors OPTIONAL
);
#endif