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/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to