From: Stefano Stabellini Subject: Re: [RFC] Improving CPU hotplug for 4.3 with qemu-xen Date: Sun, 21 Jul 2013 15:18:42 +0100 Message-ID: References: <51E95A90.9050908@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51E95A90.9050908@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Anthony PERARD Cc: George Dunlap , Stefano Stabellini , Xen Devel List-Id: xen-devel@lists.xenproject.org On Fri, 19 Jul 2013, Anthony PERARD wrote: > Hi, > > The cpu hotplug that have been backported from QEMU to qemu-xen (1.5 to > 1.3) is incomplete. Especially, there is no way to know if a CPU is > already marked as online by qemu. This result by those error messages > from libxl: > > libxl: error: libxl_qmp.c:289:qmp_handle_error_response: received an > error message from QMP server: Unable to add CPU: 0, it already exists > libxl: error: libxl_qmp.c:289:qmp_handle_error_response: received an > error message from QMP server: Unable to add CPU: 1, it already exists > > So I tried to backport more patches so it will become possible for libxl > to get the list of online cpu. > > But this result in *a lot* of patches. > > Here is the git tree and see the list of patches at the end of the mail: > git://xenbits.xen.org/people/aperard/qemu-dm.git backport-cpu-device > > There is still some work to be done like making sure everything is > working properly and making some patches to use it with libxl. > > So George, is it worth getting those patches into Xen 4.3 to get ride of > the error message ? > > > > cpu: Change parent type to Device > qdev: Fold state enum into bool realized > qdev: Prepare "realized" property > cpu: Prepare QOM realizefn > target-i386: Update X86CPU to QOM realizefn > cpu: Introduce cpu_resume(), for single CPU > target-i386: Split out CPU creation and features parsing > cpu: Resume CPU from DeviceClass::realize() if hot-plugged > Revert "xen: Implement hot_add_cpu hook." > Revert "acpi_piix4: Add infrastructure to send CPU hot-plug GPE to guest" > cpu: Introduce CPU hot-plug notifier > cpu: Add helper cpu_exists(), to check if CPU with specified id exists > acpi_piix4: Add infrastructure to send CPU hot-plug GPE to guest > target-i386: Introduce feat2prop() for CPU properties > target-i386: Introduce apic-id CPU property > target-i386: Do not allow to set apic-id once CPU is realized > target-i386: Replace MSI_SPACE_SIZE with APIC_SPACE_SIZE > qapi/qmp-registry.c: Include headers it needs > qga/channel-posix.c: Include headers it needs > user: Move *-user/qemu-types.h to main directory > user: Rename qemu-types.h to qemu-user-types.h > Create qemu-types.h for struct typedefs > qlist.h: Do not include qemu-common.h > sysbus: make SysBusDeviceClass::init optional > target-i386: Introduce ICC bus/device/bridge > target-i386: Attach ICC bus to CPU on its creation > a fix for cpu_x86_create > fix machine initialization. These two commits worry me. I have a vague recollection that we hit both issues at some point in the past and we fixed them properly. I would rather have the proper fix than these two hacks if it's possible. > extract/unify the constant 0xfee00000 as APIC_DEFAULT_ADDRESS > kvmvapic: Make dependency on sysbus.h explicit > target-i386: Move APIC to ICC bus > pc: Implement QEMUMachine::hot_add_cpu hook