qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: jjherne@linux.vnet.ibm.com
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	Alexander Graf <agraf@suse.de>,
	qemu-devel <qemu-devel@nongnu.org>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Jens Freimann <jfrei@linux.vnet.ibm.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [RFC/PATCH 0/1] cpu hotplug for s390
Date: Fri, 03 May 2013 16:22:35 +0200	[thread overview]
Message-ID: <5183C82B.9000306@suse.de> (raw)
In-Reply-To: <5183C0BA.9010403@linux.vnet.ibm.com>

Hi,

Am 03.05.2013 15:50, schrieb Jason J. Herne:
> I've done some investigating into using the device_add hmp/qmp command
> to support hot-plugging cpus on S390.  The alternative suggestion was to
> simply use a new cpu_add hmp/qmp command.

A cpu-add QMP command has been merged by now. Using it with
qemu-system-s390x machines will return a QMP error at the moment.

> device_add accepts all of the same options as the -device command line
> parameter takes.  This would imply that to hot-plug cpu's using device
> add we would need to allow command line arguments of type "-device cpu".

In theory we do, ever since making the CPU a device, it just didn't
fully work yet. For all QOM'ified CPUs (i.e., not x86) it should work
crash-free now, but it's untested whether a particular machine copes
with it or not.

>  All of the implications of this are not currently clear to me.  How
> would this interact with the -smp option, for example, how many cpus are
> created in this case:
>     qemu -smp 2 -device cpu,id=cpu0 -device cpu,id=cpu1, -device
> cpu,id=cpu2

Four, if the correct driver is supplied (error for the above).
The -smp option indicates how many CPUs the *machine* instantiates.
In addition you are trying to create two further devices, just like
other machines create a PCI host bridge and a user might try to add
another one.

> Is -smp invalid when cpu devices are specified?  We would have to fill
> the smp_cpus variable after all (cpu) devices have been parsed.

Would we? If so, doing some check of -smp maxcpus and/or updating
whatever variable in CPU's realizefn feels more natural to me than some
post-whatever hook.

> Since device_add requires a QOM object name (driver parameter) we
> seem to have
> two choices.
>     1. device_add cpu
>     2. device_add s390-cpu
> But "cpu" is actually an abstract QOM class and cannot be instantiated
> by object_new("cpu") as is done in device_add processing.  So we need to
> use "s390-cpu".  This adds an architecture specific flavor to cpu
> hotplug. I would think we'd want to avoid that somehow.  perhaps we
> simply "translate" that parameter during early device_add processing?

You are saying that based on the current s390 code. Actually it was
discussed that s390-cpu should be abstract as well and the type should
indicate the actual model - host-s390-cpu, z9-s390-cpu, etc. There were
two KVM calls that covered future structure of CPU modelling (socket ->
core -> thread) and roadmap towards vCPU hotplug - see the minutes on
the list.

The current approach of cpu-add for 1.5 was chosen because the
refactoring of CPUArchState is rather cumbersome and taking too long.

> Another issue is that the s390-cpu QOM object class is a child of
> "main-system-bus". [...]

That's not true, it is not on any bus at all - I have attempted to fix
device_add for this use case and Igor has just sent a patch for unplug.

For x86 we have chosen to introduce the ICC bus to handle hot-adding
APIC devices (which were on SysBus before) alongside the CPU. With
proper CPU modelling that would not be necessary, but for now it has the
advantage of giving us a canonical QOM path to the CPUs for free.

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  parent reply	other threads:[~2013-05-03 14:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-03 13:50 [Qemu-devel] [RFC/PATCH 0/1] cpu hotplug for s390 Jason J. Herne
2013-05-03 14:13 ` Igor Mammedov
2013-05-03 14:22 ` Andreas Färber [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-04-03  6:42 Jens Freimann
2013-04-17 18:06 ` Andreas Färber
2013-04-17 18:14   ` Eduardo Habkost
2013-04-19  7:51   ` Jens Freimann
2013-04-19 13:16     ` Andreas Färber
2013-04-19 14:28       ` Igor Mammedov
2013-04-19 19:13       ` Christian Borntraeger
2013-04-19 19:58         ` Eduardo Habkost

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=5183C82B.9000306@suse.de \
    --to=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=jjherne@linux.vnet.ibm.com \
    --cc=qemu-devel@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).