qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Godmar Back <gback@cs.vt.edu>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"seabios @ seabios . org" <seabios@seabios.org>,
	qemu-devel@nongnu.org, qemu-discuss@nongnu.org,
	Ani Sinha <ani@anisinha.ca>
Subject: Re: MP tables do not report multiple CPUs in Qemu 6.2.0 on x86 when given -smp cpus=n flag
Date: Thu, 20 Jan 2022 09:57:39 +0100	[thread overview]
Message-ID: <20220120095739.23930e8f@redhat.com> (raw)
In-Reply-To: <CAFEAcA9tGnEOOhSbCJv2=JoU5C3cFB08mdaLRERgzPdatKQB=g@mail.gmail.com>

On Wed, 19 Jan 2022 15:48:20 +0000
Peter Maydell <peter.maydell@linaro.org> wrote:

> On Wed, 19 Jan 2022 at 14:44, Godmar Back <gback@cs.vt.edu> wrote:
> > after upgrading to 6.2.0, I observed that code such as MIT's xv6 (see
> > [1]) is no longer able to detect multiple CPUs.  Their code works in
> > 6.1.1, however.  
> 
> Hi; this isn't a great place for reporting QEMU bugs, because
> it's more of a user-to-user discussion list. Not all QEMU
> developers read it. I've cc'd the ACPI maintainers, who
> hopefully may have an idea about what's happening here.
> You could also file a bug at
> https://gitlab.com/qemu-project/qemu/-/issues
> 
> > I built 6.1.1 from source and 6.2.0 from source and I have also tested
> > with CentOS stream's 6.1.1 qemu-kvm and was able to pinpoint this
> > change to these 2 versions of qemu. I am using qemu-system-i386
> > specifically.
> >
> > I tried to go through the ChangeLog to see if the `-smp` option was
> > deprecated or changed.  I found this note [2] about invalid topologies
> > having been removed in 5.2. Here's what I found after long
> > experimentation:
> >
> > The legacy MP tables appear to work only if you specify the longform
> > `-smp cpus=4,cores=1,threads=1,sockets=4` in 6.2.0.  If you specify
> > `-smp 4` or `-smp cpus=4` it will not work in 6.2.0 (it worked in
> > 6.1.1). I am guessing that perhaps the MP tables add entries for each
> > socket, but that perhaps the behavior of the shortcuts `-smp n` and
> > `-smp cpus=n` was changed to influence the number of cores rather than
> > sockets.
> >
> > In other words, `-smp cpus=n` now means `-smp
> > cpus=n,cores=n,threads=1,sockets=1` whereas in 6.1.1 and before it
> > meant `-smp cpus=n,cores=1,threads=1,sockets=n`. I note that
> > specifying `-smp cpus=4,cores=4,threads=1,sockets=1` in 6.1.1 also
> > does not create 4 entries in the legacy MP tables.



Thanks for reporting issue in such a detailed way.

QEMU doesn't generate legacy MP tables and as reported
the above issue is still present in earlier versions when
cores are used.
Well seabios has a comment:
         /* Only populate the MPS tables with the first logical CPU in            
           each package */
So I'd guess it has never worked for anything but sockets.
With QEMU starting to prefer cores over sockets by default
I'd suggest to either
  * explicitly provide desired topology (i.e. sockets)
  * use older machine type which still preffers sockets by default
    (ex: up to 6.1 machine types)

If anybody cares about legacy tables + cores/threads usecase,
I suggest to investigate what can be done on SeaBIOS side which
generates MP tables (assuming if anything could be done at all).
CCing SeaBIOS mail-list.

> > Can someone confirm/deny this?  If so, it's a breaking change that
> > perhaps could be mentioned in the Changelog to save others the time
> > when they upgrade. Affected educational OS include MIT's xv6 and
> > Stanford's pintos OS.

Legacy MP table is not actively maintained part of the code,
hence it's configuration which is not tested.
However if someone is interested in maintaining this, one
should contribute at least a testcase that will warn developers
early if usecase is broken. We can't promise not breaking it
ever but at least we would be able to document any breaking
changes in release notes.

> > Thanks for all the work you do on qemu!
> >
> >  - Godmar
> >
> > [1] https://github.com/mit-pdos/xv6-public/blob/eeb7b415dbcb12cc362d0783e41c3d1f44066b17/mp.c
> > [2] https://qemu-project.gitlab.io/qemu/about/removed-features.html#smp-invalid-topologies-removed-in-5-2
> >
> > (I'm typing this email in gmail using the plaintext setting, hopefully
> > it'll preserve line breaks.)  
> 
> thanks
> -- PMM
> 



       reply	other threads:[~2022-01-20  9:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAB4+JY+3N5qvC3p_e2DWWa=-QUtW+wH5ZdEJFPKTdSD5TVPXMA@mail.gmail.com>
     [not found] ` <CAFEAcA9tGnEOOhSbCJv2=JoU5C3cFB08mdaLRERgzPdatKQB=g@mail.gmail.com>
2022-01-20  8:57   ` Igor Mammedov [this message]
     [not found]   ` <alpine.DEB.2.22.394.2201201305580.844042@anisinha-lenovo>
2022-01-20 10:02     ` MP tables do not report multiple CPUs in Qemu 6.2.0 on x86 when given -smp cpus=n flag Ani Sinha
2022-01-20 10:08       ` Ani Sinha
2022-01-20 11:41         ` Daniel P. Berrangé
2022-01-20 14:31           ` Godmar Back

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-all 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=20220120095739.23930e8f@redhat.com \
    --to=imammedo@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=gback@cs.vt.edu \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-discuss@nongnu.org \
    --cc=seabios@seabios.org \
    /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;
as well as URLs for NNTP newsgroup(s).