qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	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 v2 1/4] acpi: add API for 64 bit offsets
Date: Mon, 8 Jun 2015 20:14:31 +0200	[thread overview]
Message-ID: <1433787255-4372-2-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1433787255-4372-1-git-send-email-mst@redhat.com>

Collecting these is useful for implementing the XSDT.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/acpi/aml-build.h |  3 ++-
 hw/acpi/aml-build.c         | 13 ++++++++++---
 hw/arm/virt-acpi-build.c    |  8 ++++----
 hw/i386/acpi-build.c        | 20 ++++++++++----------
 4 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index e3afa13..edc1dfa 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -281,7 +281,8 @@ build_header(GArray *linker, GArray *table_data,
              AcpiTableHeader *h, const char *sig, int len, uint8_t rev);
 void *acpi_data_push(GArray *table_data, unsigned size);
 unsigned acpi_data_len(GArray *table);
-void acpi_add_table(GArray *table_offsets, GArray *table_data);
+void acpi_add_table(GArray *table_offsets32, GArray *table_offsets64,
+                    GArray *table_data);
 void acpi_build_tables_init(AcpiBuildTables *tables);
 void acpi_build_tables_cleanup(AcpiBuildTables *tables, bool mfre);
 void
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index 0d4b324..4c930b6 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -1169,10 +1169,17 @@ unsigned acpi_data_len(GArray *table)
     return table->len;
 }
 
-void acpi_add_table(GArray *table_offsets, GArray *table_data)
+void acpi_add_table(GArray *table_offsets32, GArray *table_offsets64,
+                    GArray *table_data)
 {
-    uint32_t offset = cpu_to_le32(table_data->len);
-    g_array_append_val(table_offsets, offset);
+    uint32_t offset32 = cpu_to_le32(table_data->len);
+    uint64_t offset64 = cpu_to_le64(table_data->len);
+    if (table_offsets32) {
+        g_array_append_val(table_offsets32, offset32);
+    }
+    if (table_offsets64) {
+        g_array_append_val(table_offsets64, offset64);
+    }
 }
 
 void acpi_build_tables_init(AcpiBuildTables *tables)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index a9373cc..42c8dd9 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -515,16 +515,16 @@ void virt_acpi_build(VirtGuestInfo *guest_info, AcpiBuildTables *tables)
     build_dsdt(tables_blob, tables->linker, guest_info);
 
     /* FADT MADT GTDT pointed to by RSDT */
-    acpi_add_table(table_offsets, tables_blob);
+    acpi_add_table(table_offsets, NULL, tables_blob);
     build_fadt(tables_blob, tables->linker, dsdt);
 
-    acpi_add_table(table_offsets, tables_blob);
+    acpi_add_table(table_offsets, NULL, tables_blob);
     build_madt(tables_blob, tables->linker, guest_info, &cpuinfo);
 
-    acpi_add_table(table_offsets, tables_blob);
+    acpi_add_table(table_offsets, NULL, tables_blob);
     build_gtdt(tables_blob, tables->linker);
 
-    acpi_add_table(table_offsets, tables_blob);
+    acpi_add_table(table_offsets, NULL, tables_blob);
     build_mcfg(tables_blob, tables->linker, guest_info);
 
     /* RSDT is pointed to by RSDP */
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index db32fd1..e5b0b7a 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1706,27 +1706,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, tables_blob);
+    acpi_add_table(table_offsets, NULL, tables_blob);
     build_fadt(tables_blob, tables->linker, &pm, facs, dsdt);
 
     ssdt = tables_blob->len;
-    acpi_add_table(table_offsets, tables_blob);
+    acpi_add_table(table_offsets, NULL, 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, tables_blob);
+    acpi_add_table(table_offsets, NULL, tables_blob);
     build_madt(tables_blob, tables->linker, &cpu, guest_info);
 
     if (misc.has_hpet) {
-        acpi_add_table(table_offsets, tables_blob);
+        acpi_add_table(table_offsets, NULL, tables_blob);
         build_hpet(tables_blob, tables->linker);
     }
     if (misc.tpm_version != TPM_VERSION_UNSPEC) {
-        acpi_add_table(table_offsets, tables_blob);
+        acpi_add_table(table_offsets, NULL, tables_blob);
         build_tpm_tcpa(tables_blob, tables->linker, tables->tcpalog);
 
-        acpi_add_table(table_offsets, tables_blob);
+        acpi_add_table(table_offsets, NULL, tables_blob);
         switch (misc.tpm_version) {
         case TPM_VERSION_1_2:
             build_tpm_ssdt(tables_blob, tables->linker);
@@ -1739,15 +1739,15 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
         }
     }
     if (guest_info->numa_nodes) {
-        acpi_add_table(table_offsets, tables_blob);
+        acpi_add_table(table_offsets, NULL, tables_blob);
         build_srat(tables_blob, tables->linker, guest_info);
     }
     if (acpi_get_mcfg(&mcfg)) {
-        acpi_add_table(table_offsets, tables_blob);
+        acpi_add_table(table_offsets, NULL, tables_blob);
         build_mcfg_q35(tables_blob, tables->linker, &mcfg);
     }
     if (acpi_has_iommu()) {
-        acpi_add_table(table_offsets, tables_blob);
+        acpi_add_table(table_offsets, NULL, tables_blob);
         build_dmar_q35(tables_blob, tables->linker);
     }
 
@@ -1755,7 +1755,7 @@ 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, tables_blob);
+        acpi_add_table(table_offsets, NULL, tables_blob);
         g_array_append_vals(tables_blob, u, len);
     }
 
-- 
MST

  reply	other threads:[~2015-06-08 18:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08 18:14 [Qemu-devel] [PATCH v2 0/4] acpi: xsdt support Michael S. Tsirkin
2015-06-08 18:14 ` Michael S. Tsirkin [this message]
2015-06-08 18:14 ` [Qemu-devel] [PATCH v2 2/4] i386/acpi: collect 64 bit offsets for xsdt Michael S. Tsirkin
2015-06-08 18:14 ` [Qemu-devel] [PATCH v2 3/4] i386/acpi: add XSDT Michael S. Tsirkin
2015-06-08 18:14 ` [Qemu-devel] [PATCH v2 4/4] acpi: unify rsdp generation Michael S. Tsirkin
2015-06-09  0:08 ` [Qemu-devel] [PATCH v2 0/4] acpi: xsdt support Laszlo Ersek
2015-06-09  5:31   ` Michael S. Tsirkin
2015-06-09  6:02     ` Paolo Bonzini
2015-06-09  6:35       ` Michael S. Tsirkin
2015-06-09  6:38         ` Michael S. Tsirkin
2015-06-09  7:41           ` Laszlo Ersek
2015-06-09  8:34             ` Michael S. Tsirkin
2015-06-09 14:01               ` Laszlo Ersek
2015-06-09  9:39         ` Igor Mammedov
2015-06-09  9:10       ` Michael S. Tsirkin
2015-06-09  9:49       ` Michael S. Tsirkin
2015-06-09 14:02         ` Laszlo Ersek
2015-06-09 14:05           ` Michael S. Tsirkin
2015-08-27 14:27             ` Laszlo Ersek
2015-08-27 17:58               ` Michael S. Tsirkin
2015-08-28  6:23                 ` Laszlo Ersek

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=1433787255-4372-2-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=peter.maydell@linaro.org \
    --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).