qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] acd727: acpi-dsdt: procedurally generate _PRT


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] acd727: acpi-dsdt: procedurally generate _PRT
Date: Tue, 29 Jul 2014 05:30:04 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: acd727e7cb11d7aeea3343cf11bba22238530b4c
      
https://github.com/qemu/qemu/commit/acd727e7cb11d7aeea3343cf11bba22238530b4c
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-28 (Mon, 28 Jul 2014)

  Changed paths:
    M hw/i386/acpi-dsdt.dsl
    M hw/i386/acpi-dsdt.hex.generated
    M tests/acpi-test-data/pc/DSDT

  Log Message:
  -----------
  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 <address@hidden>
Tested-by: Igor Mammedov <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 07fb61760cdea7c3f1b9c897513986945bca8e89
      
https://github.com/qemu/qemu/commit/07fb61760cdea7c3f1b9c897513986945bca8e89
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-28 (Mon, 28 Jul 2014)

  Changed paths:
    M hw/i386/acpi-build.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M include/hw/i386/pc.h

  Log Message:
  -----------
  pc: hack for migration compatibility from QEMU 2.0

Changing the ACPI table size causes migration to break, and the memory
hotplug work opened our eyes on how horribly we were breaking things in
2.0 already.

The ACPI table size is rounded to the next 4k, which one would think
gives some headroom.  In practice this is not the case, because the user
can control the ACPI table size (each CPU adds 97 bytes to the SSDT and
8 to the MADT) and so some "-smp" values will break the 4k boundary and
fail to migrate.  Similarly, PCI bridges add ~1870 bytes to the SSDT.

This patch concerns itself with fixing migration from QEMU 2.0.  It
computes the payload size of QEMU 2.0 and always uses that one.
The previous patch shrunk the ACPI tables enough that the QEMU 2.0 size
should always be enough; non-AML tables can change depending on the
configuration (especially MADT, SRAT, HPET) but they remain the same
between QEMU 2.0 and 2.1, so we only compute our padding based on the
sizes of the SSDT and DSDT.

Migration from QEMU 1.7 should work for guests that have a number of CPUs
other than 12, 13, 14, 54, 55, 56, 97, 98, 139, 140.  It was already
broken from QEMU 1.7 to QEMU 2.0 in the same way, though.

Even with this patch, QEMU 1.7 and 2.0 have two different ideas of
"-M pc-i440fx-2.0" when there are PCI bridges.  Igor sent a patch to
adopt the QEMU 1.7 definition.  I think distributions should apply
it if they move directly from QEMU 1.7 to 2.1+ without ever packaging
version 2.0.

Reviewed-by: Laszlo Ersek <address@hidden>
Tested-by: Igor Mammedov <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: cb348985abd3673b40c8af069c3e3b84f547b6f7
      
https://github.com/qemu/qemu/commit/cb348985abd3673b40c8af069c3e3b84f547b6f7
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-29 (Tue, 29 Jul 2014)

  Changed paths:
    M tests/bios-tables-test.c

  Log Message:
  -----------
  bios-tables-test: fix ASL normalization false positive

My version of IASL (from RHEL7) puts two newlines between the head comment
and the DefinitionBlock property.  Kill all newlines after the comment,
so that normalize_asl works properly.

Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>


  Commit: 133a2da488062eb47e576e12ee15314349272068
      
https://github.com/qemu/qemu/commit/133a2da488062eb47e576e12ee15314349272068
  Author: Igor Mammedov <address@hidden>
  Date:   2014-07-29 (Tue, 29 Jul 2014)

  Changed paths:
    M hw/i386/acpi-build.c

  Log Message:
  -----------
  pc: acpi: generate AML only for PCI0 devices if PCI bridge hotplug is disabled

Fixes migration regression from QEMU-1.7 to a newer QEMUs.
SSDT table size in QEMU-1.7 doesn't change regardless of
a number of PCI bridge devices present at startup.

However in QEMU-2.0 since addition of hotplug on PCI bridges,
each PCI bridge adds ~1875 bytes to SSDT table, including
pc-i440fx-1.7 machine type where PCI bridge hotplug disabled
via compat property.
It breaks migration from "QEMU-1.7" to "QEMU-2.[01] -M pc-i440fx-1.7"
since RAMBlock size of ACPI tables on target becomes larger
then on source and migration fails with:

"Length mismatch: /address@hidden/acpi/tables: 2000 in != 3000"

error.

Fix this by generating AML only for PCI0 bus if
hotplug on PCI bridges is disabled and preserves PCI brigde
description in AML as it was done in QEMU-1.7 for pc-i440fx-1.7.

It will help to maintain size of SSDT static regardless of
number of PCI bridges on startup for pc-i440fx-1.7 machine type.

Signed-off-by: Igor Mammedov <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 093a35e5fc0c60508e8c754ae81572090365723d
      
https://github.com/qemu/qemu/commit/093a35e5fc0c60508e8c754ae81572090365723d
  Author: Michael S. Tsirkin <address@hidden>
  Date:   2014-07-29 (Tue, 29 Jul 2014)

  Changed paths:
    M hw/i386/acpi-build.c

  Log Message:
  -----------
  acpi-build: minor code cleanup

Fix up and add  comments to clarify code, plus a trivial
code change for clarity.

Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 18045fb9f457a0f0cba2bd113c748a2dcb4ed39e
      
https://github.com/qemu/qemu/commit/18045fb9f457a0f0cba2bd113c748a2dcb4ed39e
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-07-29 (Tue, 29 Jul 2014)

  Changed paths:
    M hw/i386/acpi-build.c

  Log Message:
  -----------
  pc: future-proof migration-compatibility of ACPI tables

This patch avoids that similar changes break QEMU again in the future.
QEMU will now hard-code 64k as the maximum ACPI table size, which
(despite being an order of magnitude smaller than 640k) should be enough
for everyone.

Reviewed-by: Laszlo Ersek <address@hidden>
Tested-by: Igor Mammedov <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 868270f23d8db2cce83e4f082fe75e8625a5fbf9
      
https://github.com/qemu/qemu/commit/868270f23d8db2cce83e4f082fe75e8625a5fbf9
  Author: Michael S. Tsirkin <address@hidden>
  Date:   2014-07-29 (Tue, 29 Jul 2014)

  Changed paths:
    M hw/i386/acpi-build.c

  Log Message:
  -----------
  acpi-build: tweak acpi migration limits

- Tweak error message for legacy machine type:
  Basically if table size exceeds the limits we set all
  bets are off for migration: e.g. it can start failing even
  within given qemu minor version simply because of a bugfix.
- Increase table size to 128k.
- Make sure we notice it long before we start getting close to the
  128k limit: warn at 64k.
- Don't fail if we exceed the limit: most people don't care about
  migration, even less people care about cross version miration.

Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>


  Commit: f47337cb9181a1f9339b9b0516b92fe77a22f0f3
      
https://github.com/qemu/qemu/commit/f47337cb9181a1f9339b9b0516b92fe77a22f0f3
  Author: Michael S. Tsirkin <address@hidden>
  Date:   2014-07-29 (Tue, 29 Jul 2014)

  Changed paths:
    M hw/i386/pc_piix.c

  Log Message:
  -----------
  piix: set legacy table size for 1.7

Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 04d1d6613f36f2a7cdc6ad8d7cfb1918a30f173e
      
https://github.com/qemu/qemu/commit/04d1d6613f36f2a7cdc6ad8d7cfb1918a30f173e
  Author: Peter Maydell <address@hidden>
  Date:   2014-07-29 (Tue, 29 Jul 2014)

  Changed paths:
    M hw/i386/acpi-build.c
    M hw/i386/acpi-dsdt.dsl
    M hw/i386/acpi-dsdt.hex.generated
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M include/hw/i386/pc.h
    M tests/acpi-test-data/pc/DSDT
    M tests/bios-tables-test.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pc migration fixes

Last minute fixes for migration.
It seems that if we don't fix it now, fixing
it in the next version will be even more painful ...

Signed-off-by: Michael S. Tsirkin <address@hidden>

# gpg: Signature made Tue 29 Jul 2014 11:45:18 BST using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <address@hidden>"
# gpg:                 aka "Michael S. Tsirkin <address@hidden>"

* remotes/mst/tags/for_upstream:
  piix: set legacy table size for 1.7
  acpi-build: tweak acpi migration limits
  pc: future-proof migration-compatibility of ACPI tables
  acpi-build: minor code cleanup
  pc: acpi: generate AML only for PCI0 devices if PCI bridge hotplug is disabled
  bios-tables-test: fix ASL normalization false positive
  pc: hack for migration compatibility from QEMU 2.0
  acpi-dsdt: procedurally generate _PRT

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/41a1a9c42c4e...04d1d6613f36

reply via email to

[Prev in Thread] Current Thread [Next in Thread]