UefiCpuPkg[all]  0.90
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ShadowMicrocode.h File Reference

Data Structures

struct  EDKII_PEI_MICROCODE_CPU_ID
 
struct  _EDKII_PEI_SHADOW_MICROCODE_PPI
 

Macros

#define EDKII_PEI_SHADOW_MICROCODE_PPI_GUID
 

Typedefs

typedef struct
_EDKII_PEI_SHADOW_MICROCODE_PPI 
EDKII_PEI_SHADOW_MICROCODE_PPI
 
typedef IN UINTN CpuIdCount
 
typedef IN UINTN IN
EDKII_PEI_MICROCODE_CPU_ID
MicrocodeCpuId
 
typedef IN UINTN IN
EDKII_PEI_MICROCODE_CPU_ID OUT
UINTN * 
BufferSize
 
typedef IN UINTN IN
EDKII_PEI_MICROCODE_CPU_ID OUT
UINTN OUT VOID ** 
Buffer
 

Functions

typedef EFI_STATUS (EFIAPI *EDKII_PEI_SHADOW_MICROCODE)(IN EDKII_PEI_SHADOW_MICROCODE_PPI *This
 

Variables

EFI_GUID gEdkiiPeiShadowMicrocodePpiGuid
 

Detailed Description

This file declares EDKII Shadow Microcode PPI.

Copyright (c) 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Macro Definition Documentation

#define EDKII_PEI_SHADOW_MICROCODE_PPI_GUID
Value:
{ \
0x430f6965, 0x9a69, 0x41c5, { 0x93, 0xed, 0x8b, 0xf0, 0x64, 0x35, 0xc1, 0xc6 } \
}

Typedef Documentation

typedef IN UINTN IN EDKII_PEI_MICROCODE_CPU_ID OUT UINTN OUT VOID** Buffer
typedef IN UINTN IN EDKII_PEI_MICROCODE_CPU_ID OUT UINTN* BufferSize
typedef IN UINTN CpuIdCount

Function Documentation

typedef EFI_STATUS ( EFIAPI *  EFI_SMM_REGISTER_EXCEPTION_HANDLER)

Shadow microcode update patches to memory.

The function is used for shadowing microcode update patches to a continuous memory. It shall allocate memory buffer and only shadow the microcode patches for those processors specified by MicrocodeCpuId array. The checksum verification may be skiped in this function so the caller must perform checksum verification before using the microcode patches in returned memory buffer.

Parameters
[in]ThisThe PPI instance pointer.
[in]CpuIdCountNumber of elements in MicrocodeCpuId array.
[in]MicrocodeCpuIdA pointer to an array of EDKII_PEI_MICROCODE_CPU_ID structures.
[out]BufferSizePointer to receive the total size of Buffer.
[out]BufferPointer to receive address of allocated memory with microcode patches data in it.
Return values
EFI_SUCCESSThe microcode has been shadowed to memory.
EFI_OUT_OF_RESOURCESThe operation fails due to lack of resources.

Get information on a specific CPU.

Parameters
[in]ThisPointer to this instance of the PPI.
[in]ProcessorNumberPointer to the total number of logical processors in the system, including the BSP and disabled APs.
[out]ProcessorInfoBufferNumber of processors in the system that are enabled.
Return values
EFI_SUCCESSProcessor information was returned.
EFI_DEVICE_ERRORThe calling processor is an AP.
EFI_INVALID_PARAMETERProcessorInfoBuffer is NULL.
EFI_NOT_FOUNDThe processor with the handle specified by ProcessorNumber does not exist in the platform.

Activate all of the application proessors.

Parameters
[in]ThisA pointer to the EFI_PEI_MP_SERVICES_PPI instance.
[in]ProcedureA pointer to the function to be run on enabled APs of the system.
[in]SingleThreadIf TRUE, then all the enabled APs execute the function specified by Procedure one by one, in ascending order of processor handle number. If FALSE, then all the enabled APs execute the function specified by Procedure simultaneously.
[in]TimeoutInMicroSecondsIndicates the time limit in microseconds for APs to return from Procedure, for blocking mode only. Zero means infinity. If the timeout expires before all APs return from Procedure, then Procedure on the failed APs is terminated. All enabled APs are available for next function assigned by EFI_PEI_MP_SERVICES_PPI.StartupAllAPs() or EFI_PEI_MP_SERVICES_PPI.StartupThisAP(). If the timeout expires in blocking mode, BSP returns EFI_TIMEOUT.
[in]ProcedureArgumentThe parameter passed into Procedure for all APs.
Return values
EFI_SUCCESSIn blocking mode, all APs have finished before the timeout expired.
EFI_DEVICE_ERRORCaller processor is AP.
EFI_NOT_STARTEDNo enabled APs exist in the system.
EFI_NOT_READYAny enabled APs are busy.
EFI_TIMEOUTIn blocking mode, the timeout expired before all enabled APs have finished.
EFI_INVALID_PARAMETERProcedure is NULL.

Activate a specific application processor.

Parameters
[in]ThisA pointer to the EFI_PEI_MP_SERVICES_PPI instance.
[in]ProcedureA pointer to the function to be run on enabled APs of the system.
[in]ProcessorNumberThe handle number of the AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
[in]TimeoutInMicroSecondsIndicates the time limit in microseconds for APs to return from Procedure, for blocking mode only. Zero means infinity. If the timeout expires before all APs return from Procedure, then Procedure on the failed APs is terminated. All enabled APs are available for next function assigned by EFI_PEI_MP_SERVICES_PPI.StartupAllAPs() or EFI_PEI_MP_SERVICES_PPI.StartupThisAP(). If the timeout expires in blocking mode, BSP returns EFI_TIMEOUT.
[in]ProcedureArgumentThe parameter passed into Procedure for all APs.
Return values
EFI_SUCCESSIn blocking mode, specified AP finished before the timeout expires.
EFI_DEVICE_ERRORThe calling processor is an AP.
EFI_TIMEOUTIn blocking mode, the timeout expired before the specified AP has finished.
EFI_NOT_FOUNDThe processor with the handle specified by ProcessorNumber does not exist.
EFI_INVALID_PARAMETERProcessorNumber specifies the BSP or disabled AP.
EFI_INVALID_PARAMETERProcedure is NULL.

Switch the boot strap processor.

Parameters
[in]ThisA pointer to the EFI_PEI_MP_SERVICES_PPI instance.
[in]ProcessorNumberThe handle number of the AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
[in]EnableOldBSPIf TRUE, then the old BSP will be listed as an enabled AP. Otherwise, it will be disabled.
Return values
EFI_SUCCESSBSP successfully switched.
EFI_UNSUPPORTEDSwitching the BSP cannot be completed prior to this service returning.
EFI_UNSUPPORTEDSwitching the BSP is not supported.
EFI_DEVICE_ERRORThe calling processor is an AP.
EFI_NOT_FOUNDThe processor with the handle specified by ProcessorNumber does not exist.
EFI_INVALID_PARAMETERProcessorNumber specifies the current BSP or a disabled AP.
EFI_NOT_READYThe specified AP is busy.

Enable or disable an application processor.

Parameters
[in]ThisA pointer to the EFI_PEI_MP_SERVICES_PPI instance.
[in]ProcessorNumberThe handle number of the AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
[in]EnableAPSpecifies the new state for the processor for enabled, FALSE for disabled.
[in]HealthFlagIf not NULL, a pointer to a value that specifies the new health status of the AP. This flag corresponds to StatusFlag defined in EFI_PEI_MP_SERVICES_PPI.GetProcessorInfo(). Only the PROCESSOR_HEALTH_STATUS_BIT is used. All other bits are ignored. If it is NULL, this parameter is ignored.
Return values
EFI_SUCCESSThe specified AP was enabled or disabled successfully.
EFI_UNSUPPORTEDEnabling or disabling an AP cannot be completed prior to this service returning.
EFI_UNSUPPORTEDEnabling or disabling an AP is not supported.
EFI_DEVICE_ERRORThe calling processor is an AP.
EFI_NOT_FOUNDProcessor with the handle specified by ProcessorNumber does not exist.
EFI_INVALID_PARAMETERProcessorNumber specifies the BSP.

Identify the currently executing processor.

Parameters
[in]ThisA pointer to the EFI_PEI_MP_SERVICES_PPI instance.
[out]ProcessorNumberThe handle number of the AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
Return values
EFI_SUCCESSThe current processor handle number was returned in ProcessorNumber.
EFI_INVALID_PARAMETERProcessorNumber is NULL.

Activate all of the application proessors.

Parameters
[in]ThisA pointer to the EDKII_PEI_MP_SERVICES2_PPI instance.
[in]ProcedureA pointer to the function to be run on enabled APs of the system.
[in]TimeoutInMicroSecondsIndicates the time limit in microseconds for APs to return from Procedure, for blocking mode only. Zero means infinity. If the timeout expires in blocking mode, BSP returns EFI_TIMEOUT.
[in]ProcedureArgumentThe parameter passed into Procedure for all CPUs.
Return values
EFI_SUCCESSIn blocking mode, all APs have finished before the timeout expired.
EFI_DEVICE_ERRORCaller processor is AP.
EFI_NOT_READYAny enabled APs are busy.
EFI_TIMEOUTIn blocking mode, the timeout expired before all enabled APs have finished.
EFI_INVALID_PARAMETERProcedure is NULL.

Add resources in list to database.

Parameters
ResourceListA pointer to resource list to be added
NumEntriesOptional number of entries. If 0, list must be terminated by END_OF_RESOURCES.
Return values
EFI_SUCCESSIf resources are added
EFI_INVALID_PARAMETERIf nested procedure detected resource failer
EFI_OUT_OF_RESOURCESIf nested procedure returned it and we cannot allocate more areas.

Delete resources in list to database.

Parameters
ResourceListA pointer to resource list to be deleted NULL means delete all resources.
NumEntriesOptional number of entries. If 0, list must be terminated by END_OF_RESOURCES.
Return values
EFI_SUCCESSIf resources are deleted
EFI_INVALID_PARAMETERIf nested procedure detected resource failer

Get BIOS resources.

Parameters
ResourceListA pointer to resource list to be filled
ResourceSizeOn input it means size of resource list input. On output it means size of resource list filled, or the size of resource list to be filled if size of too small.
Return values
EFI_SUCCESSIf resources are returned.
EFI_BUFFER_TOO_SMALLIf resource list buffer is too small to hold the whole resources.

This service switches the requested AP to be the BSP from that point onward. This service changes the BSP for all purposes. This call can only be performed by the current BSP.

This service switches the requested AP to be the BSP from that point onward. This service changes the BSP for all purposes. The new BSP can take over the execution of the old BSP and continue seamlessly from where the old one left off.

If the BSP cannot be switched prior to the return from this service, then EFI_UNSUPPORTED must be returned.

Parameters
[in]ThisA pointer to the EFI_SMM_CPU_SERVICE_PROTOCOL instance.
[in]ProcessorNumberThe handle number of AP that is to become the new BSP. The range is from 0 to the total number of logical processors minus 1.
Return values
EFI_SUCCESSBSP successfully switched.
EFI_UNSUPPORTEDSwitching the BSP cannot be completed prior to this service returning.
EFI_UNSUPPORTEDSwitching the BSP is not supported.
EFI_SUCCESSThe calling processor is an AP.
EFI_NOT_FOUNDThe processor with the handle specified by ProcessorNumber does not exist.
EFI_INVALID_PARAMETERProcessorNumber specifies the current BSP or a disabled AP.
EFI_NOT_READYThe specified AP is busy.

Notify that a new processor has been added to the system.

The SMM CPU driver should add the processor to the SMM CPU list.

If the processor is disabled it won't participate any SMI handler during subsequent SMIs.

Parameters
ThisA pointer to the EFI_SMM_CPU_SERVICE_PROTOCOL instance.
ProcessorIdThe hardware ID of the processor.
ProcessorNumberThe handle number of processor.
ProcessorResourceA pointer to EFI_SMM_PROCESSOR_RESOURCE which holds the assigned resources.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_ALREADY_STARTEDProcessor already present.
EFI_NOT_READYSpace for a new handle could not be allocated.

Notify that a processor is hot-removed.

Remove a processor from the CPU list of the SMM CPU driver. After this API is called, the removed processor must not respond to SMIs in the coherence domain.

Parameters
ThisA pointer to the EFI_SMM_CPU_SERVICE_PROTOCOL instance.
ProcessorIdThe hardware ID of the processor.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_NOT_FOUNDProcessor with the hardware ID specified by ProcessorId does not exist.
EFI_NOT_READYSpecified AP is busy.

This return the handle number for the calling processor. This service may be called from the BSP and APs.

This service returns the processor handle number for the calling processor. The returned value is in the range from 0 to the total number of logical processors minus 1. This service may be called from the BSP and APs. If ProcessorNumber is NULL, then EFI_INVALID_PARAMETER is returned. Otherwise, the current processors handle number is returned in ProcessorNumber, and EFI_SUCCESS is returned.

Parameters
[in]ThisA pointer to the EFI_SMM_CPU_SERVICE_PROTOCOL instance.
[in]ProcessorNumberThe handle number of AP that is to become the new BSP. The range is from 0 to the total number of logical processors minus 1.
Return values
EFI_SUCCESSThe current processor handle number was returned in ProcessorNumber.
EFI_INVALID_PARAMETERProcessorNumber is NULL.

Register exception handler.

Parameters
ThisA pointer to the SMM_CPU_SERVICE_PROTOCOL instance.
ExceptionTypeDefines which interrupt or exception to hook. Type EFI_EXCEPTION_TYPE and the valid values for this parameter are defined in EFI_DEBUG_SUPPORT_PROTOCOL of the UEFI 2.0 specification.
InterruptHandlerA pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called when a processor interrupt occurs. If this parameter is NULL, then the handler will be uninstalled.
Return values
EFI_SUCCESSThe handler for the processor interrupt was successfully installed or uninstalled.
EFI_ALREADY_STARTEDInterruptHandler is not NULL, and a handler for InterruptType was previously installed.
EFI_INVALID_PARAMETERInterruptHandler is NULL, and a handler for InterruptType was not previously installed.
EFI_UNSUPPORTEDThe interrupt specified by InterruptType is not supported.

Variable Documentation

EFI_GUID gEdkiiPeiShadowMicrocodePpiGuid