qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v2 0/7] coordinate cpu hotplug/unplug bewtee


From: li guang
Subject: Re: [Qemu-devel] [PATCH RFC v2 0/7] coordinate cpu hotplug/unplug bewteen QEMU and kernel by EC
Date: Thu, 06 Jun 2013 16:58:45 +0800

在 2013-06-06四的 10:48 +0200,Igor Mammedov写道:
> On Thu, 6 Jun 2013 11:13:29 +0300
> "Michael S. Tsirkin" <address@hidden> wrote:
> 
> > On Thu, Jun 06, 2013 at 11:16:53AM +0800, liguang wrote:
> > > v2: 
> > > 1.remove PIIX4_PROC_BASE operations for cpu hotplug
> > > 2.fix wrong description fo cpu-del
> > > 
> > > patch 1 adds ACPI Embedded Controller (EC),
> > > refer-to:
> > > ACPI SPEC v5 chapter 12
> > > "ACPI Embedded Controller Interface Specification"
> > > 
> > > 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
> > > 
> > > 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.
> > 
> > So, it's another channel to the guest.
> > Can't qemu-ga do this in userspace, using the existing channel?
> I believe it does.
> Trying to handle 1 guest OS specific concept by introducing
> extra hardware and a new new linux driver to just online CPUs,
> doesn't look righ.
> Guest already gets a cpu hot-add notification and acts on it
> by creating sysfs entry that can be used for onlining it. So
> guest knows that CPU has been hotplugged and even notifies
> userspace via UDEV about event. So why extra channel is needed
> for event that was already delivered and handled.

actually, there's a case in my hand to do cpu online automatically
by udev, it works well.
I still can't figure out why kernel did not do cpu online directly
just like the cpu ejection.
I don't have strong opinion to do cpu online in kernel space,
but I think do it in user-space either by hand or script or
program just not natural, that it to say, obviously cpu online
is part of cpu hotplug conceptually, we'd better do the these
actions together, but separate them.

> 
> One can use UDEV to perform automatic online task or qemu-ga
> to make process less straightforward, or alternatively extend
> the current ACPI CPU hotplug in kernel to support automatic
> CPU onlining.
> 
> 
> > 
> > > 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.
> > > 
> > > these RFC patches are sent for demo what I am trying to do.
> > > 
> > > the design process simply like following:
> > > 
> > > hotplug
> > > qemu::ec::sci -> kernel::ec::gpe::notifier->
> > > kernel::cpu_physic_hotplug::handler->kernel::cpu_up
> > > 
> > > unplug
> > > kernel::cpu_down::kernel::cpu_physic_hotplug::handler->
> > > kernel::ec::ec_write->qemu::ec::->qemu::cpu-unplug
> > > 
> > > sorry, I should poll cpu-unplug cmd sent from kernel,
> > > but, it's a little trivial, I want do it later.
> > > 
> > > for kernel patches:
> > > http://comments.gmane.org/gmane.linux.kernel/1503460
> > > 
> > > 
> > > 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
> > > 
> > > 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
> > 
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]