From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Eduardo Habkost <ehabkost@redhat.com>,
Liran Alon <liran.alon@oracle.com>,
Igor Mammedov <imammedo@redhat.com>,
Elad Gabay <elad.gabay@oracle.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: [PULL 24/29] acpi: Add Windows ACPI Emulated Device Table (WAET)
Date: Mon, 4 May 2020 10:30:10 -0400 [thread overview]
Message-ID: <20200504142814.157589-25-mst@redhat.com> (raw)
In-Reply-To: <20200504142814.157589-1-mst@redhat.com>
From: Liran Alon <liran.alon@oracle.com>
Microsoft introduced this ACPI table to avoid Windows guests performing
various workarounds for device erratas. As the virtual device emulated
by VMM may not have the errata.
Currently, WAET allows hypervisor to inform guest about two
specific behaviors: One for RTC and the other for ACPI PM timer.
Support for WAET have been introduced since Windows Vista. This ACPI
table is also exposed by other common hypervisors by default, including:
VMware, GCP and AWS.
This patch adds WAET ACPI Table to QEMU.
We set "ACPI PM timer good" bit in "Emualted Device Flags" field to
indicate that the ACPI PM timer has been enhanced to not require
multiple reads to obtain a reliable value.
This results in improving the performance of Windows guests that use
ACPI PM timer by avoiding unnecessary VMExits caused by these multiple
reads.
Co-developed-by: Elad Gabay <elad.gabay@oracle.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
Message-Id: <20200313145009.144820-3-liran.alon@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
---
hw/i386/acpi-build.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 7d880bec4a..2e15f6848e 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2512,6 +2512,34 @@ build_dmar_q35(GArray *table_data, BIOSLinker *linker)
build_header(linker, table_data, (void *)(table_data->data + dmar_start),
"DMAR", table_data->len - dmar_start, 1, NULL, NULL);
}
+
+/*
+ * Windows ACPI Emulated Devices Table
+ * (Version 1.0 - April 6, 2009)
+ * Spec: http://download.microsoft.com/download/7/E/7/7E7662CF-CBEA-470B-A97E-CE7CE0D98DC2/WAET.docx
+ *
+ * Helpful to speedup Windows guests and ignored by others.
+ */
+static void
+build_waet(GArray *table_data, BIOSLinker *linker)
+{
+ int waet_start = table_data->len;
+
+ /* WAET header */
+ acpi_data_push(table_data, sizeof(AcpiTableHeader));
+ /*
+ * Set "ACPI PM timer good" flag.
+ *
+ * Tells Windows guests that our ACPI PM timer is reliable in the
+ * sense that guest can read it only once to obtain a reliable value.
+ * Which avoids costly VMExits caused by guest re-reading it unnecessarily.
+ */
+ build_append_int_noprefix(table_data, 1 << 1 /* ACPI PM timer good */, 4);
+
+ build_header(linker, table_data, (void *)(table_data->data + waet_start),
+ "WAET", table_data->len - waet_start, 1, NULL, NULL);
+}
+
/*
* IVRS table as specified in AMD IOMMU Specification v2.62, Section 5.2
* accessible here http://support.amd.com/TechDocs/48882_IOMMU.pdf
@@ -2859,6 +2887,9 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
machine->nvdimms_state, machine->ram_slots);
}
+ acpi_add_table(table_offsets, tables_blob);
+ build_waet(tables_blob, tables->linker);
+
/* Add tables supplied by user (if any) */
for (u = acpi_table_first(); u; u = acpi_table_next(u)) {
unsigned len = acpi_table_len(u);
--
MST
next prev parent reply other threads:[~2020-05-04 14:47 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-04 14:29 [PULL 00/29] virtio,acpi,pci,pc: backlog from pre-5.0 Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 01/29] hw/pci/pcie: Forbid hot-plug if it's disabled on the slot Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 02/29] hw/pci/pcie: Replace PCI_DEVICE() casts with existing variable Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 03/29] move 'typedef Aml' to qemu/types.h Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 04/29] acpi: add aml builder stubs Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 05/29] qtest: allow DSDT acpi table changes Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 06/29] acpi: drop pointless _STA method Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 07/29] acpi: add ISADeviceClass->build_aml() Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 08/29] rtc: add RTC_ISA_BASE Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 09/29] virtio-vga: fix virtio-vga bar ordering Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 10/29] virtio-pci: update virtio pci bar layout documentation Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 11/29] vhost-user-blk: fix invalid memory access Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 12/29] checkpatch: fix acpi check with multiple file name Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 13/29] checkpatch: ignore allowed diff list Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 14/29] acpi: DSDT without _STA Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 15/29] hw/acpi/nvdimm: Fix for NVDIMM incorrect DSM output buffer length Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 16/29] nvdimm: Use configurable ACPI IO base and size Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 17/29] hw/arm/virt: Add nvdimm hot-plug infrastructure Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 18/29] hw/arm/virt: Add nvdimm hotplug support Michael S. Tsirkin
2020-05-04 14:29 ` [PULL 19/29] tests: Update ACPI tables list for upcoming arm/virt test changes Michael S. Tsirkin
2020-05-04 14:30 ` [PULL 20/29] bios-tables-test: test pc-dimm and nvdimm coldplug for arm/virt Michael S. Tsirkin
2020-05-04 14:30 ` [PULL 21/29] tests/acpi: add expected tables for bios-tables-test Michael S. Tsirkin
2020-05-04 14:30 ` [PULL 22/29] Refactor vhost_user_set_mem_table functions Michael S. Tsirkin
2020-05-04 14:30 ` [PULL 23/29] acpi: unit-test: Ignore diff in WAET ACPI table Michael S. Tsirkin
2020-05-04 14:30 ` Michael S. Tsirkin [this message]
2020-05-04 14:30 ` [PULL 25/29] acpi: unit-test: Update WAET ACPI Table expected binaries Michael S. Tsirkin
2020-05-04 14:30 ` [PULL 26/29] hw/i386/pc: Create 'vmport' device in place Michael S. Tsirkin
2020-05-04 14:30 ` [PULL 27/29] hw/i386/vmport: Remove unused 'hw/input/i8042.h' include Michael S. Tsirkin
2020-05-04 14:30 ` [PULL 28/29] hw/i386: Add 'vmport.h' local header Michael S. Tsirkin
2020-05-04 14:30 ` [PULL 29/29] hw/i386: Make vmmouse helpers static Michael S. Tsirkin
2020-05-04 19:35 ` [PULL 00/29] virtio,acpi,pci,pc: backlog from pre-5.0 Peter Maydell
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=20200504142814.157589-25-mst@redhat.com \
--to=mst@redhat.com \
--cc=ehabkost@redhat.com \
--cc=elad.gabay@oracle.com \
--cc=imammedo@redhat.com \
--cc=liran.alon@oracle.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).