From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uos0s-0001q7-Ot for qemu-devel@nongnu.org; Tue, 18 Jun 2013 05:15:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uos0n-0004ew-Ka for qemu-devel@nongnu.org; Tue, 18 Jun 2013 05:15:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uos0n-0004eo-CT for qemu-devel@nongnu.org; Tue, 18 Jun 2013 05:15:37 -0400 Date: Tue, 18 Jun 2013 11:14:18 +0200 From: Igor Mammedov Message-ID: <20130618111418.3915d054@thinkpad> In-Reply-To: <1371523635.31705.35.camel@liguang.fnst.cn.fujitsu.com> References: <1370488621-6915-1-git-send-email-lig.fnst@cn.fujitsu.com> <20130606081329.GA5756@redhat.com> <1370507601.17798.106.camel@liguang.fnst.cn.fujitsu.com> <1371523635.31705.35.camel@liguang.fnst.cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC v2 0/7] coordinate cpu hotplug/unplug bewteen QEMU and kernel by EC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: li guang Cc: Kevin Wolf , Alexander Graf , Anthony Liguori , Stefan Berger , "Michael S. Tsirkin" , Markus Armbruster , qemu-devel@nongnu.org, Joel Schopp , Gerd Hoffmann , Andreas =?ISO-8859-1?B?RuRyYmVy?= , Paolo Bonzini , Luiz Capitulino , Laszlo Ersek , Christian Borntraeger , Isaku Yamahata On Tue, 18 Jun 2013 10:47:15 +0800 li guang wrote: > Hi, Igor and Micheal >=20 > =E5=9C=A8 2013-06-06=E5=9B=9B=E7=9A=84 16:33 +0800=EF=BC=8Cli guang=E5=86= =99=E9=81=93=EF=BC=9A > > =E5=9C=A8 2013-06-06=E5=9B=9B=E7=9A=84 11:13 +0300=EF=BC=8CMichael S. T= sirkin=E5=86=99=E9=81=93=EF=BC=9A > > > On Thu, Jun 06, 2013 at 11:16:53AM +0800, liguang wrote: > > > > v2:=20 > > > > 1.remove PIIX4_PROC_BASE operations for cpu hotplug > > > > 2.fix wrong description fo cpu-del > > > >=20 > > > > patch 1 adds ACPI Embedded Controller (EC), > > > > refer-to: > > > > ACPI SPEC v5 chapter 12 > > > > "ACPI Embedded Controller Interface Specification" > > > >=20 > > > > EC is a standard ACPI device, it plays flexible roles, > > > > especially be event carrier, it can pass events between platform > > > > and OS, so OS can execute _Qxx method which defined > > > > by yourself and query EC's ACPI space which can be a buffer for > > > > many purposes > > > >=20 > > > > here, I want to deliver CPU online/offline event between > > > > OS and QEMU for CPU hotplug feature, then we will don't > > > > need to "echo 1 > /sys/devices/system/cpu/cpu1/online" > > > > again after 'cpu-add' and also for offline to do real cpu > > > > removal. > > >=20 > > > So, it's another channel to the guest. > > > Can't qemu-ga do this in userspace, using the existing channel? > >=20 > > Sorry, I'm not familiar with qemu-ga, > > anyway, maybe we don't want to do things like > > 'exec("echo 1 > /sys/devices/system/cpu/cpu1/online")' > > in userspace. > >=20 > > BTW, Michael, > > do you think if we use EC space to pass info between > > platform(QEMU) and OS(PM) instead of 'PIIX4_PROC_BASE' and > > something like it can bring some convenience? > > for we can directly operate on EC space, we don't have to > > register memory regions and ops for them any more, and also, > > these regions are mostly not exist in real platforms, > > this a motivation that I add this device. > >=20 >=20 > does this approach have some benefit? Replacing CPUs bitmap with a select window as it's done in this series could be done in PIIX4 in similar manner and would be much simpler than introducing whole new device. That however would require introducing locking in bios's ACPI code to avoid concurrent handler execution which is not needed in case of bitmap. >=20 > > >=20 > > > > what I am trying to do is emulated physical addition/removal > > > > (like described by linux kernel document for cpu hotplug -- > > > > linux-2.6/Documentation/cpu-hotplug.txt) for QEMU. > > > >=20 > > > > these RFC patches are sent for demo what I am trying to do. > > > >=20 > > > > the design process simply like following: > > > >=20 > > > > hotplug > > > > qemu::ec::sci -> kernel::ec::gpe::notifier-> > > > > kernel::cpu_physic_hotplug::handler->kernel::cpu_up > > > >=20 > > > > unplug > > > > kernel::cpu_down::kernel::cpu_physic_hotplug::handler-> > > > > kernel::ec::ec_write->qemu::ec::->qemu::cpu-unplug > > > >=20 > > > > sorry, I should poll cpu-unplug cmd sent from kernel, > > > > but, it's a little trivial, I want do it later. > > > >=20 > > > > for kernel patches: > > > > http://comments.gmane.org/gmane.linux.kernel/1503460 > > > >=20 > > > >=20 > > > > Li Guang (8) > > > > acpi: add ACPI Embedded Controller support > > > > ich9: add notifer for ec to generate sci > > > > ec: add operations for _Qxx events > > > > piix4: add notifer for ec to generate sci > > > > piix4: add events for cpu hotplug > > > > qmp: add 'cpu-del' command > > > > pc: add EC qdev init for piix & q35 > > > > cpu-hotplug: remove memory regison for cpu hotplug > > > >=20 > > > > default-configs/x86_64-softmmu.mak | 1 + > > > > hw/acpi/Makefile.objs | 1 + > > > > hw/acpi/ec.c | 225 ++++++++++++++++++++++++++= ++++++++++ > > > > hw/acpi/ich9.c | 15 +++++++++++++++ > > > > hw/acpi/piix4.c | 68 ++++++++++++++ > > > > hw/i386/pc.c | 46 ++++++++++++++++++++++++++= ++-- > > > > hw/i386/pc_piix.c | 7 + > > > > hw/i386/pc_q35.c | 6 + > > > > include/hw/acpi/ec.h | 44 ++++++ > > > > include/hw/acpi/ich9.h | 1 + > > > > include/hw/boards.h | 5 +++-- > > > > include/hw/i386/pc.h | 1 + > > > > qapi-schema.json | 13 +++++++++++++ > > > > qmp-commands.hx | 23 +++++++++++++++++++++++ > > > > qmp.c | 9 +++++++++ > > > > 15 files changed, 411 insertions(+), 54 deletions(-) > > > > create mode 100644 hw/acpi/ec.c > > > > create mode 100644 include/hw/acpi/ec.h > >=20 > >=20 > >=20 >=20 >=20 >=20 --=20 Regards, Igor