TianoCore EDK2 master
Loading...
Searching...
No Matches
QemuCpuhp.c File Reference

Go to the source code of this file.

Functions

UINT32 QemuCpuhpReadCommandData2 (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo)
 
UINT8 QemuCpuhpReadCpuStatus (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo)
 
UINT32 QemuCpuhpReadCommandData (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo)
 
VOID QemuCpuhpWriteCpuSelector (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, IN UINT32 Selector)
 
VOID QemuCpuhpWriteCpuStatus (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, IN UINT8 CpuStatus)
 
VOID QemuCpuhpWriteCommand (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, IN UINT8 Command)
 
EFI_STATUS QemuCpuhpCollectApicIds (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, IN UINT32 PossibleCpuCount, IN UINT32 ApicIdCount, OUT APIC_ID *PluggedApicIds, OUT UINT32 *PluggedCount, OUT APIC_ID *ToUnplugApicIds, OUT UINT32 *ToUnplugSelectors, OUT UINT32 *ToUnplugCount)
 

Detailed Description

Simple wrapper functions and utility functions that access QEMU's modern CPU hotplug register block.

These functions manipulate some of the registers described in "docs/specs/acpi_cpu_hotplug.txt" in the QEMU source. IO Ports are accessed via EFI_MM_CPU_IO_PROTOCOL. If a protocol call fails, these functions don't return.

Copyright (c) 2020, Red Hat, Inc.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file QemuCpuhp.c.

Function Documentation

◆ QemuCpuhpCollectApicIds()

EFI_STATUS QemuCpuhpCollectApicIds ( IN CONST EFI_MM_CPU_IO_PROTOCOL MmCpuIo,
IN UINT32  PossibleCpuCount,
IN UINT32  ApicIdCount,
OUT APIC_ID *  PluggedApicIds,
OUT UINT32 *  PluggedCount,
OUT APIC_ID *  ToUnplugApicIds,
OUT UINT32 *  ToUnplugSelectors,
OUT UINT32 *  ToUnplugCount 
)

Collect the APIC IDs of

  • the CPUs that have been hot-plugged,
  • the CPUs that are about to be hot-unplugged.

This function only scans for events – it does not modify them – in the hotplug registers.

On error, the contents of the output parameters are undefined.

Parameters
[in]MmCpuIoThe EFI_MM_CPU_IO_PROTOCOL instance for accessing IO Ports.
[in]PossibleCpuCountThe number of possible CPUs in the system. Must be positive.
[in]ApicIdCountThe number of elements each one of the PluggedApicIds and ToUnplugApicIds arrays can accommodate. Must be positive.
[out]PluggedApicIdsThe APIC IDs of the CPUs that have been hot-plugged.
[out]PluggedCountThe number of filled-in APIC IDs in PluggedApicIds.
[out]ToUnplugApicIdsThe APIC IDs of the CPUs that are about to be hot-unplugged.
[out]ToUnplugSelectorsThe QEMU Selectors of the CPUs that are about to be hot-unplugged.
[out]ToUnplugCountThe number of filled-in APIC IDs in ToUnplugApicIds.
Return values
EFI_INVALID_PARAMETERPossibleCpuCount is zero, or ApicIdCount is zero.
EFI_PROTOCOL_ERRORInvalid bitmap detected in the QEMU_CPUHP_R_CPU_STAT register.
EFI_BUFFER_TOO_SMALLThere was an attempt to place more than ApicIdCount APIC IDs into one of the PluggedApicIds and ToUnplugApicIds arrays.
EFI_SUCCESSOutput parameters have been set successfully.

Definition at line 211 of file QemuCpuhp.c.

◆ QemuCpuhpReadCommandData()

UINT32 QemuCpuhpReadCommandData ( IN CONST EFI_MM_CPU_IO_PROTOCOL MmCpuIo)

Definition at line 73 of file QemuCpuhp.c.

◆ QemuCpuhpReadCommandData2()

UINT32 QemuCpuhpReadCommandData2 ( IN CONST EFI_MM_CPU_IO_PROTOCOL MmCpuIo)

Definition at line 23 of file QemuCpuhp.c.

◆ QemuCpuhpReadCpuStatus()

UINT8 QemuCpuhpReadCpuStatus ( IN CONST EFI_MM_CPU_IO_PROTOCOL MmCpuIo)

Definition at line 48 of file QemuCpuhp.c.

◆ QemuCpuhpWriteCommand()

VOID QemuCpuhpWriteCommand ( IN CONST EFI_MM_CPU_IO_PROTOCOL MmCpuIo,
IN UINT8  Command 
)

Definition at line 142 of file QemuCpuhp.c.

◆ QemuCpuhpWriteCpuSelector()

VOID QemuCpuhpWriteCpuSelector ( IN CONST EFI_MM_CPU_IO_PROTOCOL MmCpuIo,
IN UINT32  Selector 
)

Definition at line 98 of file QemuCpuhp.c.

◆ QemuCpuhpWriteCpuStatus()

VOID QemuCpuhpWriteCpuStatus ( IN CONST EFI_MM_CPU_IO_PROTOCOL MmCpuIo,
IN UINT8  CpuStatus 
)

Definition at line 120 of file QemuCpuhp.c.