[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen master] acpi: Use apic_id_limit when calculating legacy ACPI table size



commit 4b5b47abbf23246bd8dde4c6faaed8b7249d8654
Author:     Eduardo Habkost <ehabkost@xxxxxxxxxx>
AuthorDate: Fri Nov 11 14:45:42 2016 -0200
Commit:     Michael S. Tsirkin <mst@xxxxxxxxxx>
CommitDate: Fri Nov 18 17:50:09 2016 +0200

    acpi: Use apic_id_limit when calculating legacy ACPI table size
    
    The code that calculates the legacy ACPI table size for migration
    compatibility uses max_cpus when calculating legacy_aml_len (the size of
    the DSDT and SSDT tables). However, the SSDT grows according to APIC ID
    limit, not max_cpus.
    
    The bug is not triggered very often because of the 4k alignment on the
    table size. But it can be triggered if you are unlucky enough to cross a
    4k boundary.
    
    Change the legacy_aml_len calculation to use apic_id_limit, to calculate
    the right size.
    
    Signed-off-by: Eduardo Habkost <ehabkost@xxxxxxxxxx>
    Reviewed-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
    Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
---
 hw/i386/acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index a155857..45a2ccf 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2860,7 +2860,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState 
*machine)
          */
         int legacy_aml_len =
             pcmc->legacy_acpi_table_size +
-            ACPI_BUILD_LEGACY_CPU_AML_SIZE * max_cpus;
+            ACPI_BUILD_LEGACY_CPU_AML_SIZE * pcms->apic_id_limit;
         int legacy_table_size =
             ROUND_UP(tables_blob->len - aml_len + legacy_aml_len,
                      ACPI_BUILD_ALIGN_SIZE);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.