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.