From patchwork Fri Jul 5 14:35:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Montes, Julio" X-Patchwork-Id: 11032771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 960D513A4 for ; Fri, 5 Jul 2019 14:37:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8259A28A45 for ; Fri, 5 Jul 2019 14:37:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 727E4203B9; Fri, 5 Jul 2019 14:37:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8C4AF203B9 for ; Fri, 5 Jul 2019 14:37:47 +0000 (UTC) Received: from localhost ([::1]:53758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjPLN-0002P1-Fe for patchwork-qemu-devel@patchwork.kernel.org; Fri, 05 Jul 2019 10:37:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51446) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjPK6-0001MQ-Ub for qemu-devel@nongnu.org; Fri, 05 Jul 2019 10:36:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjPK2-0000Qf-Vg for qemu-devel@nongnu.org; Fri, 05 Jul 2019 10:36:24 -0400 Received: from mga01.intel.com ([192.55.52.88]:33639) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hjPK2-0008Cw-NQ for qemu-devel@nongnu.org; Fri, 05 Jul 2019 10:36:22 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jul 2019 07:36:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,455,1557212400"; d="scan'208";a="164878137" Received: from unknown (HELO fedora.zpn.intel.com.) ([10.219.4.39]) by fmsmga008.fm.intel.com with ESMTP; 05 Jul 2019 07:36:13 -0700 From: Julio Montes To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 14:35:53 +0000 Message-Id: <20190705143554.10295-1-julio.montes@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190703154958.29004-1-julio.montes@intel.com> References: <20190703154958.29004-1-julio.montes@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.88 Subject: [Qemu-devel] [PATCH v2 1/2] Makefile: generate header file with the list of devices enabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julio Montes , pbonzini@redhat.com, sgarzare@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP v2: generate config-devices.h which contains the list of devices enabled --- config-devices.h is an auto-generated header file that will use config-devices.mak to define the list of devices enabled. Configs that are set to 'n' are ignored. Signed-off-by: Julio Montes --- Makefile.target | 5 +++++ scripts/clean-includes | 2 +- scripts/create_config | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) -- 2.17.2 diff --git a/Makefile.target b/Makefile.target index a6919e0caf..65eda0994d 100644 --- a/Makefile.target +++ b/Makefile.target @@ -45,6 +45,9 @@ include $(SRC_PATH)/tests/tcg/Makefile.include config-target.h: config-target.h-timestamp config-target.h-timestamp: config-target.mak +config-devices.h: config-devices.h-timestamp +config-devices.h-timestamp: config-devices.mak + ifdef CONFIG_TRACE_SYSTEMTAP stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp $(QEMU_PROG)-simpletrace.stp $(QEMU_PROG)-log.stp @@ -170,6 +173,8 @@ generated-files-y += hmp-commands.h hmp-commands-info.h endif # CONFIG_SOFTMMU +generated-files-y += config-devices.h + dummy := $(call unnest-vars,,obj-y) all-obj-y := $(obj-y) diff --git a/scripts/clean-includes b/scripts/clean-includes index dd938daa3e..fb05a639d5 100755 --- a/scripts/clean-includes +++ b/scripts/clean-includes @@ -161,7 +161,7 @@ for f in "$@"; do # Remove includes that osdep.h already provides perl -n -i -e 'print if !/\s*#\s*include\s*(["<][^>"]*[">])/ || ! (grep { $_ eq $1 } qw ( - "config-host.h" "config-target.h" "qemu/compiler.h" + "config-host.h" "config-target.h" "config-devices.h" "qemu/compiler.h" diff --git a/scripts/create_config b/scripts/create_config index d727e5e36e..00e86c82b0 100755 --- a/scripts/create_config +++ b/scripts/create_config @@ -58,6 +58,8 @@ case $line in name=${line%=*} echo "#define $name 1" ;; + CONFIG_*=n) # configuration + ;; CONFIG_*=*) # configuration name=${line%=*} value=${line#*=} From patchwork Fri Jul 5 14:35:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Montes, Julio" X-Patchwork-Id: 11032775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EB57714F6 for ; Fri, 5 Jul 2019 14:37:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAEB128A45 for ; Fri, 5 Jul 2019 14:37:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB7EB28AB7; Fri, 5 Jul 2019 14:37:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7471A28AB0 for ; Fri, 5 Jul 2019 14:37:54 +0000 (UTC) Received: from localhost ([::1]:53760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjPLV-0002Z2-LF for patchwork-qemu-devel@patchwork.kernel.org; Fri, 05 Jul 2019 10:37:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51474) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjPKA-0001O9-9X for qemu-devel@nongnu.org; Fri, 05 Jul 2019 10:36:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjPK8-0000nb-6B for qemu-devel@nongnu.org; Fri, 05 Jul 2019 10:36:30 -0400 Received: from mga01.intel.com ([192.55.52.88]:33643) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hjPK7-0000Ey-T5 for qemu-devel@nongnu.org; Fri, 05 Jul 2019 10:36:28 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jul 2019 07:36:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,455,1557212400"; d="scan'208";a="164878162" Received: from unknown (HELO fedora.zpn.intel.com.) ([10.219.4.39]) by fmsmga008.fm.intel.com with ESMTP; 05 Jul 2019 07:36:19 -0700 From: Julio Montes To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 14:35:54 +0000 Message-Id: <20190705143554.10295-2-julio.montes@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190705143554.10295-1-julio.montes@intel.com> References: <20190703154958.29004-1-julio.montes@intel.com> <20190705143554.10295-1-julio.montes@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.88 Subject: [Qemu-devel] [PATCH v2 2/2] hw/i386: Fix linker error when ISAPC is disabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julio Montes , pbonzini@redhat.com, sgarzare@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP v2: include config-devices.h to use CONFIG_IDE_ISA --- In pc_init1(), ISA IDE is initialized without checking if ISAPC or IDE_ISA configs are enabled. This results in a link error when CONFIG_ISAPC is set to 'n' in the file default-configs/i386-softmmu.mak: hw/i386/pc_piix.o: In function `pc_init1': hw/i386/pc_piix.c:261: undefined reference to `isa_ide_init' hw/i386/pc_piix.c:261: undefined reference to `isa_ide_init' Place ide_isa code under #ifdef CONFIG_IDE_ISA to fix linker errors Signed-off-by: Julio Montes --- hw/i386/pc_piix.c | 11 ++++++++--- include/qemu/osdep.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) -- 2.17.2 diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index f29de58636..c7d4645a3f 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -61,9 +61,11 @@ #define MAX_IDE_BUS 2 +#ifdef CONFIG_IDE_ISA 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 }; +#endif /* PC hardware initialisation */ static void pc_init1(MachineState *machine, @@ -254,7 +256,10 @@ static void pc_init1(MachineState *machine, } idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0"); idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1"); - } else { + pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); + } +#ifdef CONFIG_IDE_ISA +else { for(i = 0; i < MAX_IDE_BUS; i++) { ISADevice *dev; char busname[] = "ide.0"; @@ -268,9 +273,9 @@ static void pc_init1(MachineState *machine, busname[4] = '0' + i; idebus[i] = qdev_get_child_bus(DEVICE(dev), busname); } + pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); } - - pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); +#endif if (pcmc->pci_enabled && machine_usb(machine)) { pci_create_simple(pci_bus, piix3_devfn + 2, "piix3-usb-uhci"); diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index af2b91f0b8..f1c682e52c 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -29,6 +29,7 @@ #include "config-host.h" #ifdef NEED_CPU_H +#include "config-devices.h" #include "config-target.h" #else #include "exec/poison.h"