From patchwork Wed May 10 19:07:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 99018 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp345745obb; Wed, 10 May 2017 12:10:02 -0700 (PDT) X-Received: by 10.200.36.66 with SMTP id d2mr65956qtd.9.1494443402474; Wed, 10 May 2017 12:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494443402; cv=none; d=google.com; s=arc-20160816; b=hDxAuV3FTd3a06AfFlFYG+k0Sm8aZQFCyjjNYNSBPJXRm6RND2dMpWT4jBPgnUxCEj 8+4VhQGp61TvmjnafE+opKZFkeoYZLHsCG/wkRdYivDfFHYVxG9vaAWelW9hIAWn5bCB iYsxVyPr8pebS1DvrQTZwrQzvykvr2HNnY2+LheLBHbLQp9kF9nJUthBAt0zZIttcqFb 6zHzQfrqpSPlqveTpg2IO4Ji8U5eEP9em3UGzeW5qsCwTVIvK1jeq2yTciCb9xGe6VwS 0l8GfTLaHuvPxvJk4JHaDaObWW+6aShrcTnmDOWwjG0Ih5IlL+/5iXtFSJPqfKNbzPpa YDmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:in-reply-to :content-disposition:mime-version:references:message-id:to:from:date :dkim-filter:dmarc-filter:arc-authentication-results; bh=h4V85c14FPGtPFbPfWABTOkyGQRJR1O3vmmaR7PYVt0=; b=jZyjQYcLwe0U16PBSMtZJw1ctYHMywI1Nuds+7J0xAUVtA965RodlpdOa3ryVMMKSC AF2wN7mtNinUWbu3sV8UBCl7LGSFTdo/Arpzqj2wa2kKtyaz9BcKw0rbLe0fbjWoTY7Z r3RdzzJMYV0l/ZIZl1pTstM0sb3Teh5vDY+6MCRkyMh7/R0Tt+Bx0py6XYuxdHwLbllH FpPu76HZqY6j/jg9opusukSgElQEUJX49AbSULacOkv0MOYUdS+k0nqSg0OiFKbORBZZ iY08+ODzqZc5zKXUyrF6qGjix9rujlgc3Mg5BE53tJ5D7+yDTg03ezDpy0QtN1loTHnt cNgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x27si8919qtc.283.2017.05.10.12.10.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 10 May 2017 12:10:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:44314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8Wzp-0006Mu-W6 for patch@linaro.org; Wed, 10 May 2017 15:10:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8Wxz-00056u-2M for qemu-devel@nongnu.org; Wed, 10 May 2017 15:08:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d8Wxx-0004dj-VT for qemu-devel@nongnu.org; Wed, 10 May 2017 15:08:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33840) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d8Wxx-0004cm-N0 for qemu-devel@nongnu.org; Wed, 10 May 2017 15:08:05 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AD374C059722; Wed, 10 May 2017 19:08:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AD374C059722 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mst@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AD374C059722 Received: from redhat.com (ovpn-125-116.rdu2.redhat.com [10.10.125.116]) by smtp.corp.redhat.com (Postfix) with SMTP id A5F5E62931; Wed, 10 May 2017 19:07:59 +0000 (UTC) Date: Wed, 10 May 2017 22:07:59 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1494443192-17177-2-git-send-email-mst@redhat.com> References: <1494443192-17177-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1494443192-17177-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 10 May 2017 19:08:04 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/9] hw/acpi-defs: replace leading X with x_ in FADT field names X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Ard Biesheuvel , Paolo Bonzini , Igor Mammedov , Laszlo Ersek , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Ard Biesheuvel At the request of Michael, replace the leading capital X in the FADT field name Xfacs and Xdsdt with lower case x + underscore. Cc: Michael S. Tsirkin Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/acpi-defs.h | 4 ++-- hw/i386/acpi-build.c | 4 ++-- tests/bios-tables-test.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) -- MST diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h index 293ee45..93e1eba 100644 --- a/include/hw/acpi/acpi-defs.h +++ b/include/hw/acpi/acpi-defs.h @@ -144,8 +144,8 @@ typedef struct AcpiTableHeader AcpiTableHeader; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */ \ uint16_t arm_boot_flags; \ uint8_t minor_revision; /* FADT Minor Revision (ACPI 5.1) */ \ - uint64_t Xfacs; /* 64-bit physical address of FACS */ \ - uint64_t Xdsdt; /* 64-bit physical address of DSDT */ \ + uint64_t x_facs; /* 64-bit physical address of FACS */ \ + uint64_t x_dsdt; /* 64-bit physical address of DSDT */ \ /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ \ struct AcpiGenericAddress xpm1a_event_block; \ /* 64-bit Extended Power Mgt 1b Event Reg Blk address */ \ diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 1d8c645..c75f73e 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -341,7 +341,7 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, AcpiFadtDescriptorRev3 *fadt = acpi_data_push(table_data, sizeof(*fadt)); unsigned fw_ctrl_offset = (char *)&fadt->firmware_ctrl - table_data->data; unsigned dsdt_entry_offset = (char *)&fadt->dsdt - table_data->data; - unsigned xdsdt_entry_offset = (char *)&fadt->Xdsdt - table_data->data; + unsigned xdsdt_entry_offset = (char *)&fadt->x_dsdt - table_data->data; /* FACS address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker, @@ -354,7 +354,7 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, ACPI_BUILD_TABLE_FILE, dsdt_entry_offset, sizeof(fadt->dsdt), ACPI_BUILD_TABLE_FILE, dsdt_tbl_offset); bios_linker_loader_add_pointer(linker, - ACPI_BUILD_TABLE_FILE, xdsdt_entry_offset, sizeof(fadt->Xdsdt), + ACPI_BUILD_TABLE_FILE, xdsdt_entry_offset, sizeof(fadt->x_dsdt), ACPI_BUILD_TABLE_FILE, dsdt_tbl_offset); build_header(linker, table_data, diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 9c96a67..bdef3b9 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -175,8 +175,8 @@ static void test_acpi_fadt_table(test_data *data) ACPI_READ_FIELD(fadt_table->reset_value, addr); ACPI_READ_FIELD(fadt_table->arm_boot_flags, addr); ACPI_READ_FIELD(fadt_table->minor_revision, addr); - ACPI_READ_FIELD(fadt_table->Xfacs, addr); - ACPI_READ_FIELD(fadt_table->Xdsdt, addr); + ACPI_READ_FIELD(fadt_table->x_facs, addr); + ACPI_READ_FIELD(fadt_table->x_dsdt, addr); ACPI_READ_GENERIC_ADDRESS(fadt_table->xpm1a_event_block, addr); ACPI_READ_GENERIC_ADDRESS(fadt_table->xpm1b_event_block, addr); ACPI_READ_GENERIC_ADDRESS(fadt_table->xpm1a_control_block, addr); From patchwork Wed May 10 19:08:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 99019 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp382169qge; Wed, 10 May 2017 12:12:24 -0700 (PDT) X-Received: by 10.200.48.45 with SMTP id f42mr43203qte.199.1494443544346; Wed, 10 May 2017 12:12:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494443544; cv=none; d=google.com; s=arc-20160816; b=SDXS3Tw7eKMjahDG3/TGRt238gRCN4x04SswkQNWQ4TbQIYsTbFbH8KJ0VZIst49Kq wicxNqvJDYuOlXkwrv6rln9aUWF9jKxRrOsMq4Cog5AVFuoFtEzB2yBDQMvZH/xjqgWf XuFEaSM2sF8O6LcCdVOTpAIiQOB28//8lH3i6rBjDslzi3vtcMJGg8zcXCGMQx7usyZ0 9Xnm06zEdwwB/kVkjj1GXTQhjum6hIAVsuQP3EeT1/lCLx+shzb8V7fNh2SeflHanyzN jpi4zpNs8H8LrQvAJyDw7IkarDN9idgh7c6OQBTAaXfLIRCzUzTr7spT1OwBCRs7WzV6 he/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:in-reply-to :content-disposition:mime-version:references:message-id:to:from:date :dkim-filter:dmarc-filter:arc-authentication-results; bh=KoegGsTEtRY3DlO7Ej1u0s03H29pxkRTOuAI6NosMKg=; b=t0MkIPTkROaW5AqGYyYuQB7iPwfjpsmZK1E48NGmNAZeLqvKR88UdmH5hml8adYs+I qJNdJSPQz653Lx0Q/3OYZxGE5WaX1EXDLrnWk+vY5/u82NfmKsgrXrUUnQJ/lrb0UviY /DtkCFK9hS3ORCSYOIOCxH4vI4M/SRfLLjzMTFQTFaQQzLtLDtFrkb8EDJha/S1EngIM o+EwJbOcDc4bmwV4cHss7SBmJuQ0GDnuXOgm5evnMNiJNNkbNDTKTzbu1rPoxelYeMdE /LuBkkkbE/Qe8oOK1B4WsxRcoZF3PkoNFZ2waA+3DdsY8nWrYqKi4C7pssfyXXgJngV6 zwAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u63si4062303qkc.158.2017.05.10.12.12.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 10 May 2017 12:12:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:44330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8X27-0008PW-1E for patch@linaro.org; Wed, 10 May 2017 15:12:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8WyA-0005Q2-SJ for qemu-devel@nongnu.org; Wed, 10 May 2017 15:08:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d8Wy9-0004iB-BO for qemu-devel@nongnu.org; Wed, 10 May 2017 15:08:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48420) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d8Wxz-0004er-WC; Wed, 10 May 2017 15:08:08 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B9BE80C1C; Wed, 10 May 2017 19:08:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0B9BE80C1C Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mst@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0B9BE80C1C Received: from redhat.com (ovpn-125-116.rdu2.redhat.com [10.10.125.116]) by smtp.corp.redhat.com (Postfix) with SMTP id 2FA017843E; Wed, 10 May 2017 19:08:05 +0000 (UTC) Date: Wed, 10 May 2017 22:08:04 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1494443192-17177-3-git-send-email-mst@redhat.com> References: <1494443192-17177-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1494443192-17177-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 10 May 2017 19:08:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/9] hw/arm/virt: generate 64-bit addressable ACPI objects X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Jones , Ard Biesheuvel , qemu-arm@nongnu.org, Shannon Zhao , Igor Mammedov , Laszlo Ersek Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Ard Biesheuvel Our current ACPI table generation code limits the placement of ACPI tables to 32-bit addressable memory, in order to be able to emit the root pointer (RSDP) and root table (RSDT) using table types from the ACPI 1.0 days. Since ARM was not supported by ACPI before version 5.0, it makes sense to lift this restriction. This is not crucial for mach-virt, which is guaranteed to have some memory available below the 4 GB mark, but it is a nice to have for QEMU machines that do not have any 32-bit addressable memory, which is not uncommon for real world 64-bit ARM systems. Since we already emit a version of the RSDP root pointer that has a secondary 64-bit wide address field for the 64-bit root table (XSDT), all we need to do is replace the RSDT generation with the generation of an XSDT table, and use a different slot in the FADT table to refer to the DSDT. Signed-off-by: Ard Biesheuvel Reviewed-by: Andrew Jones Acked-by: Laszlo Ersek Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Acked-by: Peter Maydell --- include/hw/acpi/acpi-defs.h | 11 +++++++++++ include/hw/acpi/aml-build.h | 3 +++ hw/acpi/aml-build.c | 27 +++++++++++++++++++++++++++ hw/arm/virt-acpi-build.c | 26 +++++++++++++------------- 4 files changed, 54 insertions(+), 13 deletions(-) -- MST diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h index 93e1eba..91bae7f 100644 --- a/include/hw/acpi/acpi-defs.h +++ b/include/hw/acpi/acpi-defs.h @@ -233,6 +233,17 @@ struct AcpiRsdtDescriptorRev1 typedef struct AcpiRsdtDescriptorRev1 AcpiRsdtDescriptorRev1; /* + * ACPI 2.0 eXtended System Description Table (XSDT) + */ +struct AcpiXsdtDescriptorRev2 +{ + ACPI_TABLE_HEADER_DEF /* ACPI common table header */ + uint64_t table_offset_entry[0]; /* Array of pointers to other */ + /* ACPI tables */ +} QEMU_PACKED; +typedef struct AcpiXsdtDescriptorRev2 AcpiXsdtDescriptorRev2; + +/* * ACPI 1.0 Firmware ACPI Control Structure (FACS) */ struct AcpiFacsDescriptorRev1 diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 00c21f1..eb07c2d 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -381,6 +381,9 @@ void acpi_build_tables_cleanup(AcpiBuildTables *tables, bool mfre); void build_rsdt(GArray *table_data, BIOSLinker *linker, GArray *table_offsets, const char *oem_id, const char *oem_table_id); +void +build_xsdt(GArray *table_data, BIOSLinker *linker, GArray *table_offsets, + const char *oem_id, const char *oem_table_id); int build_append_named_dword(GArray *array, const char *name_format, ...) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index c6f2032..4ddfb68 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -1599,6 +1599,33 @@ build_rsdt(GArray *table_data, BIOSLinker *linker, GArray *table_offsets, (void *)rsdt, "RSDT", rsdt_len, 1, oem_id, oem_table_id); } +/* Build xsdt table */ +void +build_xsdt(GArray *table_data, BIOSLinker *linker, GArray *table_offsets, + const char *oem_id, const char *oem_table_id) +{ + int i; + unsigned xsdt_entries_offset; + AcpiXsdtDescriptorRev2 *xsdt; + const unsigned table_data_len = (sizeof(uint64_t) * table_offsets->len); + const unsigned xsdt_entry_size = sizeof(xsdt->table_offset_entry[0]); + const size_t xsdt_len = sizeof(*xsdt) + table_data_len; + + xsdt = acpi_data_push(table_data, xsdt_len); + xsdt_entries_offset = (char *)xsdt->table_offset_entry - table_data->data; + for (i = 0; i < table_offsets->len; ++i) { + uint64_t ref_tbl_offset = g_array_index(table_offsets, uint32_t, i); + uint64_t xsdt_entry_offset = xsdt_entries_offset + xsdt_entry_size * i; + + /* xsdt->table_offset_entry to be filled by Guest linker */ + bios_linker_loader_add_pointer(linker, + ACPI_BUILD_TABLE_FILE, xsdt_entry_offset, xsdt_entry_size, + ACPI_BUILD_TABLE_FILE, ref_tbl_offset); + } + build_header(linker, table_data, + (void *)xsdt, "XSDT", xsdt_len, 1, oem_id, oem_table_id); +} + void build_srat_memory(AcpiSratMemoryAffinity *numamem, uint64_t base, uint64_t len, int node, MemoryAffinityFlags flags) { diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 0835e59..6e5f339 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -364,12 +364,12 @@ static void acpi_dsdt_add_power_button(Aml *scope) /* RSDP */ static GArray * -build_rsdp(GArray *rsdp_table, BIOSLinker *linker, unsigned rsdt_tbl_offset) +build_rsdp(GArray *rsdp_table, BIOSLinker *linker, unsigned xsdt_tbl_offset) { AcpiRsdpDescriptor *rsdp = acpi_data_push(rsdp_table, sizeof *rsdp); - unsigned rsdt_pa_size = sizeof(rsdp->rsdt_physical_address); - unsigned rsdt_pa_offset = - (char *)&rsdp->rsdt_physical_address - rsdp_table->data; + unsigned xsdt_pa_size = sizeof(rsdp->xsdt_physical_address); + unsigned xsdt_pa_offset = + (char *)&rsdp->xsdt_physical_address - rsdp_table->data; bios_linker_loader_alloc(linker, ACPI_BUILD_RSDP_FILE, rsdp_table, 16, true /* fseg memory */); @@ -381,8 +381,8 @@ build_rsdp(GArray *rsdp_table, BIOSLinker *linker, unsigned rsdt_tbl_offset) /* Address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker, - ACPI_BUILD_RSDP_FILE, rsdt_pa_offset, rsdt_pa_size, - ACPI_BUILD_TABLE_FILE, rsdt_tbl_offset); + ACPI_BUILD_RSDP_FILE, xsdt_pa_offset, xsdt_pa_size, + ACPI_BUILD_TABLE_FILE, xsdt_tbl_offset); /* Checksum to be filled by Guest linker */ bios_linker_loader_add_checksum(linker, ACPI_BUILD_RSDP_FILE, @@ -659,7 +659,7 @@ static void build_fadt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms, unsigned dsdt_tbl_offset) { AcpiFadtDescriptorRev5_1 *fadt = acpi_data_push(table_data, sizeof(*fadt)); - unsigned dsdt_entry_offset = (char *)&fadt->dsdt - table_data->data; + unsigned xdsdt_entry_offset = (char *)&fadt->x_dsdt - table_data->data; uint16_t bootflags; switch (vms->psci_conduit) { @@ -685,7 +685,7 @@ static void build_fadt(GArray *table_data, BIOSLinker *linker, /* DSDT address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker, - ACPI_BUILD_TABLE_FILE, dsdt_entry_offset, sizeof(fadt->dsdt), + ACPI_BUILD_TABLE_FILE, xdsdt_entry_offset, sizeof(fadt->x_dsdt), ACPI_BUILD_TABLE_FILE, dsdt_tbl_offset); build_header(linker, table_data, @@ -748,7 +748,7 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) { VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); GArray *table_offsets; - unsigned dsdt, rsdt; + unsigned dsdt, xsdt; GArray *tables_blob = tables->table_data; table_offsets = g_array_new(false, true /* clear */, @@ -788,12 +788,12 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) build_iort(tables_blob, tables->linker); } - /* RSDT is pointed to by RSDP */ - rsdt = tables_blob->len; - build_rsdt(tables_blob, tables->linker, table_offsets, NULL, NULL); + /* XSDT is pointed to by RSDP */ + xsdt = tables_blob->len; + build_xsdt(tables_blob, tables->linker, table_offsets, NULL, NULL); /* RSDP is in FSEG memory, so allocate it separately */ - build_rsdp(tables->rsdp, tables->linker, rsdt); + build_rsdp(tables->rsdp, tables->linker, xsdt); /* Cleanup memory that's no longer used. */ g_array_free(table_offsets, true);