From patchwork Thu Jun 13 14:29:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 251084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 976CC2C008F for ; Fri, 14 Jun 2013 00:29:59 +1000 (EST) Received: from localhost ([::1]:56986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Un8XF-0003KZ-9P for incoming@patchwork.ozlabs.org; Thu, 13 Jun 2013 10:29:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Un8Wb-0003CY-BM for qemu-devel@nongnu.org; Thu, 13 Jun 2013 10:29:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Un8WY-0002BS-AM for qemu-devel@nongnu.org; Thu, 13 Jun 2013 10:29:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Un8WY-0002BH-2L for qemu-devel@nongnu.org; Thu, 13 Jun 2013 10:29:14 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5DETDvV024568 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 Jun 2013 10:29:13 -0400 Received: from redhat.com (vpn-203-103.tlv.redhat.com [10.35.203.103]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id r5DETBap012621; Thu, 13 Jun 2013 10:29:12 -0400 Date: Thu, 13 Jun 2013 17:29:55 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1371133655-10186-4-git-send-email-mst@redhat.com> References: <1371133655-10186-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1371133655-10186-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori Subject: [Qemu-devel] [PATCH RFC 3/3] acpi-build: disable acpi generation for compat X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When running with -M 1.5 and older, disable ACPI table generation, and don't expose ACPI tables to guest. Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 4 ++++ hw/i386/pc_piix.c | 12 ++++++++++-- hw/i386/pc_q35.c | 12 ++++++++++-- include/hw/i386/pc.h | 1 + 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 911c913..7e52457 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -966,6 +966,10 @@ void acpi_setup(PcGuestInfo *guest_info) ACPI_BUILD_DPRINTF(3, "No fw cfg. Boiling out.\n"); } + if (!guest_info->has_acpi_build) { + ACPI_BUILD_DPRINTF(3, "ACPI build disabled. Boiling out.\n"); + } + table_data = g_array_new(false, true /* clear */, 1); table_offsets = g_array_new(false, true /* clear */, sizeof(uint32_t)); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index e46f19a..eb11456 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -59,6 +59,7 @@ static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 }; static const int ide_irq[MAX_IDE_BUS] = { 14, 15 }; static bool has_pvpanic = true; +static bool has_acpi_build = true; /* PC hardware initialisation */ static void pc_init1(MemoryRegion *system_memory, @@ -124,6 +125,7 @@ static void pc_init1(MemoryRegion *system_memory, guest_info = pc_guest_info_init(below_4g_mem_size, above_4g_mem_size); + guest_info->has_acpi_build = has_acpi_build; guest_info->dsdt_code = AcpiDsdtAmlCode; guest_info->dsdt_size = sizeof AcpiDsdtAmlCode; @@ -266,12 +268,18 @@ static void pc_init_pci(QEMUMachineInitArgs *args) initrd_filename, cpu_model, 1, 1); } +static void pc_init_pci_1_5(QEMUMachineInitArgs *args) +{ + has_acpi_build = false; + pc_init_pci(args); +} + static void pc_init_pci_1_4(QEMUMachineInitArgs *args) { pc_sysfw_flash_vs_rom_bug_compatible = true; has_pvpanic = false; x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE); - pc_init_pci(args); + pc_init_pci_1_5(args); } static void pc_init_pci_1_3(QEMUMachineInitArgs *args) @@ -365,7 +373,7 @@ static QEMUMachine pc_i440fx_machine_v1_6 = { static QEMUMachine pc_i440fx_machine_v1_5 = { .name = "pc-i440fx-1.5", .desc = "Standard PC (i440FX + PIIX, 1996)", - .init = pc_init_pci, + .init = pc_init_pci_1_5, .hot_add_cpu = pc_hot_add_cpu, .max_cpus = 255, .compat_props = (GlobalProperty[]) { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index c11118a..e101112 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -49,6 +49,7 @@ #define MAX_SATA_PORTS 6 static bool has_pvpanic = true; +static bool has_acpi_build = true; /* PC hardware initialisation */ static void pc_q35_init(QEMUMachineInitArgs *args) @@ -109,6 +110,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args) } guest_info = pc_guest_info_init(below_4g_mem_size, above_4g_mem_size); + guest_info->has_acpi_build = has_acpi_build; guest_info->dsdt_code = Q35AcpiDsdtAmlCode; guest_info->dsdt_size = sizeof Q35AcpiDsdtAmlCode; @@ -216,12 +218,18 @@ static void pc_q35_init(QEMUMachineInitArgs *args) } } +static void pc_q35_init_1_5(QEMUMachineInitArgs *args) +{ + has_acpi_build = false; + pc_q35_init(args); +} + static void pc_q35_init_1_4(QEMUMachineInitArgs *args) { pc_sysfw_flash_vs_rom_bug_compatible = true; has_pvpanic = false; x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE); - pc_q35_init(args); + pc_q35_init_1_5(args); } static QEMUMachine pc_q35_machine_v1_6 = { @@ -237,7 +245,7 @@ static QEMUMachine pc_q35_machine_v1_6 = { static QEMUMachine pc_q35_machine_v1_5 = { .name = "pc-q35-1.5", .desc = "Standard PC (Q35 + ICH9, 2009)", - .init = pc_q35_init, + .init = pc_q35_init_1_5, .hot_add_cpu = pc_hot_add_cpu, .max_cpus = 255, .compat_props = (GlobalProperty[]) { diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 80c9e71..722d7d0 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -51,6 +51,7 @@ struct PcGuestInfo { uint64_t mcfg_base; const unsigned char *dsdt_code; unsigned dsdt_size; + bool has_acpi_build; FWCfgState *fw_cfg; };