Files
system76-edk2/OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h
Laszlo Ersek 763840c9ab OvmfPkg/CpuHotplugSmm: add function for collecting CPUs with events
Add a function that collects the APIC IDs of CPUs that have just been
hot-plugged, or are about to be hot-unplugged.

Pending events are only located and never cleared; QEMU's AML needs the
firmware to leave the status bits intact in the hotplug register block.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200226221156.29589-10-lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
2020-03-04 12:22:07 +00:00

47 lines
1.4 KiB
C

/** @file
Macros for accessing QEMU's CPU hotplug register block.
Copyright (C) 2019, Red Hat, Inc.
SPDX-License-Identifier: BSD-2-Clause-Patent
@par Specification Reference:
- "docs/specs/acpi_cpu_hotplug.txt" in the QEMU source tree.
The original (now "legacy") CPU hotplug interface appeared in QEMU v1.5.0.
The new ("modern") hotplug interface appeared in QEMU v2.7.0.
The macros in this header file map to the minimal subset of the modern
interface that OVMF needs.
**/
#ifndef QEMU_CPU_HOTPLUG_H_
#define QEMU_CPU_HOTPLUG_H_
#include <Base.h>
//
// Each register offset is:
// - relative to the board-dependent IO base address of the register block,
// - named QEMU_CPUHP_(R|W|RW)_*, according to the possible access modes of the
// register,
// - followed by distinguished bitmasks or values in the register.
//
#define QEMU_CPUHP_R_CMD_DATA2 0x0
#define QEMU_CPUHP_R_CPU_STAT 0x4
#define QEMU_CPUHP_STAT_ENABLED BIT0
#define QEMU_CPUHP_STAT_INSERT BIT1
#define QEMU_CPUHP_STAT_REMOVE BIT2
#define QEMU_CPUHP_RW_CMD_DATA 0x8
#define QEMU_CPUHP_W_CPU_SEL 0x0
#define QEMU_CPUHP_W_CMD 0x5
#define QEMU_CPUHP_CMD_GET_PENDING 0x0
#define QEMU_CPUHP_CMD_GET_ARCH_ID 0x3
#endif // QEMU_CPU_HOTPLUG_H_