From: nicholasbishop@gmail.com
To: devel@edk2.groups.io
Subject: MP services reports incorrect number of CPUs under QEMU without KVM
Date: Sat, 05 Mar 2022 12:33:17 -0800 [thread overview]
Message-ID: <CtNY.1646512397746313138.fAF7@groups.io> (raw)
[-- 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 --]
reply other threads:[~2022-03-05 20:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CtNY.1646512397746313138.fAF7@groups.io \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox