qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: imammedo@redhat.com, dgilbert@redhat.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH v2 6/4] pc: clean up pre-2.1 compatibility code
Date: Wed, 24 Dec 2014 17:07:40 +0100	[thread overview]
Message-ID: <1419437261-21113-7-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1419437261-21113-1-git-send-email-pbonzini@redhat.com>

Now that the alignment is parameterized, we can share the call to
acpi_align_size between all three (1.7-2.0/2.1/2.2+) sizing algorithms.

Also, with the new rule that SSDT cannot change except with
machine-type compat code, the magic 97 constant for a CPU's
AML size is not anymore "legacy", so rename it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/acpi-build.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 1bb3222..df930b7 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -64,8 +64,8 @@
  * a little bit, there should be plenty of free space since the DSDT
  * shrunk by ~1.5k between QEMU 2.0 and QEMU 2.1.
  */
-#define ACPI_BUILD_LEGACY_CPU_AML_SIZE    97
-#define ACPI_BUILD_ALIGN_SIZE             0x1000
+#define ACPI_BUILD_CPU_AML_SIZE    97
+#define ACPI_BUILD_ALIGN_SIZE      0x1000
 
 /* #define DEBUG_ACPI_BUILD */
 #ifdef DEBUG_ACPI_BUILD
@@ -1688,10 +1688,9 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
          */
         int legacy_aml_len =
             guest_info->legacy_acpi_table_size +
-            ACPI_BUILD_LEGACY_CPU_AML_SIZE * max_cpus;
+            ACPI_BUILD_CPU_AML_SIZE * max_cpus;
         int legacy_table_size =
-            ROUND_UP(tables->table_data->len - aml_len + legacy_aml_len,
-                     ACPI_BUILD_ALIGN_SIZE);
+            tables->table_data->len - aml_len + legacy_aml_len;
         if (tables->table_data->len > legacy_table_size) {
             /* Should happen only with PCI bridges and -M pc-i440fx-2.0.  */
             error_report("Warning: migration may not work.");
@@ -1707,8 +1706,8 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
             error_report("Warning: migration may not work.");
             error_report("Warning: please upgrade to a newer machine type.");
         }
-        acpi_align_size(tables->table_data, guest_info->acpi_table_align);
     }
+    acpi_align_size(tables->table_data, guest_info->acpi_table_align);
 
     acpi_align_size(tables->linker, ACPI_BUILD_ALIGN_SIZE);
 
-- 
1.8.3.1

  parent reply	other threads:[~2014-12-24 16:08 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-24 16:07 [Qemu-devel] [PATCH v2 0/4] acpi: move common parts of the SSDT to the DSDT (and preview of things to come) Paolo Bonzini
2014-12-24 16:07 ` [Qemu-devel] [PATCH v2 1/4] pc: append ssdt-misc.dsl to the DSDT Paolo Bonzini
2015-01-19 15:15   ` Igor Mammedov
2015-01-19 15:41     ` Paolo Bonzini
2015-01-19 17:14       ` Igor Mammedov
2015-01-19 17:26         ` Paolo Bonzini
2015-01-19 19:29           ` Michael S. Tsirkin
2015-01-19 19:33             ` Michael S. Tsirkin
2015-01-19 19:57               ` Paolo Bonzini
2015-01-19 21:27                 ` Michael S. Tsirkin
2015-01-20  9:59             ` Igor Mammedov
2015-01-20 10:34               ` Paolo Bonzini
2015-01-20 10:35               ` Michael S. Tsirkin
2015-01-20 12:41                 ` Igor Mammedov
2015-01-20 12:56                   ` Michael S. Tsirkin
2015-01-19 15:31   ` Michael S. Tsirkin
2014-12-24 16:07 ` [Qemu-devel] [PATCH v2 2/4] pc: rename ssdt-misc to dsdt-common Paolo Bonzini
2014-12-24 16:07 ` [Qemu-devel] [PATCH v2 3/4] pc: move common parts of the DSDT " Paolo Bonzini
2014-12-24 16:07 ` [Qemu-devel] [PATCH v2 4/4] pc: merge DSDT common parts into acpi-dsdt-common.dsl Paolo Bonzini
2015-01-19 15:26   ` Michael S. Tsirkin
2015-01-19 15:33     ` Paolo Bonzini
2015-01-19 15:38       ` Michael S. Tsirkin
2014-12-24 16:07 ` [Qemu-devel] [PATCH v2 5/4] pc: introduce new ACPI table sizing algorithm Paolo Bonzini
2015-01-19 15:33   ` Michael S. Tsirkin
2014-12-24 16:07 ` Paolo Bonzini [this message]
2014-12-24 16:07 ` [Qemu-devel] [PATCH v2 7/4] pc: go back to smaller ACPI tables Paolo Bonzini
2015-01-19 15:36   ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1419437261-21113-7-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).