From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Xen Devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 3/4] Update vcpu hotplug logic
Date: Fri, 31 May 2013 17:16:10 -0400 [thread overview]
Message-ID: <20130531211610.GC5362@phenom.dumpdata.com> (raw)
In-Reply-To: <1370017993-13437-4-git-send-email-anthony.perard@citrix.com>
On Fri, May 31, 2013 at 05:33:12PM +0100, Anthony PERARD wrote:
> From: Ian Jackson <ian.jackson@eu.citrix.com>
>
> Add vcpu online/offline check to avoid redundant SCI interrupt.
>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
>
> Port from qemu-xen-traditionnal to qemu-xen.
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
.. some notes below.
> ---
> hw/acpi_piix4.c | 25 +++++++++++++++++++------
> 1 file changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
> index bc7b454..49c38d3 100644
> --- a/hw/acpi_piix4.c
> +++ b/hw/acpi_piix4.c
> @@ -706,16 +706,24 @@ static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev,
> return 0;
> }
>
> -static void enable_processor(PIIX4PMState *g, int cpu)
> +static int enable_processor(PIIX4PMState *g, int cpu)
> {
> + if (g->cpus_sts[cpu/8] & (1 << (cpu%8)))
> + return 0;
Don't know if the styleguide in QEME is at this point, but I thought
that it was suppose to have space between the "/" and "%", so you have:
if (g->cpus_sts[cpu / 8] & (1 << (cpu % 8)))
?
> +
> g->ar.gpe.sts[0] |= 4;
> g->cpus_sts[cpu/8] |= (1 << (cpu%8));
> + return 1;
> }
>
> -static void disable_processor(PIIX4PMState *g, int cpu)
> +static int disable_processor(PIIX4PMState *g, int cpu)
> {
> + if (!(g->cpus_sts[cpu/8] & (1 << (cpu%8))))
> + return 0;
> +
> g->ar.gpe.sts[0] |= 4;
> g->cpus_sts[cpu/8] &= ~(1 << (cpu%8));
> + return 1;
> }
>
> void qemu_cpu_add_remove(int cpu, int state)
> @@ -725,10 +733,15 @@ void qemu_cpu_add_remove(int cpu, int state)
> return;
> }
>
> - if (state)
> - enable_processor(acpi_state, cpu);
> - else
> - disable_processor(acpi_state, cpu);
> + if (state) {
> + if (!enable_processor(acpi_state, cpu)) {
> + return;
> + }
> + } else {
> + if (!disable_processor(acpi_state, cpu)) {
> + return;
> + }
> + }
>
> pm_update_sci(acpi_state);
> }
> --
> Anthony PERARD
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
next prev parent reply other threads:[~2013-05-31 21:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-31 16:33 [PATCH 0/4] CPU hotplug port from qemu-traditionnal to qemu-xen for 4.3 Anthony PERARD
2013-05-31 16:33 ` [PATCH 1/4] HVM vcpu add/remove: qemu logic for vcpu add/revmoe Anthony PERARD
2013-05-31 21:19 ` Konrad Rzeszutek Wilk
2013-06-03 10:23 ` Stefano Stabellini
2013-05-31 16:33 ` [PATCH 2/4] Fix vcpu hotplug bug: get correct vcpu_avail bitmap Anthony PERARD
2013-05-31 16:33 ` [PATCH 3/4] Update vcpu hotplug logic Anthony PERARD
2013-05-31 21:16 ` Konrad Rzeszutek Wilk [this message]
2013-05-31 16:33 ` [PATCH 4/4] Implement 'xm vcpu-set' command for HVM guest Anthony PERARD
2013-05-31 21:14 ` Konrad Rzeszutek Wilk
2013-06-03 8:40 ` Ian Campbell
2013-06-03 10:24 ` Stefano Stabellini
2013-05-31 16:39 ` [PATCH] libxl: Use -vcpu_avail with qemu-xen Anthony PERARD
2013-06-03 8:37 ` Ian Campbell
2013-06-03 10:10 ` Stefano Stabellini
2013-06-03 13:49 ` Anthony PERARD
2013-05-31 17:20 ` [PATCH 0/4] CPU hotplug port from qemu-traditionnal to qemu-xen for 4.3 Anthony PERARD
2013-06-03 8:37 ` Ian Campbell
[not found] ` <51A8DA91.1080601@citrix.com>
2013-05-31 21:16 ` Konrad Rzeszutek Wilk
2013-06-03 8:41 ` Ian Campbell
2013-06-03 11:12 ` Anthony PERARD
2013-06-03 10:13 ` Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130531211610.GC5362@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=anthony.perard@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jinsong.liu@intel.com \
--cc=stefano.stabellini@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.