From patchwork Tue Aug 12 14:40:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 379385 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3F4761400AA for ; Wed, 13 Aug 2014 00:41:05 +1000 (EST) Received: from localhost ([::1]:42579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHDG3-00063o-FY for incoming@patchwork.ozlabs.org; Tue, 12 Aug 2014 10:41:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHDFY-0005gg-P1 for qemu-devel@nongnu.org; Tue, 12 Aug 2014 10:40:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHDFR-00069I-Qb for qemu-devel@nongnu.org; Tue, 12 Aug 2014 10:40:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHDFR-00069D-BX for qemu-devel@nongnu.org; Tue, 12 Aug 2014 10:40:25 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7CEeMko012039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Aug 2014 10:40:22 -0400 Received: from blackfin.pond.sub.org (ovpn-116-43.ams2.redhat.com [10.36.116.43]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7CEeILg018437 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 12 Aug 2014 10:40:21 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 72B1B3046034; Tue, 12 Aug 2014 16:40:17 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 12 Aug 2014 16:40:17 +0200 Message-Id: <1407854417-32071-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: aliguori@amazon.com, mst@redhat.com Subject: [Qemu-devel] [PATCH] pc: Get rid of pci-info leftovers 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 pc_fw_cfg_guest_info() never does anything, because has_pci_info is always false. Introduced in commit f8c457b "pc: pass PCI hole ranges to Guests", disabled in commit 9604f70 "pc: disable pci-info for 1.6", and hasn't been enabled since. Obviously a dead end. Get of it. Signed-off-by: Markus Armbruster --- hw/i386/pc.c | 30 ------------------------------ hw/i386/pc_piix.c | 4 ---- hw/i386/pc_q35.c | 3 --- include/hw/i386/pc.h | 1 - 4 files changed, 38 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 9e58982..8fa8d2f 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1066,35 +1066,6 @@ typedef struct PcRomPciInfo { uint64_t w64_max; } PcRomPciInfo; -static void pc_fw_cfg_guest_info(PcGuestInfo *guest_info) -{ - PcRomPciInfo *info; - Object *pci_info; - bool ambiguous = false; - - if (!guest_info->has_pci_info || !guest_info->fw_cfg) { - return; - } - pci_info = object_resolve_path_type("", TYPE_PCI_HOST_BRIDGE, &ambiguous); - g_assert(!ambiguous); - if (!pci_info) { - return; - } - - info = g_malloc(sizeof *info); - info->w32_min = cpu_to_le64(object_property_get_int(pci_info, - PCI_HOST_PROP_PCI_HOLE_START, NULL)); - info->w32_max = cpu_to_le64(object_property_get_int(pci_info, - PCI_HOST_PROP_PCI_HOLE_END, NULL)); - info->w64_min = cpu_to_le64(object_property_get_int(pci_info, - PCI_HOST_PROP_PCI_HOLE64_START, NULL)); - info->w64_max = cpu_to_le64(object_property_get_int(pci_info, - PCI_HOST_PROP_PCI_HOLE64_END, NULL)); - /* Pass PCI hole info to guest via a side channel. - * Required so guest PCI enumeration does the right thing. */ - fw_cfg_add_file(guest_info->fw_cfg, "etc/pci-info", info, sizeof *info); -} - typedef struct PcGuestInfoState { PcGuestInfo info; Notifier machine_done; @@ -1106,7 +1077,6 @@ void pc_guest_info_machine_done(Notifier *notifier, void *data) PcGuestInfoState *guest_info_state = container_of(notifier, PcGuestInfoState, machine_done); - pc_fw_cfg_guest_info(&guest_info_state->info); acpi_setup(&guest_info_state->info); } diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 4f22be8..12d8c26 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -59,7 +59,6 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 }; static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 }; static const int ide_irq[MAX_IDE_BUS] = { 14, 15 }; -static bool has_pci_info; static bool has_acpi_build = true; static int legacy_acpi_table_size; static bool smbios_defaults = true; @@ -166,7 +165,6 @@ static void pc_init1(MachineState *machine, guest_info->has_acpi_build = has_acpi_build; guest_info->legacy_acpi_table_size = legacy_acpi_table_size; - guest_info->has_pci_info = has_pci_info; guest_info->isapc_ram_fw = !pci_enabled; guest_info->has_reserved_memory = has_reserved_memory; @@ -340,7 +338,6 @@ static void pc_compat_1_7(MachineState *machine) static void pc_compat_1_6(MachineState *machine) { pc_compat_1_7(machine); - has_pci_info = false; rom_file_has_mr = false; has_acpi_build = false; } @@ -422,7 +419,6 @@ static void pc_init_pci_no_kvmclock(MachineState *machine) static void pc_init_isa(MachineState *machine) { - has_pci_info = false; has_acpi_build = false; smbios_defaults = false; gigabyte_align = false; diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index c39ee98..3f8a465 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -49,7 +49,6 @@ /* ICH9 AHCI has 6 ports */ #define MAX_SATA_PORTS 6 -static bool has_pci_info; static bool has_acpi_build = true; static bool smbios_defaults = true; static bool smbios_legacy_mode; @@ -150,7 +149,6 @@ static void pc_q35_init(MachineState *machine) } guest_info = pc_guest_info_init(below_4g_mem_size, above_4g_mem_size); - guest_info->has_pci_info = has_pci_info; guest_info->isapc_ram_fw = false; guest_info->has_acpi_build = has_acpi_build; guest_info->has_reserved_memory = has_reserved_memory; @@ -296,7 +294,6 @@ static void pc_compat_1_7(MachineState *machine) static void pc_compat_1_6(MachineState *machine) { pc_compat_1_7(machine); - has_pci_info = false; rom_file_has_mr = false; has_acpi_build = false; } diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 863eefb..7eb742d 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -85,7 +85,6 @@ typedef struct PcPciInfo { #define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len" struct PcGuestInfo { - bool has_pci_info; bool isapc_ram_fw; hwaddr ram_size, ram_size_below_4g; unsigned apic_id_limit;