From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUePh-0006il-II for qemu-devel@nongnu.org; Thu, 18 Sep 2014 12:18:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUePY-0005f6-Hz for qemu-devel@nongnu.org; Thu, 18 Sep 2014 12:18:33 -0400 Received: from mail-qc0-x236.google.com ([2607:f8b0:400d:c01::236]:46678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUePY-0005cs-Dh for qemu-devel@nongnu.org; Thu, 18 Sep 2014 12:18:24 -0400 Received: by mail-qc0-f182.google.com with SMTP id i8so957492qcq.41 for ; Thu, 18 Sep 2014 09:18:19 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 18 Sep 2014 18:17:53 +0200 Message-Id: <1411057074-11157-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1411057074-11157-1-git-send-email-pbonzini@redhat.com> References: <1411057074-11157-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 5/6] pc: go back to smaller ACPI tables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: jsnow@redhat.com, mst@redhat.com The new algorithm introduced by the previous patch lets us make tables smaller and avoid bugs due to large tables. Use it for 2.2+ 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.1. Signed-off-by: Paolo Bonzini --- hw/i386/pc_piix.c | 19 ++++++++++++++++--- hw/i386/pc_q35.c | 6 ++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 1ecb281..1c3469f 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; /* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to @@ -299,6 +299,12 @@ static void pc_init_pci(MachineState *machine) pc_init1(machine, 1, 1); } +static void pc_compat_2_1(MachineState *machine) +{ + fixed_table_align = 0; + acpi_table_align = 131072; +} + static void pc_compat_2_0(MachineState *machine) { /* This value depends on the actual DSDT and SSDT compiled into @@ -317,6 +323,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; @@ -365,6 +372,12 @@ static void pc_compat_1_2(MachineState *machine) x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); } +static void pc_init_pci_2_1(MachineState *machine) +{ + pc_compat_2_1(machine); + pc_init_pci(machine); +} + static void pc_init_pci_2_0(MachineState *machine) { pc_compat_2_0(machine); @@ -468,7 +481,7 @@ static QEMUMachine pc_i440fx_machine_v2_2 = { static QEMUMachine pc_i440fx_machine_v2_1 = { PC_I440FX_2_1_MACHINE_OPTIONS, .name = "pc-i440fx-2.1", - .init = pc_init_pci, + .init = pc_init_pci_2_1, .compat_props = (GlobalProperty[]) { PC_COMPAT_2_1, { /* end of list */ } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 4b5a274..283956f 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -153,10 +153,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); -- 2.1.0