On 10/11/19 08:50, Laszlo Ersek wrote: > On 10/10/19 20:08, Michael S. Tsirkin wrote: >> On Thu, Oct 10, 2019 at 06:23:00PM +0200, Laszlo Ersek wrote: >>> On 10/10/19 14:48, Igor Mammedov wrote: >>> >>>> it doesn't really matter if it's ACPI blob or fw_cfg, >>>> what firmware needs is a table of possible CPUs with APIC IDs. >>> >>> To repeat my previous point: >>> >>> Not necessarily taking sides between "data table" and "register block", >>> but *if* we opt for "data table", then it *must* be fw_cfg. >>> >>>> But if we go this route (i.e. not reuse CPU hotplug interface), >>>> the table alone is not enough, one would need to build a protocol >>>> between ACPI and firmware to communicate what CPUs to (un)hotplug. >>> >>> That's for sure, yes -- for finding out what CPU has been hotplugged, >>> the hotplug SMI handler in the firmware has to look at the register >>> block no matter what. >> >> I thought all that's done by ACPI, with ACPI returning an event >> to the OSPM reporting what happened. > > That works if only the OS needs to care -- the OS can rely on ACPI. > > But with SMM in the picture, the firmware has to care too (the new CPU's > SMBASE has to be relocated, and the SMM data structures need to account > for the new CPU). The firmware cannot rely on any AML generated by QEMU.
To clarify, I mean that the firmware cannot call AML methods, plus the firmware can take a limited amount of parameters when the AML raises the hotplug SMI. Basically everything has to be passed in chipset registers, and due to SEV, those registers had better all be IO ports. >> >>> The "data table" vs "register block" question only arises *afterwards*, >>> for translating the CPU selector (fetched from the register block) to >>> the APIC-ID domain. (The generic edk2 infrastructure requires APIC-IDs). >>> >>> Thanks >>> Laszlo >