Received: from eggs.gnu.org ([2001:4830:134:3::10]:57564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGoR1-0001Pl-Rh for qemu-devel@nongnu.org; Thu, 29 Jan 2015 07:43:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGoQx-0005lW-6p for qemu-devel@nongnu.org; Thu, 29 Jan 2015 07:42:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGoQw-0005lS-Vo for qemu-devel@nongnu.org; Thu, 29 Jan 2015 07:42:55 -0500 Date: Thu, 29 Jan 2015 13:42:44 +0100 From: Igor Mammedov Message-ID: <20150129134244.7835ad89@nial.brq.redhat.com> In-Reply-To: <1420679180-14883-4-git-send-email-tangchen@cn.fujitsu.com> References: <1420679180-14883-1-git-send-email-tangchen@cn.fujitsu.com> <1420679180-14883-4-git-send-email-tangchen@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RESEND PATCH v1 03/13] acpi, mem-hotplug: Add acpi_memory_hotplug_sci() to rise sci for memory hotplug. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tang Chen Cc: zhugh.fnst@cn.fujitsu.com, mst@redhat.com, hutao@cn.fujitsu.com, qemu-devel@nongnu.org, isimatu.yasuaki@jp.fujitsu.com, guz.fnst@cn.fujitsu.com, pbonzini@redhat.com On Thu, 8 Jan 2015 09:06:10 +0800 Tang Chen wrote: > Add a new API named acpi_memory_hotplug_sci() to send memory hotplug SCI. > Doing this is because this procedure will be used by other functions in the > next coming patches. > > Signed-off-by: Tang Chen > --- > hw/acpi/memory_hotplug.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c > index ef56bf6..9839963 100644 > --- a/hw/acpi/memory_hotplug.c > +++ b/hw/acpi/memory_hotplug.c > @@ -188,6 +188,12 @@ acpi_memory_get_slot_status_descriptor(MemHotplugState *mem_st, > return &mem_st->devs[slot]; > } > > +static void acpi_memory_hotplug_sci(ACPIREGS *ar, qemu_irq irq) > +{ > + ar->gpe.sts[0] |= ACPI_MEMORY_HOTPLUG_STATUS; > + acpi_update_sci(ar, irq); > +} I'd suggest do a generic: acpi_send_gpe_event(ar, irq, ACPI_MEMORY_HOTPLUG_STATUS) which could be reused by CPU and PCI hotplug as well > void acpi_memory_plug_cb(ACPIREGS *ar, qemu_irq irq, MemHotplugState *mem_st, > DeviceState *dev, Error **errp) > { > @@ -201,10 +207,8 @@ void acpi_memory_plug_cb(ACPIREGS *ar, qemu_irq irq, MemHotplugState *mem_st, > mdev->is_enabled = true; > mdev->is_inserting = true; > > - /* do ACPI magic */ > - ar->gpe.sts[0] |= ACPI_MEMORY_HOTPLUG_STATUS; > - acpi_update_sci(ar, irq); > - return; > + /* Do ACPI magic */ > + acpi_memory_hotplug_sci(ar, irq); > } > > static const VMStateDescription vmstate_memhp_sts = {