From mboxrd@z Thu Jan 1 00:00:00 1970 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 Date: Thu, 13 Jun 2013 17:29:55 +0300 From: "Michael S. Tsirkin" 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1371133655-10186-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PATCH RFC 3/3] acpi-build: disable acpi generation for compat List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori 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; }; -- MST