* MP services reports incorrect number of CPUs under QEMU without KVM
@ 2022-03-05 20:33 nicholasbishop
0 siblings, 0 replies; only message in thread
From: nicholasbishop @ 2022-03-05 20:33 UTC (permalink / raw)
To: devel
[-- Attachment #1: Type: text/plain, Size: 903 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 955 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-05 20:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-05 20:33 MP services reports incorrect number of CPUs under QEMU without KVM nicholasbishop
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox