stefano.stabellini@xxxxxxxxxxxxx wrote:
> From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
>
> 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 <anthony.perard@xxxxxxxxxx>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> +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.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|