acpi-dsdt: procedurally generate _PRT
commitacd727e7cb11d7aeea3343cf11bba22238530b4c
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 28 Jul 2014 15:34:14 +0000 (28 17:34 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 28 Jul 2014 21:02:39 +0000 (28 23:02 +0200)
tree8954f0e05d7d400d506ffa77d484db68d535336e
parentc60a57ff497667780132a3fcdc1500c83af5d5c0
acpi-dsdt: procedurally generate _PRT

This replaces the _PRT constant with a method that computes it.

The problem is that the DSDT+SSDT have grown from 2.0 to 2.1,
enough to cross the 8k barrier (we align the ACPI tables to 4k
before putting them in fw_cfg).  This causes problems with
migration and the pc-i440fx-2.0 machine type.

The solution to the problem is to hardcode 64k as the limit,
but this doesn't solve the bug with pc-i440fx-2.0.  The fix will be
for QEMU 2.1 to use exactly the same size as QEMU 2.0 for the
ACPI tables.  First, however, we must make the actual AML
equal or smaller; to do this, rewrite _PRT in a way that saves
over 1k of bytecode.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/acpi-dsdt.dsl
hw/i386/acpi-dsdt.hex.generated
tests/acpi-test-data/pc/DSDT