[edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

Laszlo Ersek lersek at redhat.com
Fri Jan 13 10:10:54 UTC 2023


On 1/13/23 10:32, Gerd Hoffmann wrote:
> On Fri, Jan 13, 2023 at 07:03:54AM +0100, Gerd Hoffmann wrote:
>>   Hi,
>>
>>> - QEMU can be configured with other compat properties on the command
>>> line so that "CPU hotplug with SMI" and "CPU hot-unplug with SMI" *not*
>>> be offered to the firmware. Then QEMU will reject hotplug attempts, and
>>> the SMM hotplug code in edk2 will not be triggered by the (virtual)
>>> hardware.
>>
>> Can we have edk2 print instructions for that in the error message?
> 
> This seems to be:
> 
>     qemu -M q35 \
>         -global ICH9-LPC.x-smi-cpu-hotplug=off \
>         -global ICH9-LPC.x-smi-cpu-hotunplug=off

Yes, those are the flags.

> But it appears to not work.

They should work, but they take effect in QEMU, and not in the firmware.
These knobs control what CPU hot(un)plug+SMI features QEMU exposes to
the guest fw, via fw_cfg, then the guest confirms those that it knows,
and even locks the feature set down (IIRC). The same is replayed with an
S3 bootscript snippet during S3 resume.

Then, when you try to use a QMP command with QEMU for hotplugging or
hot-unplugging a CPU (equiv. virsh commands that translate to such QMP
commands), QEMU will allow or reject those commands based on the
firmware's prior confirmation. That is, the knobs don't influence the
firmware's behavior, the firmware just confirms to QEMU whether it can
handle what. This makes it possible to run {old, new} firmware x { old,
new } QEMU.

In particular the firmware makes no further decisions based on whether
QEMU advertized some of these features.

Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#98468): https://edk2.groups.io/g/devel/message/98468
Mute This Topic: https://groups.io/mt/96218818/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list