qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	ghammer@redhat.com, shannon.zhao@linaro.org, imammedo@redhat.com,
	pbonzini@redhat.com, lersek@redhat.com,
	Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH 2/4] i386/acpi: collect 64 bit offsets for xsdt
Date: Thu, 4 Jun 2015 18:21:32 +0200	[thread overview]
Message-ID: <1433434873-25200-3-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1433434873-25200-1-git-send-email-mst@redhat.com>

collect then discard, they are unused for now.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index e5b0b7a..aaa149b 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1663,7 +1663,8 @@ static bool acpi_has_iommu(void)
 static
 void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
 {
-    GArray *table_offsets;
+    GArray *rsdt_table_offsets;
+    GArray *xsdt_table_offsets;
     unsigned facs, ssdt, dsdt, rsdt;
     AcpiCpuInfo cpu;
     AcpiPmInfo pm;
@@ -1680,8 +1681,10 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
     acpi_get_misc_info(&misc);
     acpi_get_pci_info(&pci);
 
-    table_offsets = g_array_new(false, true /* clear */,
+    rsdt_table_offsets = g_array_new(false, true /* clear */,
                                         sizeof(uint32_t));
+    xsdt_table_offsets = g_array_new(false, true /* clear */,
+                                        sizeof(uint64_t));
     ACPI_BUILD_DPRINTF("init ACPI tables\n");
 
     bios_linker_loader_alloc(tables->linker, ACPI_BUILD_TABLE_FILE,
@@ -1706,27 +1709,27 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
     aml_len += tables_blob->len - dsdt;
 
     /* ACPI tables pointed to by RSDT */
-    acpi_add_table(table_offsets, NULL, tables_blob);
+    acpi_add_table(rsdt_table_offsets, xsdt_table_offsets, tables_blob);
     build_fadt(tables_blob, tables->linker, &pm, facs, dsdt);
 
     ssdt = tables_blob->len;
-    acpi_add_table(table_offsets, NULL, tables_blob);
+    acpi_add_table(rsdt_table_offsets, xsdt_table_offsets, tables_blob);
     build_ssdt(tables_blob, tables->linker, &cpu, &pm, &misc, &pci,
                guest_info);
     aml_len += tables_blob->len - ssdt;
 
-    acpi_add_table(table_offsets, NULL, tables_blob);
+    acpi_add_table(rsdt_table_offsets, xsdt_table_offsets, tables_blob);
     build_madt(tables_blob, tables->linker, &cpu, guest_info);
 
     if (misc.has_hpet) {
-        acpi_add_table(table_offsets, NULL, tables_blob);
+        acpi_add_table(rsdt_table_offsets, xsdt_table_offsets, tables_blob);
         build_hpet(tables_blob, tables->linker);
     }
     if (misc.tpm_version != TPM_VERSION_UNSPEC) {
-        acpi_add_table(table_offsets, NULL, tables_blob);
+        acpi_add_table(rsdt_table_offsets, xsdt_table_offsets, tables_blob);
         build_tpm_tcpa(tables_blob, tables->linker, tables->tcpalog);
 
-        acpi_add_table(table_offsets, NULL, tables_blob);
+        acpi_add_table(rsdt_table_offsets, xsdt_table_offsets, tables_blob);
         switch (misc.tpm_version) {
         case TPM_VERSION_1_2:
             build_tpm_ssdt(tables_blob, tables->linker);
@@ -1739,15 +1742,15 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
         }
     }
     if (guest_info->numa_nodes) {
-        acpi_add_table(table_offsets, NULL, tables_blob);
+        acpi_add_table(rsdt_table_offsets, xsdt_table_offsets, tables_blob);
         build_srat(tables_blob, tables->linker, guest_info);
     }
     if (acpi_get_mcfg(&mcfg)) {
-        acpi_add_table(table_offsets, NULL, tables_blob);
+        acpi_add_table(rsdt_table_offsets, xsdt_table_offsets, tables_blob);
         build_mcfg_q35(tables_blob, tables->linker, &mcfg);
     }
     if (acpi_has_iommu()) {
-        acpi_add_table(table_offsets, NULL, tables_blob);
+        acpi_add_table(rsdt_table_offsets, xsdt_table_offsets, tables_blob);
         build_dmar_q35(tables_blob, tables->linker);
     }
 
@@ -1755,13 +1758,13 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
     for (u = acpi_table_first(); u; u = acpi_table_next(u)) {
         unsigned len = acpi_table_len(u);
 
-        acpi_add_table(table_offsets, NULL, tables_blob);
+        acpi_add_table(rsdt_table_offsets, xsdt_table_offsets, tables_blob);
         g_array_append_vals(tables_blob, u, len);
     }
 
     /* RSDT is pointed to by RSDP */
     rsdt = tables_blob->len;
-    build_rsdt(tables_blob, tables->linker, table_offsets);
+    build_rsdt(tables_blob, tables->linker, rsdt_table_offsets);
 
     /* RSDP is in FSEG memory, so allocate it separately */
     build_rsdp(tables->rsdp, tables->linker, rsdt);
@@ -1813,7 +1816,8 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
     acpi_align_size(tables->linker, ACPI_BUILD_ALIGN_SIZE);
 
     /* Cleanup memory that's no longer used. */
-    g_array_free(table_offsets, true);
+    g_array_free(xsdt_table_offsets, true);
+    g_array_free(rsdt_table_offsets, true);
 }
 
 static void acpi_ram_update(MemoryRegion *mr, GArray *data)
-- 
MST

  parent reply	other threads:[~2015-06-04 16:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04 16:21 [Qemu-devel] [PATCH 0/4] acpi: xsdt support Michael S. Tsirkin
2015-06-04 16:21 ` [Qemu-devel] [PATCH 1/4] acpi: add API for 64 bit offsets Michael S. Tsirkin
2015-06-05  2:38   ` Shannon Zhao
2015-06-04 16:21 ` Michael S. Tsirkin [this message]
2015-06-04 16:21 ` [Qemu-devel] [PATCH 3/4] i386/acpi: add XSDT Michael S. Tsirkin
2015-06-05  2:38   ` Shannon Zhao
2015-06-07  9:42     ` Michael S. Tsirkin
2015-06-08  1:49       ` Shannon Zhao
2015-06-04 16:21 ` [Qemu-devel] [PATCH 4/4] acpi: unify rsdp generation Michael S. Tsirkin
2015-06-05  2:47   ` Shannon Zhao
2015-06-07  9:45     ` Michael S. Tsirkin
2015-06-08  1:52       ` Shannon Zhao
2015-06-08  7:24         ` Michael S. Tsirkin
2015-06-08 12:59           ` Stefan Hajnoczi
2015-06-08 13:02           ` Stefan Hajnoczi
2015-06-05  2:48 ` [Qemu-devel] [PATCH 0/4] acpi: xsdt support Shannon Zhao

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=1433434873-25200-3-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=ghammer@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=lersek@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=shannon.zhao@linaro.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).