From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhS3L-0000Zi-FB for qemu-devel@nongnu.org; Tue, 06 Sep 2016 21:53:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhS3F-0005yk-FI for qemu-devel@nongnu.org; Tue, 06 Sep 2016 21:53:26 -0400 Received: from [59.151.112.132] (port=28166 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhS3E-0005wU-Pm for qemu-devel@nongnu.org; Tue, 06 Sep 2016 21:53:21 -0400 References: <1471485050-26747-1-git-send-email-douly.fnst@cn.fujitsu.com> <218747645.338872.1471856165532.JavaMail.zimbra@oxygem.tv> <8342e17b-937d-28c9-8784-a3a6722ed433@cn.fujitsu.com> <20160906200518.GE24695@thinpad.lan.raisama.net> From: Dou Liyang Message-ID: <90ccb629-15b4-784c-f14b-cdfda6f08047@cn.fujitsu.com> Date: Wed, 7 Sep 2016 09:52:59 +0800 MIME-Version: 1.0 In-Reply-To: <20160906200518.GE24695@thinpad.lan.raisama.net> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7] docs: add cpu-hotplug.txt List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Alexandre DERUMIER , qemu-devel , drjones@redhat.com, Markus Armbruster , bharata@linux.vnet.ibm.com, Fam Zheng , Igor Mammedov , david@gibson.dropbear.id.au Hi, Eduardo At 09/07/2016 04:05 AM, Eduardo Habkost wrote: > On Tue, Aug 23, 2016 at 01:17:01PM +0800, Dou Liyang wrote: >> 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. > > You don't need to repeat the flags, but that's not because of > MachineState::cpu_model, but because of the semantics of -smp: Sorry for the reply. > > The option: > -smp MODEL,+FOO,+BAR I guess you may mean "-cpu", not "-smp" > is internally translated to: > -global MODEL.FOO=on > -global MODEL.BAR=on > in addition to setting the CPU model for creating initial CPUs to > MODEL. > I see. >> >>> ... >>> >>> ? >>> >>> >>> 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 > > As mentioned above, the default number of CPUs is 1, so "-smp > sockets=2" is the same as "-smp 1,sockets=2". > > I assume you mean something like "-smp 0", but that doesn't work > today. I would like to eventually allow all CPUs to be created > using -device, but that's not possible yet. I am interested in what is the benefit, if we can create all CPUs using -device. :) Thanks, Dou > >>> >>> -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 >> >> >