From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: imammedo@redhat.com, dgilbert@redhat.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH 7/4] pc: go back to smaller ACPI tables
Date: Wed, 24 Dec 2014 14:12:46 +0100 [thread overview]
Message-ID: <1419426766-1593-8-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1419426766-1593-1-git-send-email-pbonzini@redhat.com>
The new algorithm introduced by the previous patch lets us make tables
smaller and avoid migration bugs due to large tables.
Use it for 2.3+ machine types by tweaking the default fixed_table_align
and acpi_table_align values. At the same time, preserve backwards-compatible
logic for pc-i440fx-2.2.
Without this patch:
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x0000000007fdffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000007fe0000-0x0000000007ffffff] reserved
...
[ 0.000000] init_memory_mapping: [mem 0x07000000-0x07fdffff] usable
[ 0.000000] RAMDISK: [mem 0x07112000-0x07fdffff]
With this patch:
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x0000000007ffafff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000007ffb000-0x0000000007ffffff] reserved
...
[ 0.000000] init_memory_mapping: [mem 0x07000000-0x07ffafff]
[ 0.000000] RAMDISK: [mem 0x07122000-0x07feffff]
Thanks to the new linuxboot option ROM, the initrd is loaded 64k above.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/i386/pc_piix.c | 8 +++++---
hw/i386/pc_q35.c | 6 ++++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 16de5c9..a5e36b9 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -61,8 +61,8 @@ static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
static bool has_acpi_build = true;
static int legacy_acpi_table_size;
-static int fixed_table_align = 0;
-static int acpi_table_align = 131072;
+static int fixed_table_align = 16384;
+static int acpi_table_align = 4096;
static bool smbios_defaults = true;
static bool smbios_legacy_mode;
static bool smbios_uuid_encoded = true;
@@ -332,6 +332,8 @@ static void pc_compat_2_2(MachineState *machine)
x86_cpu_compat_set_features("Haswell", FEAT_1_ECX, 0, CPUID_EXT_RDRAND);
x86_cpu_compat_set_features("Broadwell", FEAT_1_ECX, 0, CPUID_EXT_F16C);
x86_cpu_compat_set_features("Broadwell", FEAT_1_ECX, 0, CPUID_EXT_RDRAND);
+ fixed_table_align = 0;
+ acpi_table_align = 131072;
}
static void pc_compat_2_1(MachineState *machine)
@@ -348,7 +350,6 @@ static void pc_compat_2_1(MachineState *machine)
static void pc_compat_2_0(MachineState *machine)
{
- pc_compat_2_1(machine);
/* This value depends on the actual DSDT and SSDT compiled into
* the source QEMU; unfortunately it depends on the binary and
* not on the machine type, so we cannot make pc-i440fx-1.7 work on
@@ -365,6 +366,7 @@ static void pc_compat_2_0(MachineState *machine)
* 6652 is valid for QEMU 2.0, the right value for pc-i440fx-1.7 on
* QEMU 1.7 it is 6414. For RHEL/CentOS 7.0 it is 6418.
*/
+ pc_compat_2_1(machine);
legacy_acpi_table_size = 6652;
acpi_table_align = 4096;
smbios_legacy_mode = true;
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 7ba0535..4fd9527 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -155,10 +155,12 @@ static void pc_q35_init(MachineState *machine)
guest_info->has_acpi_build = has_acpi_build;
guest_info->has_reserved_memory = has_reserved_memory;
- /* Migration was not supported in 2.0 for Q35, so do not bother
- * with this hack (see hw/i386/acpi-build.c).
+ /* Migration was not supported in 2.0 for Q35, so do not bother with
+ * hacks around the ACPI table size (see hw/i386/acpi-build.c).
*/
guest_info->legacy_acpi_table_size = 0;
+ guest_info->fixed_table_align = 16384;
+ guest_info->acpi_table_align = 4096;
if (smbios_defaults) {
MachineClass *mc = MACHINE_GET_CLASS(machine);
--
1.8.3.1
next prev parent reply other threads:[~2014-12-24 13:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-24 13:12 [Qemu-devel] [PATCH 0/4] acpi: move common parts of the SSDT to the DSDT (and preview of things to come) Paolo Bonzini
2014-12-24 13:12 ` [Qemu-devel] [PATCH 1/4] pc: append ssdt-misc.dsl to the DSDT Paolo Bonzini
2014-12-24 13:12 ` [Qemu-devel] [PATCH 2/4] pc: rename ssdt-misc to dsdt-common Paolo Bonzini
2014-12-24 13:12 ` [Qemu-devel] [PATCH 3/4] pc: move common parts of the DSDT " Paolo Bonzini
2014-12-24 13:12 ` [Qemu-devel] [PATCH 4/4] pc: merge DSDT common parts into acpi-dsdt-common.dsl Paolo Bonzini
2014-12-24 13:12 ` [Qemu-devel] [PATCH 5/4] pc: introduce new ACPI table sizing algorithm Paolo Bonzini
2014-12-24 13:12 ` [Qemu-devel] [PATCH 6/4] pc: clean up pre-2.1 compatibility code Paolo Bonzini
2014-12-24 13:12 ` Paolo Bonzini [this message]
2014-12-24 13:17 ` [Qemu-devel] [PATCH 0/4] acpi: move common parts of the SSDT to the DSDT (and preview of things to come) Paolo Bonzini
2014-12-24 14:19 ` Michael S. Tsirkin
2014-12-24 14:43 ` Paolo Bonzini
2014-12-24 16:15 ` Michael S. Tsirkin
2015-01-19 12:22 ` Paolo Bonzini
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=1419426766-1593-8-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=dgilbert@redhat.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.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).