From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: "Cédric Le Goater" <clg@kaod.org>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
"Bharata B Rao" <bharata@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 6/6] spapr: fix migration of ICP objects from/to older QEMU
Date: Fri, 19 May 2017 16:40:04 +1000 [thread overview]
Message-ID: <20170519064004.GI12284@umbus.fritz.box> (raw)
In-Reply-To: <20170517223344.5bf8ed1f@bahia.lan>
[-- Attachment #1: Type: text/plain, Size: 2970 bytes --]
On Wed, May 17, 2017 at 10:33:44PM +0200, Greg Kurz wrote:
> On Wed, 17 May 2017 14:18:16 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
>
> > On Mon, May 15, 2017 at 06:11:27PM +0200, Cédric Le Goater wrote:
> > > >>> + int smt = kvmppc_smt_threads();
> > > >>> + int nr_servers = DIV_ROUND_UP(max_cpus * smt, smp_threads);
> > > >>
> > > >> may be we should reintroduce nr_servers at the machine level ?
> > > >>
> > > >
> > > > I had reintroduced it but then I realized it was only used in this
> > > > function.
> > >
> > > nr_servers is also used when the device tree is populated with the
> > > interrupt controller nodes. No big deal.
> >
> > Which is guest visible, so we should really make that stay the same
> > for older machine types. I'd like to avoid re-introducing nr_servers
> > as a property if we can, but maybe we can't.
> >
>
> Yes we can :) or at least maybe, if you can shed light on a guest
> visible change introduced by this commit in 2.8:
>
> commit 9b9a19080a6e548b91420ce7925f2ac81ef63ae8
> Author: David Gibson <david@gibson.dropbear.id.au>
> Date: Thu Oct 20 16:07:56 2016 +1100
>
> pseries: Move construction of /interrupt-controller fdt node
>
>
> It changes the "ibm,interrupt-server-ranges" property in the device
> tree from
>
> {0, cpu_to_be32(max_cpus)}
>
> to
>
> {0, cpu_to_be32(xics->nr_servers)}
>
> ie, {0, cpu_to_be32(DIV_ROUND_UP(max_cpus * smt, smp_threads))}
>
> And indeed, if I start QEMU with
>
> -smp cores=2,threads=4,maxcpus=16 -machine type=pseries-2.7,accel=kvm
>
> the following is exposed to the guest with 2.7:
>
> ibm,interrupt-server-ranges
> 00000000 00000010
>
> and with 2.8 we get:
>
> ibm,interrupt-server-ranges
> 00000000 00000020
>
> LoPAPR B.6.9.1.1 says that the range (ie, the second number) "shall be the
> number of contiguous server#s supported by the unit (this also corresponds
> to the number of “reg” entries)". I'm inclined to think this maps to max_cpus
> but I may be wrong... any clues ?
So, yes, it's a guest visible change in some configurations, but in
those configurations the previous behaviour was sufficiently broken
that I think that's preferable to not changing it.
Basically the ibm,interrupt-server-ranges property gives the total
range of valid server IDs. The server IDs assigned to each thread are
based on the dt_id, and are spaced by the number of host threads, not
the number of guest threads. That means that with 2.7, the last cpus
would have advertised ibm,ppc-interrupt-server#s properties with
values outside the range given by ibm,interrupt-server-ranages, which
is definitely wrong.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-05-19 6:40 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 11:38 [Qemu-devel] [PATCH 0/6] spapr/xics: fix migration of older machine types Greg Kurz
2017-05-15 11:39 ` [Qemu-devel] [PATCH 1/6] ppc/xics: simplify prototype of xics_spapr_init() Greg Kurz
2017-05-15 12:09 ` Cédric Le Goater
2017-05-15 13:36 ` Philippe Mathieu-Daudé
2017-05-16 4:30 ` David Gibson
2017-05-15 11:39 ` [Qemu-devel] [PATCH 2/6] spapr: fix error path of required kernel-irqchip Greg Kurz
2017-05-15 11:47 ` Cédric Le Goater
2017-05-16 4:35 ` David Gibson
2017-05-16 5:56 ` Greg Kurz
2017-05-16 6:08 ` David Gibson
2017-05-16 6:22 ` Greg Kurz
2017-05-15 11:39 ` [Qemu-devel] [PATCH 3/6] spapr: fix error reporting in xics_system_init() Greg Kurz
2017-05-15 11:48 ` Cédric Le Goater
2017-05-16 4:37 ` David Gibson
2017-05-15 11:39 ` [Qemu-devel] [PATCH 4/6] spapr: sanitize error handling in spapr_ics_create() Greg Kurz
2017-05-15 11:59 ` Cédric Le Goater
2017-05-15 12:06 ` Greg Kurz
2017-05-16 4:39 ` David Gibson
2017-05-16 4:39 ` David Gibson
2017-05-15 11:39 ` [Qemu-devel] [PATCH 5/6] spapr-cpu-core: release ICP object when realization fails Greg Kurz
2017-05-15 12:02 ` Cédric Le Goater
2017-05-15 12:17 ` Greg Kurz
2017-05-16 4:41 ` David Gibson
2017-05-15 11:40 ` [Qemu-devel] [PATCH 6/6] spapr: fix migration of ICP objects from/to older QEMU Greg Kurz
2017-05-15 12:22 ` Cédric Le Goater
2017-05-15 13:16 ` Greg Kurz
2017-05-15 16:09 ` Cédric Le Goater
2017-05-15 16:20 ` Greg Kurz
2017-05-17 4:17 ` David Gibson
2017-05-15 16:11 ` Cédric Le Goater
2017-05-15 16:22 ` Greg Kurz
2017-05-17 4:18 ` David Gibson
2017-05-17 20:33 ` Greg Kurz
2017-05-19 6:40 ` David Gibson [this message]
2017-05-17 4:16 ` David Gibson
2017-05-17 4:14 ` David Gibson
2017-05-16 9:53 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-05-15 12:13 ` [Qemu-devel] [PATCH 0/6] spapr/xics: fix migration of older machine types no-reply
2017-05-15 12:19 ` Greg Kurz
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=20170519064004.GI12284@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=bharata@linux.vnet.ibm.com \
--cc=clg@kaod.org \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.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).