aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPhil Dennis-Jordan <phil@philjordan.eu>2017-03-15 19:20:26 +1300
committerPaolo Bonzini <pbonzini@redhat.com>2017-05-03 12:29:40 +0200
commit77af8a2b95b79699de650965d5228772743efe84 (patch)
tree99f42e47728226f4743aa91b234451343d63cebc /tests
parente619b14746e5d8c0e53061661fd0e1da01fd4d60 (diff)
hw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.
This updates the FADT generated for x86/64 machine types from Revision 1 to 3. (Based on ACPI standard 2.0 instead of 1.0) The intention is to expose the reset register information to guest operating systems which require it, specifically OS X/macOS. Revision 1 FADTs do not contain the fields relating to the reset register. The new layout and contents remains backwards-compatible with operating systems which only support ACPI 1.0, as the existing fields are not modified by this change, as the 64-bit and 32-bit variants are allowed to co-exist according to the ACPI 2.0 standard. No regressions became apparent in tests with a range of Windows (XP-10) and Linux versions. The BIOS tables test suite's FADT checksum test has also been updated to reflect the new FADT layout and content. Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu> Message-Id: <1489558827-28971-2-git-send-email-phil@philjordan.eu> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/acpi-utils.h10
-rw-r--r--tests/bios-tables-test.c23
2 files changed, 28 insertions, 5 deletions
diff --git a/tests/acpi-utils.h b/tests/acpi-utils.h
index 348e4d7931..f8d87236c6 100644
--- a/tests/acpi-utils.h
+++ b/tests/acpi-utils.h
@@ -87,6 +87,16 @@ typedef struct {
g_assert_cmpstr(ACPI_ASSERT_CMP_str, ==, expected); \
} while (0)
+#define ACPI_READ_GENERIC_ADDRESS(field, addr) \
+ do { \
+ ACPI_READ_FIELD((field).space_id, addr); \
+ ACPI_READ_FIELD((field).bit_width, addr); \
+ ACPI_READ_FIELD((field).bit_offset, addr); \
+ ACPI_READ_FIELD((field).access_width, addr); \
+ ACPI_READ_FIELD((field).address, addr); \
+ } while (0);
+
+
uint8_t acpi_calc_checksum(const uint8_t *data, int len);
uint32_t acpi_find_rsdp_address(void);
void acpi_parse_rsdp_table(uint32_t addr, AcpiRsdpDescriptor *rsdp_table);
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 88dbf97853..9c96a67053 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -29,7 +29,7 @@ typedef struct {
uint32_t rsdp_addr;
AcpiRsdpDescriptor rsdp_table;
AcpiRsdtDescriptorRev1 rsdt_table;
- AcpiFadtDescriptorRev1 fadt_table;
+ AcpiFadtDescriptorRev3 fadt_table;
AcpiFacsDescriptorRev1 facs_table;
uint32_t *rsdt_tables_addr;
int rsdt_tables_nr;
@@ -126,7 +126,7 @@ static void test_acpi_rsdt_table(test_data *data)
static void test_acpi_fadt_table(test_data *data)
{
- AcpiFadtDescriptorRev1 *fadt_table = &data->fadt_table;
+ AcpiFadtDescriptorRev3 *fadt_table = &data->fadt_table;
uint32_t addr;
/* FADT table comes first */
@@ -168,10 +168,23 @@ static void test_acpi_fadt_table(test_data *data)
ACPI_READ_FIELD(fadt_table->day_alrm, addr);
ACPI_READ_FIELD(fadt_table->mon_alrm, addr);
ACPI_READ_FIELD(fadt_table->century, addr);
- ACPI_READ_FIELD(fadt_table->reserved4, addr);
- ACPI_READ_FIELD(fadt_table->reserved4a, addr);
- ACPI_READ_FIELD(fadt_table->reserved4b, addr);
+ ACPI_READ_FIELD(fadt_table->boot_flags, addr);
+ ACPI_READ_FIELD(fadt_table->reserved, addr);
ACPI_READ_FIELD(fadt_table->flags, addr);
+ ACPI_READ_GENERIC_ADDRESS(fadt_table->reset_register, addr);
+ 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_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);
+ ACPI_READ_GENERIC_ADDRESS(fadt_table->xpm1b_control_block, addr);
+ ACPI_READ_GENERIC_ADDRESS(fadt_table->xpm2_control_block, addr);
+ ACPI_READ_GENERIC_ADDRESS(fadt_table->xpm_timer_block, addr);
+ ACPI_READ_GENERIC_ADDRESS(fadt_table->xgpe0_block, addr);
+ ACPI_READ_GENERIC_ADDRESS(fadt_table->xgpe1_block, addr);
ACPI_ASSERT_CMP(fadt_table->signature, "FACP");
g_assert(!acpi_calc_checksum((uint8_t *)fadt_table, fadt_table->length));