All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dou Liyang <douly.fnst@cn.fujitsu.com>
To: Alexandre DERUMIER <aderumier@odiso.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	drjones@redhat.com, ehabkost <ehabkost@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	bharata@linux.vnet.ibm.com, Fam Zheng <famz@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [PATCH v7] docs: add cpu-hotplug.txt
Date: Tue, 23 Aug 2016 13:17:01 +0800	[thread overview]
Message-ID: <8342e17b-937d-28c9-8784-a3a6722ed433@cn.fujitsu.com> (raw)
In-Reply-To: <218747645.338872.1471856165532.JavaMail.zimbra@oxygem.tv>

Hi Alexandre,

At 08/22/2016 04:56 PM, Alexandre DERUMIER wrote:
> Hello,
>
> I'm looking to implement cpu hotplug,
>
> and I have a question about cpu flags
>
> currently I have something like
>
> -cpu qemu64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce
> -smp 4,sockets=2,cores=2,maxcpus=4
>
>
> Does I need to define flags like:
>
> -smp 2,sockets=2,cores=2,maxcpus=4
> -device qemu64-x86_64-cpu,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce,id=cpu1,socket-id=1,core-id=1,thread-id=0

I think we don't need to do that.
In my option, just like this:

-device qemu64-x86_64-cpu,id=cpu1,socket-id=1,..

Because QEMU sets the "-cpu" options in MachineState:

   current_machine->cpu_model = cpu_model;

when you add a CPU, QEMU can get the flag from the MachineState.

> ...
>
> ?
>
>
> Another question,
> is -smp mandatory ?  (if I want coldplug all cpus)

it's not mandatory. such as this:

   ./x86_64-softmmu/qemu-system-x86_64 -m 1G /image/fedora.img
   -enable-kvm -monitor stdio

  (qemu) info cpus
   * CPU #0: pc=0xffffffff81060586 (halted) thread_id=4032

the default number of CPUs is 1.

>
> -smp sockets=2,cores=2,maxcpus=4

> -device qemu64-x86_64-cpu,id=cpu1,socket-id=1,core-id=1,thread-id=0
> -device qemu64-x86_64-cpu,id=cpu1,socket-id=1,core-id=2,thread-id=0
> -device qemu64-x86_64-cpu,id=cpu3,socket-id=2,core-id=1,thread-id=0
> -device qemu64-x86_64-cpu,id=cpu4,socket-id=2,core-id=2,thread-id=0
>
> or does I need minimum 1 non unplugable cpu
>
> -smp 1,sockets=2,cores=2,maxcpus=4
> -device qemu64-x86_64-cpu,id=cpu1,socket-id=1,core-id=2,thread-id=0
> -device qemu64-x86_64-cpu,id=cpu3,socket-id=2,core-id=1,thread-id=0
> -device qemu64-x86_64-cpu,id=cpu4,socket-id=2,core-id=2,thread-id=0
>

I think that is better, and the socket-id/core-id/thread-id starts at
index 0

I am new to the community. Please don't mind, and take with a grain of
salt.	

Thanks,
Dou

  reply	other threads:[~2016-08-23  5:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-18  1:50 [Qemu-devel] [PATCH v7] docs: add cpu-hotplug.txt Dou Liyang
2016-08-22  8:56 ` Alexandre DERUMIER
2016-08-23  5:17   ` Dou Liyang [this message]
2016-09-06 20:05     ` Eduardo Habkost
2016-09-07  1:52       ` Dou Liyang
2016-09-09 19:20         ` 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=8342e17b-937d-28c9-8784-a3a6722ed433@cn.fujitsu.com \
    --to=douly.fnst@cn.fujitsu.com \
    --cc=aderumier@odiso.com \
    --cc=armbru@redhat.com \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=drjones@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=famz@redhat.com \
    --cc=imammedo@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.