From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKmyb-0004lr-4r for qemu-devel@nongnu.org; Tue, 04 Mar 2014 05:53:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKmyT-0006rZ-HI for qemu-devel@nongnu.org; Tue, 04 Mar 2014 05:53:33 -0500 Received: from [222.73.24.84] (port=16240 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKmyS-0006m9-TT for qemu-devel@nongnu.org; Tue, 04 Mar 2014 05:53:25 -0500 From: Chen Fan Date: Tue, 4 Mar 2014 18:50:23 +0800 Message-Id: In-Reply-To: <1393552916.7774.17.camel@G08FNSTD131468> References: <1393552916.7774.17.camel@G08FNSTD131468> Subject: [Qemu-devel] [RFC v2 0/2] prebuild cpu QOM tree /machine/node/socket/core/thread/.. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: chen.fan.fnst@cn.fujitsu.com, qemu-devel@nongnu.org Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Eduardo Habkost at present, after hotplug a discontinuous cpu id on source, then done migration, on target, it will fail to add the unoccupied cpu id which was skipped at source, this cause is on target Qemu prebuild CPU with continuous cpu_index. so after migration, the cpu infrastructure bewteen source and target are different. I suppose we could use apic_id as instance_id which was used at registering vmstate when create cpu. on target, we prebuild the specified cpu using QOM comand line: /machine/node/socket/core/thread, then migration, we could keep the same cpu infrastructure on both side. at first, I introduce a empty QOM tree /machine/node/socket/core/thread/, then when create cpu, link each created cpu into the tree. which idea was suggested by Igor. thanks. TODO: 1. add cpu "path" property which used for specifying the QOM path. 2. add -device cpu-foo.path supported. 3. then we could introduce hot-remove cpu probably. I don't know wether this way is right or not. pls tell me. :) Chen Fan (2): i386: introduce "struct X86TopoInfo" for saving cpu topology information i386: introduce cpu QOM hierarchy tree hw/i386/pc.c | 19 ++++-- target-i386/Makefile.objs | 2 +- target-i386/cpu-qom.h | 1 + target-i386/cpu-topology.c | 163 +++++++++++++++++++++++++++++++++++++++++++++ target-i386/cpu-topology.h | 71 ++++++++++++++++++++ target-i386/cpu.c | 45 +++++++++++++ target-i386/cpu.h | 6 ++ target-i386/topology.h | 7 ++ 8 files changed, 308 insertions(+), 6 deletions(-) create mode 100644 target-i386/cpu-topology.c create mode 100644 target-i386/cpu-topology.h -- 1.8.1.4