From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36854 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnV8p-00063z-3y for qemu-devel@nongnu.org; Mon, 23 Aug 2010 07:24:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OnV1l-0004HG-GY for qemu-devel@nongnu.org; Mon, 23 Aug 2010 07:17:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49134) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OnV1l-0004H6-8p for qemu-devel@nongnu.org; Mon, 23 Aug 2010 07:17:21 -0400 From: Juan Quintela In-Reply-To: <1282557052-14285-15-git-send-email-stefano.stabellini@eu.citrix.com> (stefano stabellini's message of "Mon, 23 Aug 2010 10:50:52 +0100") References: <1282557052-14285-15-git-send-email-stefano.stabellini@eu.citrix.com> Date: Mon, 23 Aug 2010 13:15:03 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 15/15] xen: Add a Xen specific ACPI Implementation to target-xen List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stefano.stabellini@eu.citrix.com Cc: Anthony.Perard@citrix.com, xen-devel@lists.xensource.com, qemu-devel@nongnu.org stefano.stabellini@eu.citrix.com wrote: > From: Anthony PERARD > > Xen currently uses a different BIOS (hvmloader + rombios) therefore the > Qemu acpi_piix4 implementation wouldn't work correctly with Xen. > We plan on fixing this properly but at the moment we are just adding a > new Xen specific acpi_piix4 implementation. > This patch is optional; without it the VM boots but it cannot shutdown > properly or go to S3. > > Signed-off-by: Anthony PERARD > Signed-off-by: Stefano Stabellini > +static void gpe_save(QEMUFile* f, void* opaque) > +{ > + GPEState *s = (GPEState*)opaque; > + int i; > + > + for ( i = 0; i < ACPI_GPE0_BLK_LEN / 2; i++ ) { > + qemu_put_8s(f, &s->gpe0_sts[i]); > + qemu_put_8s(f, &s->gpe0_en[i]); > + } > + > + qemu_put_8s(f, &s->sci_asserted); > + if ( s->sci_asserted ) { > + PIIX4ACPI_LOG(PIIX4ACPI_LOG_INFO, "gpe_save with sci asserted!\n"); > + } > +} > + > +static int gpe_load(QEMUFile* f, void* opaque, int version_id) > +{ > + GPEState *s = (GPEState*)opaque; > + int i; > + if (version_id != 1) > + return -EINVAL; > + > + for ( i = 0; i < ACPI_GPE0_BLK_LEN / 2; i++ ) { > + qemu_get_8s(f, &s->gpe0_sts[i]); > + qemu_get_8s(f, &s->gpe0_en[i]); > + } > + > + qemu_get_8s(f, &s->sci_asserted); > + return 0; > +} .... > + register_savevm(NULL, "gpe", 0, 1, gpe_save, gpe_load, s); Please port this to VMSTATE. If possible (i.e. not problems with backwards compatibility), something like: > + for ( i = 0; i < ACPI_GPE0_BLK_LEN / 2; i++ ) { > + qemu_get_8s(f, &s->gpe0_sts[i]); > + } > + for ( i = 0; i < ACPI_GPE0_BLK_LEN / 2; i++ ) { > + qemu_get_8s(f, &s->gpe0_en[i]); > + } Would be easier to put in vmstate. Later, Juan. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Quintela Subject: Re: [PATCH 15/15] xen: Add a Xen specific ACPI Implementation to target-xen Date: Mon, 23 Aug 2010 13:15:03 +0200 Message-ID: References: <1282557052-14285-15-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: <1282557052-14285-15-git-send-email-stefano.stabellini@eu.citrix.com> (stefano stabellini's message of "Mon, 23 Aug 2010 10:50:52 +0100") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: stefano.stabellini@eu.citrix.com Cc: Anthony.Perard@citrix.com, xen-devel@lists.xensource.com, qemu-devel@nongnu.org List-Id: xen-devel@lists.xenproject.org stefano.stabellini@eu.citrix.com wrote: > From: Anthony PERARD > > Xen currently uses a different BIOS (hvmloader + rombios) therefore the > Qemu acpi_piix4 implementation wouldn't work correctly with Xen. > We plan on fixing this properly but at the moment we are just adding a > new Xen specific acpi_piix4 implementation. > This patch is optional; without it the VM boots but it cannot shutdown > properly or go to S3. > > Signed-off-by: Anthony PERARD > Signed-off-by: Stefano Stabellini > +static void gpe_save(QEMUFile* f, void* opaque) > +{ > + GPEState *s = (GPEState*)opaque; > + int i; > + > + for ( i = 0; i < ACPI_GPE0_BLK_LEN / 2; i++ ) { > + qemu_put_8s(f, &s->gpe0_sts[i]); > + qemu_put_8s(f, &s->gpe0_en[i]); > + } > + > + qemu_put_8s(f, &s->sci_asserted); > + if ( s->sci_asserted ) { > + PIIX4ACPI_LOG(PIIX4ACPI_LOG_INFO, "gpe_save with sci asserted!\n"); > + } > +} > + > +static int gpe_load(QEMUFile* f, void* opaque, int version_id) > +{ > + GPEState *s = (GPEState*)opaque; > + int i; > + if (version_id != 1) > + return -EINVAL; > + > + for ( i = 0; i < ACPI_GPE0_BLK_LEN / 2; i++ ) { > + qemu_get_8s(f, &s->gpe0_sts[i]); > + qemu_get_8s(f, &s->gpe0_en[i]); > + } > + > + qemu_get_8s(f, &s->sci_asserted); > + return 0; > +} .... > + register_savevm(NULL, "gpe", 0, 1, gpe_save, gpe_load, s); Please port this to VMSTATE. If possible (i.e. not problems with backwards compatibility), something like: > + for ( i = 0; i < ACPI_GPE0_BLK_LEN / 2; i++ ) { > + qemu_get_8s(f, &s->gpe0_sts[i]); > + } > + for ( i = 0; i < ACPI_GPE0_BLK_LEN / 2; i++ ) { > + qemu_get_8s(f, &s->gpe0_en[i]); > + } Would be easier to put in vmstate. Later, Juan.