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

Laszlo Ersek lersek at redhat.com
Thu Jan 12 13:22:53 UTC 2023


On 1/12/23 10:55, Michael Brown wrote:
> On 12/01/2023 08:28, Laszlo Ersek wrote:
>> In QEMU v5.1.0, the CPU hotplug register block misbehaves: the
>> negotiation
>> protocol is (effectively) broken such that it suggests that switching
>> from
>> the legacy interface to the modern interface works, but in reality the
>> switch never happens. The symptom has been witnessed when using TCG
>> acceleration; KVM seems to mask the issue. The issue persists with the
>> following (latest) stable QEMU releases: v5.2.0, v6.2.0, v7.2.0.
>> Currently
>> there is no stable release that addresses the problem.
>>
>> The QEMU bug confuses the Present and Possible counting in function
>> PlatformMaxCpuCountInitialization(), in
>> "OvmfPkg/Library/PlatformInitLib/Platform.c". OVMF ends up with Present=0
>> Possible=1. This in turn further confuses MpInitLib in UefiCpuPkg (hence
>> firmware-time multiprocessing will be broken). Worse, CPU hot(un)plug
>> with
>> SMI will be summarily broken in OvmfPkg/CpuHotplugSmm, which (considering
>> the privilege level of SMM) is not that great.
>>
>> Detect the issue in PlatformMaxCpuCountInitialization(), and print an
>> error message and *hang* if the issue is present.
> 
> Would this mean that OVMF would refuse to start with all current distro
> versions of qemu (when not using KVM), or am I misunderstanding?

Your understanding is correct.

I'm not in a rush to get this merged, but eventually, it should be.

On qemu-devel, I asked for the fix to be applied to all stable branches
starting with v5.*. I'm not sure how far "back" qemu-stable is
maintained though.

Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#98365): https://edk2.groups.io/g/devel/message/98365
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