[edk2-devel] MP services reports incorrect number of CPUs under QEMU without KVM

nicholasbishop at gmail.com nicholasbishop at gmail.com
Sat Mar 5 20:33:17 UTC 2022


When using EFI_MP_SERVICES_PROTOCOL.GetNumberOfProcessors to get the number of processors, I've found that when running in QEMU I only get the correct value if KVM is enabled. If KVM is disabled, the number of processors is always reported as 1.

With debug logging enabled, I noticed a difference in the output from MaxCpuCountInitialization.

With `-enable-kvm -smp 4` it logs this:
MaxCpuCountInitialization: BootCpuCount=4 mMaxCpuCount=4

But with just `-smp 4`, it logs this:
MaxCpuCountInitialization: QEMU v2.7 reset bug: BootCpuCount=4 Present=0
MaxCpuCountInitialization: BootCpuCount=0 mMaxCpuCount=1

I'm not sure if this indicates a bug in QEMU or OVMF. Incidentally the "QEMU v2.7" is hardcoded in OvmfPkg/PlatformPei/Platform.c, I'm actually testing under QEMU 6.1.0.

Test code: https://github.com/nicholasbishop/edk2/blob/af920578e822cdeef0204e39df560f4a1f4bb537/Bug/Bug.c


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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20220305/b87b0ec1/attachment-0001.htm>


More information about the edk2-devel-archive mailing list