From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557953760; cv=none; d=zoho.com; s=zohoarc; b=NTg+0t5hgwoZ4ziXIkj+bLgejo3mc71NIVGSkSm1bRNUAv33OZt3V8bDfuBcEYUgrH7rvay4VUfHUHbamDFGOB4533cHFiHLVNWtFyfu6uIyeFvDs4xtNypZTUpGcDTxr46QNPRuTKEaDXI9B/UC0BZMpLYOlTDrUXzkg6dmXPs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557953760; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ksd5gEIcY+QoUlSKP+SWjLmpp8fnt8dPufeYpO0k2gs=; b=AH92De9usJqtm60geoj10+G52f0C1tgHqG0q3b3GR25mEYumDIR8gqgJPs1uHHchusVfaR31L/xHfcTa42wMNHRmxNW/AnrjHAkGekrB8qZD0VrIbWC6/IYVpp9DhGDS37Zb275922IOoYhFv4LC2efAk3nF2G2DU0xtxWAHIQw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557953760760891.2054004923248; Wed, 15 May 2019 13:56:00 -0700 (PDT) Received: from localhost ([127.0.0.1]:42367 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0vy-0001BJ-SL for importer@patchew.org; Wed, 15 May 2019 16:55:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rH-0005lV-OA for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0rG-000162-QC for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50126) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rG-00015X-IN for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:38 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C660630027C9 for ; Wed, 15 May 2019 20:50:37 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id D73565C557; Wed, 15 May 2019 20:50:36 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:13 +0200 Message-Id: <1557953433-19663-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 15 May 2019 20:50:37 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/21] hw/input: Add a CONFIG_PS2 switch for the ps2.c file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Thomas Huth ps2.c only needs to be compiled if we are building pckbd.c or pl050.c. Signed-off-by: Thomas Huth Message-Id: <20190411182240.5957-1-thuth@redhat.com> Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini --- hw/input/Kconfig | 5 +++++ hw/input/Makefile.objs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/input/Kconfig b/hw/input/Kconfig index 889363d..287f088 100644 --- a/hw/input/Kconfig +++ b/hw/input/Kconfig @@ -8,10 +8,15 @@ config LM832X config PCKBD bool default y + select PS2 depends on ISA_BUS =20 config PL050 bool + select PS2 + +config PS2 + bool =20 config STELLARIS_INPUT bool diff --git a/hw/input/Makefile.objs b/hw/input/Makefile.objs index d1de307..a1bc502 100644 --- a/hw/input/Makefile.objs +++ b/hw/input/Makefile.objs @@ -3,7 +3,7 @@ common-obj-y +=3D hid.o common-obj-$(CONFIG_LM832X) +=3D lm832x.o common-obj-$(CONFIG_PCKBD) +=3D pckbd.o common-obj-$(CONFIG_PL050) +=3D pl050.o -common-obj-y +=3D ps2.o +common-obj-$(CONFIG_PS2) +=3D ps2.o common-obj-$(CONFIG_STELLARIS_INPUT) +=3D stellaris_input.o common-obj-$(CONFIG_TSC2005) +=3D tsc2005.o =20 --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557953569; cv=none; d=zoho.com; s=zohoarc; b=Ye+aRSJJUD+AwHtZJWAXJmwrN/eT2nUdrRdAgiVnTIwG1UPctJTNMYdI94ujZLukIypwHwG80tMk0dc5of3zG4exPH3tIkL2MZihPgp7jEY/oixAcC/n1H7BkuWOAE1204P2wFhRvrJO8ykETkKQUL+C1aC1Vmg0ZW8Cvy0V1Os= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557953569; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ycIAkl/meFMKLJJ1gJCitjGJF9VbEGHkNZBZ6juDMVQ=; b=f0F4Cvw83Ni3tJgLH3tSmoLi/EEZNtGhrF6HRBMr75VJcOFvlW0CSA5h090tpOfirAKeH/O6axnlJ/z+405j8sx0mm0eNIK5uZWM6YMcNW8sQolTjDfM4+RfwdkAuJTgNdPoGwCezVB2kjpjmxGtYMFvaWBSjt2+tnvY6+H1yBA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557953569263575.7896395549587; Wed, 15 May 2019 13:52:49 -0700 (PDT) Received: from localhost ([127.0.0.1]:42343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0tK-0007JD-7x for importer@patchew.org; Wed, 15 May 2019 16:52:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rK-0005lp-00 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0rI-00017o-1n for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45298) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rH-00016m-Rj for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:39 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F90683F44 for ; Wed, 15 May 2019 20:50:39 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 469D31820D; Wed, 15 May 2019 20:50:38 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:14 +0200 Message-Id: <1557953433-19663-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 15 May 2019 20:50:39 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/21] roms: assert if max rom size is less than the used size X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov It would ensure that we would notice attempt to write beyond the allocated buffer. In case of MemoryRegion backed ROM it's the host buffer and the guest RAM otherwise. assert can be triggered with: dd if=3D/dev/zero of=3D/tmp/blob bs=3D63k count=3D1 qemu-system-x86_64 `for i in {1..33}; do echo -n " -acpitable /tmp/blob"= ; done` Fixes: (a1666142db acpi-build: make ROMs RAM blocks resizeable) Reported-by: Wei Yang Signed-off-by: Igor Mammedov Message-Id: <1554982098-336210-1-git-send-email-imammedo@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/core/loader.c b/hw/core/loader.c index fe5cb24..a097bbe 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -1025,6 +1025,7 @@ MemoryRegion *rom_add_blob(const char *name, const vo= id *blob, size_t len, rom->addr =3D addr; rom->romsize =3D max_len ? max_len : len; rom->datasize =3D len; + g_assert(rom->romsize >=3D rom->datasize); rom->data =3D g_malloc0(rom->datasize); memcpy(rom->data, blob, len); rom_insert(rom); --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557953577; cv=none; d=zoho.com; s=zohoarc; b=ErqT5yIleHop9u++oIYIt8ttK+b72UDUcIPay8oGzaS24kkbnurJwlPCmB08ijEI9sUz8DfPfqmzbJ7P+7BHDl9jJcKLsNjspD5rJG2q9WJt7p5FEDGxfcffCJu3b/vDVRniavGQlTXSD/Q/KJLZm6SJqCdyxthW9Y0HqK67xf8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557953577; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=sBCphF5rEMFx6rNrhY1nL+dhgGLTzMDELPw2ChlNZeM=; b=JS9L/fVcHMkh2rScNI5CyTa4QCdjg1r3jZJVIvmHuUuoE0wD9SmFHjpCXOpXaldBgP14lhRDFYpIl++UmbVPXH7yafgZvUgYbHicx024wsR/qR14U8t6enJktSpzp8YLTBNAsP7oTuB7X6uSVHIj4fC+n1Ua+p5udoPwVPmdjJ4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557953577433589.1517467567113; Wed, 15 May 2019 13:52:57 -0700 (PDT) Received: from localhost ([127.0.0.1]:42345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0tS-0007Oy-99 for importer@patchew.org; Wed, 15 May 2019 16:52:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rN-0005oj-Sm for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0rM-0001A2-11 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39354) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rJ-00018S-U2 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:43 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 913AC30820C9 for ; Wed, 15 May 2019 20:50:40 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4CEB1820D; Wed, 15 May 2019 20:50:39 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:15 +0200 Message-Id: <1557953433-19663-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 15 May 2019 20:50:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/21] Declare -realtime as deprecated X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth The old -realtime mlock=3Don|off parameter does exactly the same as the new -overcommit mem-lock=3Don|off parameter. Additionally, "-realtime" does not activate any additional "realtime" capabilities as the name might indicate. We should avoid to confuse the users this way, so let's deprecate the old -realtime option. Signed-off-by: Thomas Huth Reviewed-by: Eduardo Habkost Message-Id: <20190411175345.19414-1-thuth@redhat.com> --- qemu-deprecated.texi | 5 +++++ vl.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 842e71b..ab62dd7 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -72,6 +72,11 @@ backend settings instead of environment variables. To e= ase migration to the new format, the ``-audiodev-help'' option can be used to convert the current values of the environment variables to ``-audiodev'' options. =20 +@subsection -realtime (since 4.1) + +The @code{-realtime mlock=3Don|off} argument has been replaced by the +@code{-overcommit mem-lock=3Don|off} argument. + @section QEMU Machine Protocol (QMP) commands =20 @subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0) diff --git a/vl.c b/vl.c index b670951..2e44f7d 100644 --- a/vl.c +++ b/vl.c @@ -3927,6 +3927,8 @@ int main(int argc, char **argv, char **envp) } break; case QEMU_OPTION_realtime: + warn_report("'-realtime mlock=3D...' is deprecated, please= use " + "'-overcommit mem-lock=3D...' instead"); opts =3D qemu_opts_parse_noisily(qemu_find_opts("realtime"= ), optarg, false); if (!opts) { --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557953896; cv=none; d=zoho.com; s=zohoarc; b=erE7nrjptbwg/P5Bs4uVyLdKqwl+ELhLTQXEvuG6ntGf4fuOLHvRbW/CocgXXJ1eJJnExyY4w0zySiHNNlU+K5IKU6JH6gNzLnWC2c2y8EOLdVZ2RskuR1pcSPYDj1NFoByvrdkAtD9L5PFhUJ9Ovb01dXOLARZCrN7HLZ/FmnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557953896; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=oP+iMLHirci/0uXSU8Nor0fZqcdNqIGj5bINNmugr1w=; b=P2VxPFMXxmCdvQUyF4t7KEeCyF4GPJcNoVyq+bevsdWBNBYHr9T6zeZMvLedQRrJMB01aoKpXc2OVdEnHJWK6l3ci0r9Hyj1pnSnrLJclVHiuiPxZ9eMRIn93nn1TFhsbaQxJ05+yK+S9cV4o4dicpEcqLbSvI8MIe0cQjplRlc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557953896515887.6694813116981; Wed, 15 May 2019 13:58:16 -0700 (PDT) Received: from localhost ([127.0.0.1]:42427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0yb-0003sn-9E for importer@patchew.org; Wed, 15 May 2019 16:58:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rP-0005qU-TC for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0rO-0001Bu-1l for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39314) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rN-0001AT-Qt for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:45 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 29CB23001561 for ; Wed, 15 May 2019 20:50:44 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 13C1E5C5B0; Wed, 15 May 2019 20:50:40 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:16 +0200 Message-Id: <1557953433-19663-5-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 15 May 2019 20:50:44 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/21] vl: Add missing descriptions to the VGA adapters list X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Some VGA adapters do not contain an helpful description, this can be confusing: $ qemu-system-arm -M virt -vga help none std standard VGA cirrus Cirrus VGA (default) vmware VMWare SVGA xenfb Add a description to the missing adapters: $ qemu-system-arm -M virt -vga help none no graphic card std standard VGA cirrus Cirrus VGA (default) vmware VMWare SVGA xenfb Xen paravirtualized framebuffer Signed-off-by: Philippe Mathieu-Daud=C3=A9 Based-on: <20190412152713.16018-1-marcandre.lureau@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Paul Durrant Message-Id: <20190412163706.3878-1-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- vl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vl.c b/vl.c index 2e44f7d..f49b119 100644 --- a/vl.c +++ b/vl.c @@ -2018,6 +2018,7 @@ typedef struct VGAInterfaceInfo { static const VGAInterfaceInfo vga_interfaces[VGA_TYPE_MAX] =3D { [VGA_NONE] =3D { .opt_name =3D "none", + .name =3D "no graphic card", }, [VGA_STD] =3D { .opt_name =3D "std", @@ -2056,6 +2057,7 @@ static const VGAInterfaceInfo vga_interfaces[VGA_TYPE= _MAX] =3D { }, [VGA_XENFB] =3D { .opt_name =3D "xenfb", + .name =3D "Xen paravirtualized framebuffer", }, }; =20 --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557953582; cv=none; d=zoho.com; s=zohoarc; b=ZFbU18vUDKivBmmCkzCjjfOkjiwSdm0TpVc/N9ZLHQ5imsLFrhTjOvK4dpB0OMv5QfhHdsuBqp0zhnV0dq84Bhx/4LxYPNk0eUcbfwqiAiqDpxdIhJy/dzbdtIRB8z9pNgJWHRicTJA6GDdPWbsyMhG/5qKckVmu6dopQ7r6X5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557953582; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Mvs1tciu44YQE1SP5fr1/pFZrOqKFrSo/dxe14vrMKM=; b=AFDJSUco1xkyVVP0edNpBxJu7CvZQParVrKI5u3xpGO76TH+LffoFjhh+LB7Y+3R1wiNeVtXXUZdM6nQ2siSdkMAPYYgrSUPnWJMMquU0iUAEhP33813Q/97nIxs7foPTpC+X4lGrws/SZVu4ooD4mF2y6QCKrHdYnu9TgBPJog= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557953582991433.83209096347787; Wed, 15 May 2019 13:53:02 -0700 (PDT) Received: from localhost ([127.0.0.1]:42347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0tX-0007Ux-VG for importer@patchew.org; Wed, 15 May 2019 16:53:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rT-0005tp-JK for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0rR-0001E8-KA for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39322) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rP-0001CH-Md; Wed, 15 May 2019 16:50:47 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 13B6D3001561; Wed, 15 May 2019 20:50:46 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9FFF85C5B0; Wed, 15 May 2019 20:50:44 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:17 +0200 Message-Id: <1557953433-19663-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 15 May 2019 20:50:46 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/21] megasas: fix mapped frame size X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Lieven , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Lieven the current value of 1024 bytes (16 * MFI_FRAME_SIZE) we map is not enough = to hold the maximum number of scatter gather elements we advertise. We actually nee= d a maximum of 2048 bytes. This is 128 max sg elements * 16 bytes (sizeof (unio= n mfi_sgl)). Cc: qemu-stable@nongnu.org Signed-off-by: Peter Lieven Message-Id: <20190404121015.28634-1-pl@kamp.de> Reviewed-by: Hannes Reinecke Signed-off-by: Paolo Bonzini --- hw/scsi/megasas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index a56317e..5ad762d 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -477,7 +477,7 @@ static MegasasCmd *megasas_enqueue_frame(MegasasState *= s, { PCIDevice *pcid =3D PCI_DEVICE(s); MegasasCmd *cmd =3D NULL; - int frame_size =3D MFI_FRAME_SIZE * 16; + int frame_size =3D MEGASAS_MAX_SGE * sizeof(union mfi_sgl); hwaddr frame_size_p =3D frame_size; unsigned long index; =20 --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557953747; cv=none; d=zoho.com; s=zohoarc; b=Bg47+4bgJ5UBRld4Fd7z3havSiV5BjMeb49WLSRB3AX4UE0NpTyCgpcv9Exi0ml8IwPFYmqWuCObev0v1oY+dCjFsVbCeMI0aINu49iXQ21zCtObD/oaXqZn2uqBgWos+yyABfBfj02enOmzAf3/72zGXFgBey1RL1Le7wP4Xec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557953747; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=aWd5VlbKeI4mGeAVSqJlUr2ae6j+AcjGV5MR4BeX3N0=; b=NVJj37QzoCOip2NQE+2ZDyj5SqPyzlC+j0T/4FJlcBqO9Ajszi7g49zqYSR2QbcNR30pAJ9kXgHu392PfGgTdrckWIpQgvcXP1b+i3Weiq0L/awcIJydNf34v5+tcstLCTcmPLirIAxNuORC/Kjg6xRg1328k2cAEduTLPdZGLI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557953747152444.977465085194; Wed, 15 May 2019 13:55:47 -0700 (PDT) Received: from localhost ([127.0.0.1]:42369 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0w4-0001Hb-6D for importer@patchew.org; Wed, 15 May 2019 16:55:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rV-0005vt-Fr for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0rT-0001FV-JF for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46068) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rR-0001Cy-K8 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:50 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 74B9944FB1; Wed, 15 May 2019 20:50:47 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89D625C557; Wed, 15 May 2019 20:50:46 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:18 +0200 Message-Id: <1557953433-19663-7-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 15 May 2019 20:50:47 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 06/21] hvf: Add missing break statement X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Zhang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Chen Zhang via Qemu-devel In target/i386/hvf/hvf.c, a break statement was probably missing in `hvf_vcpu_exec()`, in handling EXIT_REASON_HLT. These lines seemed to be equivalent to `kvm_handle_halt()`. Signed-off-by: Chen Zhang Message-Id: <087F1D9C-109D-41D1-BE2C-CE5D840C981B@me.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini --- target/i386/hvf/hvf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index 42f9447..2751c81 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -708,6 +708,7 @@ int hvf_vcpu_exec(CPUState *cpu) !(idtvec_info & VMCS_IDT_VEC_VALID)) { cpu->halted =3D 1; ret =3D EXCP_HLT; + break; } ret =3D EXCP_INTERRUPT; break; --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557953761; cv=none; d=zoho.com; s=zohoarc; b=FjAzW7onzR8LujxpFYvCgXYT3tU69Vyr3zRNr6N2odV2qCG1030JBn11hIecRQrNntrD1ghoLhyLh4DJ2TKdgoafHy/GOkjXzUX+WmsFT96veRRj85Xv187nxB5I59+TMSXCCt8vvMGQlsLiZRa65TIF0AGG5gErLOMXeTNC4lE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557953761; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=azTxenNJpNZyQ3JNHsIfihcw081a+wKc4KEk3kK+jiI=; b=VCqx5GZWeJXkkTAbVr5o4B6Ye7ZxBeas0FrlT3ZNCeT+w2WdbNSB/XdSYub8N5t5Jb0jFteIynOzAaKB4NxfRs00Elbw2YT1wP7EGsr9v2RK1uOp+NsZ4zknMOCg329wegIZ4OdvnC/Ztpl8lCKWTnpIaUrx7osyS6y8gll1RCI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557953761456907.8750633086057; Wed, 15 May 2019 13:56:01 -0700 (PDT) Received: from localhost ([127.0.0.1]:42392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0wC-0001OG-Cy for importer@patchew.org; Wed, 15 May 2019 16:55:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rZ-000642-RS for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0rX-0001IM-KJ for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50194) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rX-0001Gy-CZ for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:55 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 091A7309264F; Wed, 15 May 2019 20:50:54 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC3475C5B0; Wed, 15 May 2019 20:50:47 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:19 +0200 Message-Id: <1557953433-19663-8-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 15 May 2019 20:50:54 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 07/21] vl: fix -sandbox parsing crash when seccomp support is disabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: otubo@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau $ ./x86_64-softmmu/qemu-system-x86_64 -sandbox off qemu-system-x86_64: -sandbox off: There is no option group 'sandbox' Segmentation fault Commit 5780760f5e ("seccomp: check TSYNC host capability") wrapped one use of the sandbox option group to produce a sensible error, it didn't do the same for another call to qemu_opts_parse_noisily(): (gdb) bt at util/qemu-option.c:829 #0 0x00000000105b36d8 in opts_parse (list=3D0x0, params=3D0x3ffffffffab5 = "off", permit_abbrev=3Dtrue, defaults=3Dfalse, errp=3D0x3ffffffff080) at util/qemu-option.c:829 #1 0x00000000105b3b74 in qemu_opts_parse_noisily (list=3D,= params=3D, permit_abbrev=3D) at util/qemu-op= tion.c:890 #2 0x0000000010024964 in main (argc=3D, argv=3D, envp=3D) at vl.c:3589 Fixes: 5780760f5ea6163939a5dabe7427318b4f07d1a2 Cc: david@gibson.dropbear.id.au Cc: otubo@redhat.com Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190429134757.13570-1-marcandre.lureau@redhat.com> Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier Signed-off-by: Paolo Bonzini --- vl.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/vl.c b/vl.c index f49b119..c8ca9ff 100644 --- a/vl.c +++ b/vl.c @@ -3896,17 +3896,19 @@ int main(int argc, char **argv, char **envp) qtest_log =3D optarg; break; case QEMU_OPTION_sandbox: -#ifdef CONFIG_SECCOMP - opts =3D qemu_opts_parse_noisily(qemu_find_opts("sandbox"), - optarg, true); + olist =3D qemu_find_opts("sandbox"); + if (!olist) { +#ifndef CONFIG_SECCOMP + error_report("-sandbox support is not enabled " + "in this QEMU binary"); +#endif + exit(1); + } + + opts =3D qemu_opts_parse_noisily(olist, optarg, true); if (!opts) { exit(1); } -#else - error_report("-sandbox support is not enabled " - "in this QEMU binary"); - exit(1); -#endif break; case QEMU_OPTION_add_fd: #ifndef _WIN32 --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557954083; cv=none; d=zoho.com; s=zohoarc; b=mZmIkPSXsyoUPlSWYA4+pczBgSVkWDgEk3fWY+cQ5UeQiMGN316fwVqgd8JjmHHCGHeMMR997nceWluEXrPGznfQS1UwggXX0pxcSz/D6HE/8iEyhQ2WsJ47mhvJ86J6EQlfGteB8QlqxgzcMi9bkc92dKUCG6XDe2kVGsHx5hI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557954083; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=IKVrIry5eXEHFaKmI+Ty9PEvcRFMfhGDYt2qbD9YMhQ=; b=GGESn8k8XLlFtsP94waFshbvZEwDY3NNq+yjxS3EJMBa2TneAfXjd4k8k982yejvim3Nr0IQ4JyODlFy6XShTSD+BJnWnzpU/802F/Trw99atws0hnN0WhtzEYz8Q/PAxGuvZluWT8IGb60Jh/oImR6yVD1mhVeV9E9U652oW78= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557954083202370.44236047399784; Wed, 15 May 2019 14:01:23 -0700 (PDT) Received: from localhost ([127.0.0.1]:42480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR11C-0006Gf-Rk for importer@patchew.org; Wed, 15 May 2019 17:00:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rZ-00062p-LR for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0rY-0001JK-DB for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33092) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rY-0001IS-53 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C3268553A; Wed, 15 May 2019 20:50:55 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80B415C557; Wed, 15 May 2019 20:50:54 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:20 +0200 Message-Id: <1557953433-19663-9-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 15 May 2019 20:50:55 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/21] memory: correct the comment to DIRTY_MEMORY_MIGRATION X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Yang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Wei Yang The dirty bit is DIRTY_MEMORY_MIGRATION. Correct the comment. Signed-off-by: Wei Yang Message-Id: <20190426020927.25470-1-richardw.yang@linux.intel.com> Signed-off-by: Paolo Bonzini --- memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memory.c b/memory.c index bb2b71e..3071c4b 100644 --- a/memory.c +++ b/memory.c @@ -2584,7 +2584,7 @@ void memory_global_dirty_log_start(void) =20 MEMORY_LISTENER_CALL_GLOBAL(log_global_start, Forward); =20 - /* Refresh DIRTY_LOG_MIGRATION bit. */ + /* Refresh DIRTY_MEMORY_MIGRATION bit. */ memory_region_transaction_begin(); memory_region_update_pending =3D true; memory_region_transaction_commit(); @@ -2594,7 +2594,7 @@ static void memory_global_dirty_log_do_stop(void) { global_dirty_log =3D false; =20 - /* Refresh DIRTY_LOG_MIGRATION bit. */ + /* Refresh DIRTY_MEMORY_MIGRATION bit. */ memory_region_transaction_begin(); memory_region_update_pending =3D true; memory_region_transaction_commit(); --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557953754; cv=none; d=zoho.com; s=zohoarc; b=RKstvs7hjReLMVLFxFlGbCqkmkvwZhXmb+aCf9VL/Yt70FTF+dgDoqgq8PvspgsgTTPY6/XnYkAcjs2Lj1uRSKDQ/3RE+ixl1a0EFIAvKH3Q/ufONNs16hCaG1z6OdRP3WkH/opUdRCqEMd1uDP+xqkwpICBZ5FL6oTr+f58pXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557953754; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=0v/3yGKHrVvVUppPGFigjho8SHhlb2YC4Qnr3hinZco=; b=EEx2UAJO7L7+TsjvryusiQRWkxZtTKTsxlJP4N+S/CkXiYMcYeoZ7X1pyQ4Usg/F0716HEgKSTYnY6aOmM36DIlIjxdr+6w4M6hPPp/vyynRcJHxDJNd/mQlPUqBeIJlF3DdbJhd5zxQmaFy7uk/Zsavj9gzroPhNZZc1hkz9fA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557953754965946.3647946595618; Wed, 15 May 2019 13:55:54 -0700 (PDT) Received: from localhost ([127.0.0.1]:42400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0wI-0001Tt-U3 for importer@patchew.org; Wed, 15 May 2019 16:55:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rb-00066D-Am for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0rZ-0001L7-WF for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34114) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rZ-0001K5-N2 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 02D9FC051684 for ; Wed, 15 May 2019 20:50:57 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0044D5C557; Wed, 15 May 2019 20:50:55 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:21 +0200 Message-Id: <1557953433-19663-10-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 15 May 2019 20:50:57 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/21] hw/acpi/piix4: Move TYPE_PIIX4_PM to a public header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Move the TYPE_PIIX4_PM definition to the corresponding header, so other files can use it. Signed-off-by: Philippe Mathieu-Daud=C3=83=C2=A9 Message-Id: <20190427144025.22880-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/acpi/piix4.c | 2 -- include/hw/acpi/piix4.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 9c079d6..160e730 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -92,8 +92,6 @@ typedef struct PIIX4PMState { MemHotplugState acpi_memory_hotplug; } PIIX4PMState; =20 -#define TYPE_PIIX4_PM "PIIX4_PM" - #define PIIX4_PM(obj) \ OBJECT_CHECK(PIIX4PMState, (obj), TYPE_PIIX4_PM) =20 diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h index 26c2370..57d7e1c 100644 --- a/include/hw/acpi/piix4.h +++ b/include/hw/acpi/piix4.h @@ -1,6 +1,8 @@ #ifndef HW_ACPI_PIIX4_H #define HW_ACPI_PIIX4_H =20 +#define TYPE_PIIX4_PM "PIIX4_PM" + Object *piix4_pm_find(void); =20 #endif --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557953910; cv=none; d=zoho.com; s=zohoarc; b=ZXqWJxW0iLh9xtKicDLQC0y5JT+Nx2NsiGaRbQNaZtj25W0QBfYUTuw7y3kneuy/odPfoM4r34MiDBOqAq5obXk6fBiwDzhGZt54GEaxjlSnLmrDlXnma0PFT0xptJNZm/phjbPaDQncZp+s9etZseaIjEEedF12VbDXLza086c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557953910; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=OwDSTBQTaJcaU98iCyiBgFi+7d9+aho0KxOe0Kkn31w=; b=cD5cn5ZZTpMqC/um5V7T9tkkNFkBtTad1hxFE+AIk7UU4uPvaJM5a7x5qx/exyb/6Q+9fKCzySTcBFNwC8U/i6nCAfqrIEEvyc/6UnNf6le8eJYWsobivUC2l9MmZFpT5Q4fkemRwpM7DYuSjMfwEQNukDp7cT6MRrCyhnHjUuo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15579539104241.5522534222333206; Wed, 15 May 2019 13:58:30 -0700 (PDT) Received: from localhost ([127.0.0.1]:42429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0ym-00042r-BM for importer@patchew.org; Wed, 15 May 2019 16:58:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rc-00067o-P1 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0rb-0001Mf-EY for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39420) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rb-0001LY-4T for qemu-devel@nongnu.org; Wed, 15 May 2019 16:50:59 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 74BEC30018E9 for ; Wed, 15 May 2019 20:50:58 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 778201820D; Wed, 15 May 2019 20:50:57 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:22 +0200 Message-Id: <1557953433-19663-11-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 15 May 2019 20:50:58 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/21] hw/i386/acpi: Add object_resolve_type_unambiguous to improve modularity X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 When building with CONFIG_Q35=3Dn, we get: LINK x86_64-softmmu/qemu-system-x86_64 /usr/bin/ld: hw/i386/acpi-build.o: in function `acpi_get_misc_info': /source/qemu/hw/i386/acpi-build.c:243: undefined reference to `ich9_lpc_f= ind' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:204: qemu-system-x86_64] Error 1 This is due to a dependency in acpi-build.c on the ICH9_LPC (via ich9_lpc_find) and PIIX4_PM (via piix4_pm_find) devices. To allow better modularity (compile acpi-build.c with only Q35/ICH9 or ISAPC/PIIX4), refactor the similar helper as object_resolve_type_unambiguous(). This way we relax the linker dependencies and can build the x86 targets with a selection of machines (instead of all of them). Signed-off-by: Philippe Mathieu-Daud=C3=83=C2=A9 Message-Id: <20190427144025.22880-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/acpi/piix4.c | 11 ----------- hw/i386/acpi-build.c | 20 ++++++++++++++++---- hw/isa/lpc_ich9.c | 11 ----------- include/hw/acpi/piix4.h | 2 -- include/hw/i386/ich9.h | 2 -- 5 files changed, 16 insertions(+), 30 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 160e730..c903e65 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -552,17 +552,6 @@ static void piix4_pm_realize(PCIDevice *dev, Error **e= rrp) piix4_pm_add_propeties(s); } =20 -Object *piix4_pm_find(void) -{ - bool ambig; - Object *o =3D object_resolve_path_type("", TYPE_PIIX4_PM, &ambig); - - if (ambig || !o) { - return NULL; - } - return o; -} - I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, qemu_irq sci_irq, qemu_irq smi_irq, int smm_enabled, DeviceState **piix4_pm) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 416da31..123ff2b 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -35,6 +35,7 @@ #include "hw/acpi/acpi-defs.h" #include "hw/acpi/acpi.h" #include "hw/acpi/cpu.h" +#include "hw/acpi/piix4.h" #include "hw/nvram/fw_cfg.h" #include "hw/acpi/bios-linker-loader.h" #include "hw/loader.h" @@ -164,10 +165,21 @@ static void init_common_fadt_data(Object *o, AcpiFadt= Data *data) *data =3D fadt; } =20 +static Object *object_resolve_type_unambiguous(const char *typename) +{ + bool ambig; + Object *o =3D object_resolve_path_type("", typename, &ambig); + + if (ambig || !o) { + return NULL; + } + return o; +} + static void acpi_get_pm_info(AcpiPmInfo *pm) { - Object *piix =3D piix4_pm_find(); - Object *lpc =3D ich9_lpc_find(); + Object *piix =3D object_resolve_type_unambiguous(TYPE_PIIX4_PM); + Object *lpc =3D object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); Object *obj =3D piix ? piix : lpc; QObject *o; pm->cpu_hp_io_base =3D 0; @@ -228,8 +240,8 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) =20 static void acpi_get_misc_info(AcpiMiscInfo *info) { - Object *piix =3D piix4_pm_find(); - Object *lpc =3D ich9_lpc_find(); + Object *piix =3D object_resolve_type_unambiguous(TYPE_PIIX4_PM); + Object *lpc =3D object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); assert(!!piix !=3D !!lpc); =20 if (piix) { diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index ac44aa5..031ee9c 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -624,17 +624,6 @@ static const MemoryRegionOps ich9_rst_cnt_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN }; =20 -Object *ich9_lpc_find(void) -{ - bool ambig; - Object *o =3D object_resolve_path_type("", TYPE_ICH9_LPC_DEVICE, &ambi= g); - - if (ambig) { - return NULL; - } - return o; -} - static void ich9_lpc_get_sci_int(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h index 57d7e1c..028bb53 100644 --- a/include/hw/acpi/piix4.h +++ b/include/hw/acpi/piix4.h @@ -3,6 +3,4 @@ =20 #define TYPE_PIIX4_PM "PIIX4_PM" =20 -Object *piix4_pm_find(void); - #endif diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 673d13d..046bcf3 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -81,8 +81,6 @@ typedef struct ICH9LPCState { qemu_irq gsi[GSI_NUM_PINS]; } ICH9LPCState; =20 -Object *ich9_lpc_find(void); - #define Q35_MASK(bit, ms_bit, ls_bit) \ ((uint##bit##_t)(((1ULL << ((ms_bit) + 1)) - 1) & ~((1ULL << ls_bit) - 1))) =20 --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557953915; cv=none; d=zoho.com; s=zohoarc; b=O2vO9fNEPaO0woL3WXOWacCoqtWhWwuyg19P/NFex33SP3VEujbe9RmDURQNsvp+TcZImSqwzfwZiItEn3454G583R9EDGb7V01ZSNKyAMdsuv2dUcczVS4Bekw7pPBELKjt7WhMAIwVmqjEH+KA3lkBmIj0V8cHm2FUcj6EbY0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557953915; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=aGPZbuRif1ETYcprBDuKkXwjz5L0r6IxBqF5KoCIOlU=; b=UgpoKI/N5dc10SJPsvz8hMI7cSCsoL7wEhAJyHfq1OFow+jn0yviJi4TDEPuZAAJpsrjjxbg+MNZ81Dfntd3xm3hXfmndKvZhjSrbt5+8ua53E8ly02jZqsmWlb3zvJjIpOmbyn2c0sffjtlJoqglX+ZdrtxDj9oiTqZWabh904= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557953915906304.31435726958534; Wed, 15 May 2019 13:58:35 -0700 (PDT) Received: from localhost ([127.0.0.1]:42433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0yu-0004Al-HR for importer@patchew.org; Wed, 15 May 2019 16:58:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rg-0006BX-13 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0re-0001QG-Uo for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33116) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0re-0001PC-Mp for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:02 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A4048553A for ; Wed, 15 May 2019 20:51:02 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB3135C5B0; Wed, 15 May 2019 20:50:58 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:23 +0200 Message-Id: <1557953433-19663-12-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 15 May 2019 20:51:02 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 11/21] hw/i386/acpi: Assert a pointer is not null BEFORE using it X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Commit 72c194f7e75c added a non-null check on the 'obj' pointer. Later, commit 500b11ea5095 added code which uses the 'obj' pointer _before_ the assertion check. Move the assertion _before_ the pointer use. Signed-off-by: Philippe Mathieu-Daud=C3=83=C2=A9 Message-Id: <20190427144025.22880-4-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 123ff2b..b4ec14e 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -186,6 +186,7 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) pm->pcihp_io_base =3D 0; pm->pcihp_io_len =3D 0; =20 + assert(obj); init_common_fadt_data(obj, &pm->fadt); if (piix) { /* w2k requires FADT(rev1) or it won't boot, keep PC compatible */ @@ -204,7 +205,6 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) pm->fadt.flags |=3D 1 << ACPI_FADT_F_RESET_REG_SUP; pm->cpu_hp_io_base =3D ICH9_CPU_HOTPLUG_IO_BASE; } - assert(obj); =20 /* The above need not be conditional on machine type because the reset= port * happens to be the same on PIIX (pc) and ICH9 (q35). */ --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557954085; cv=none; d=zoho.com; s=zohoarc; b=KDiSiwfcPgwhLcYYhsRUfV4ANXHAwMfY5ghPuvf1cDKQUhEIlK9gNiXCi+FFcIWNqBB/3P+ZJXIlZutD3IozSlxqRTXKFv7jJSe5rHKJ58PjzeU6RtarjCCc6fHcXcednA7G/FR1lra27QcAX1aby8ZyUvTFUhoYFioGx1hzc8o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557954085; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=P976zTY3vC2jPyLB2ky6apmBghJkKMPZZji2FFX2MHA=; b=g8KZcCYqcSXEYCIEF2VTTM39+nTRxlN6xuljqfrUNtqDX73KNFccF5JzhNXqgfKdDnKQEI+utPZYzMrST9SEx6QMscPqFgWGhIF9kASdRKfFfbuxKXFbmSRZ08ZlrTxrqurS0ZSTWF63/5KhLgFTjfit+vF1jjzYCpRSx7Ur7J4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557954085601772.5310609510401; Wed, 15 May 2019 14:01:25 -0700 (PDT) Received: from localhost ([127.0.0.1]:42491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR11Y-0006Va-3q for importer@patchew.org; Wed, 15 May 2019 17:01:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0ri-0006EQ-V9 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0rg-0001TM-MX for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48278) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rg-0001RT-Fj for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:04 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF5B1307D987; Wed, 15 May 2019 20:51:03 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80D3E5C557; Wed, 15 May 2019 20:51:02 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:24 +0200 Message-Id: <1557953433-19663-13-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 15 May 2019 20:51:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 12/21] mips-fulong2e: obey -vga none X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Do not create an ATI VGA if "-vga none" was passed on the command line. Cc: BALATON Zoltan Signed-off-by: Paolo Bonzini --- hw/mips/mips_fulong2e.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 9d7480e..05a5a82 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -349,10 +349,12 @@ static void mips_fulong2e_init(MachineState *machine) &smbus, &isa_bus); =20 /* GPU */ - dev =3D DEVICE(pci_create(pci_bus, -1, "ati-vga")); - qdev_prop_set_uint32(dev, "vgamem_mb", 16); - qdev_prop_set_uint16(dev, "x-device-id", 0x5159); - qdev_init_nofail(dev); + if (vga_interface_type !=3D VGA_NONE) { + dev =3D DEVICE(pci_create(pci_bus, -1, "ati-vga")); + qdev_prop_set_uint32(dev, "vgamem_mb", 16); + qdev_prop_set_uint16(dev, "x-device-id", 0x5159); + qdev_init_nofail(dev); + } =20 /* Populate SPD eeprom data */ spd_data =3D spd_data_generate(DDR, ram_size, &err); --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557953988; cv=none; d=zoho.com; s=zohoarc; b=VJrBO1J5cMv/9GE5zF47WggA5nr1hAeURWdwsW00PSwgw05+dwi0XADoORuKgNLDrqx1k3vaWkVQ8XTioBeMwhs2uFcsafyRXm5zmc0GwJHe1bvHzM9jiq+jnZjcJxz8xR+IyzyhLoy3BrL9nXDDIZVad+zDroVmHCI/qAtfYNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557953988; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=xSd9NyhNsh1/AQUn4SAS3Rcjs8NPgSZro0JZR+no1FM=; b=Fv5iA2236Srz8L5M8/xvuoxRGlL84BlI/dptUhM+j5B9aCda19O1rAA0O9U+/kmko0MHnO9uvSifjKABdNfkaGAXUDwjsvzYyif8m1IJnxG8mGEac7yY0r5qEhfhBa8ThST2pX3Pq9jhQIt0/z8bFuYUvi2crq15gsozuRogGBg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557953988827652.7558870937312; Wed, 15 May 2019 13:59:48 -0700 (PDT) Received: from localhost ([127.0.0.1]:42441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR102-0005Av-QF for importer@patchew.org; Wed, 15 May 2019 16:59:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rv-0006MH-Sc for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0ro-0001YG-7T for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34180) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0ri-0001Tp-TU for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:08 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E26F2C05B038 for ; Wed, 15 May 2019 20:51:04 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 314715C557 for ; Wed, 15 May 2019 20:51:03 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:25 +0200 Message-Id: <1557953433-19663-14-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 15 May 2019 20:51:04 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 13/21] sun4m: obey -vga none X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Do not create a TCX if "-vga none" was passed on the command line. Remove some dead code along the way to avoid big reindentation. Signed-off-by: Paolo Bonzini --- hw/sparc/sun4m.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index ca1e382..07d126a 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -850,7 +850,6 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, uint32_t initrd_size; DriveInfo *fd[MAX_FD]; FWCfgState *fw_cfg; - unsigned int num_vsimms; DeviceState *dev; SysBusDevice *s; =20 @@ -909,8 +908,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, error_report("Unsupported depth: %d", graphic_depth); exit (1); } - num_vsimms =3D 0; - if (num_vsimms =3D=3D 0) { + if (vga_interface_type !=3D VGA_NONE) { if (vga_interface_type =3D=3D VGA_CG3) { if (graphic_depth !=3D 8) { error_report("Unsupported depth: %d", graphic_depth); @@ -945,7 +943,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, } } =20 - for (i =3D num_vsimms; i < MAX_VSIMMS; i++) { + for (i =3D 0; i < MAX_VSIMMS; i++) { /* vsimm registers probed by OBP */ if (hwdef->vsimm[i].reg_base) { empty_slot_init(hwdef->vsimm[i].reg_base, 0x2000); --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557954171; cv=none; d=zoho.com; s=zohoarc; b=HRjWUEOtKaRq9tYBhWmQ9fvOstDNOrEksdrHmVdyceS1romrU9/H4xn38EgrpkO8SRcLkzaQr9S/B56/WtzOtqJ+/oKcv1TR5AUUGxAs67DDJXQRm72ra1aofWfYUcLemhwuo6mY80sn1zwxuZkQlatgB+LremWZx5wnyVX7uVg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557954171; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=W4fgSnYdzVos1g1z3YykwHtFp3ke/v96iAycu9c6qsY=; b=jp7PWJhS5QH9WHGSMYNH6NhJRMckPPX+Yyep6R7OjKIREF7/mT+YCxj9wCBzyY+aN5u1wuhBSOGsQSTMoHJDvs2fRsyWd/O2nvjxRS923bCFwELU05V3G/xFqP4Wdy2Zx5m4/AsbmkHh0YU2GKgOuOnrJQUJGT/BD6znHdUpoDU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557954171270370.60090706516087; Wed, 15 May 2019 14:02:51 -0700 (PDT) Received: from localhost ([127.0.0.1]:42501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR130-0007cZ-9F for importer@patchew.org; Wed, 15 May 2019 17:02:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0rw-0006O2-Pz for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0rt-0001aE-Qz for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45458) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rm-0001WL-JG for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:12 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 29E4983F44 for ; Wed, 15 May 2019 20:51:07 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63F685C557; Wed, 15 May 2019 20:51:05 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:26 +0200 Message-Id: <1557953433-19663-15-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 15 May 2019 20:51:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 14/21] trace: only include trace-event-subdirs when they are needed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Laurent Vivier Some directories are built only for softmmu targets, and the related trace-event-subdirs must do the same Signed-off-by: Laurent Vivier Reviewed-by: Stefan Hajnoczi Message-Id: <20190401141222.30034-2-lvivier@redhat.com> --- Makefile.objs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index cf065de..dda5bbc 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -127,11 +127,12 @@ rdmacm-mux-obj-y =3D contrib/rdmacm-mux/ trace-events-subdirs =3D trace-events-subdirs +=3D accel/kvm trace-events-subdirs +=3D accel/tcg -trace-events-subdirs +=3D audio trace-events-subdirs +=3D authz trace-events-subdirs +=3D block trace-events-subdirs +=3D chardev trace-events-subdirs +=3D crypto +ifeq ($(CONFIG_SOFTMMU),y) +trace-events-subdirs +=3D audio trace-events-subdirs +=3D hw/9pfs trace-events-subdirs +=3D hw/acpi trace-events-subdirs +=3D hw/alpha @@ -140,7 +141,6 @@ trace-events-subdirs +=3D hw/audio trace-events-subdirs +=3D hw/block trace-events-subdirs +=3D hw/block/dataplane trace-events-subdirs +=3D hw/char -trace-events-subdirs +=3D hw/display trace-events-subdirs +=3D hw/dma trace-events-subdirs +=3D hw/hppa trace-events-subdirs +=3D hw/i2c @@ -173,11 +173,14 @@ trace-events-subdirs +=3D hw/virtio trace-events-subdirs +=3D hw/watchdog trace-events-subdirs +=3D hw/xen trace-events-subdirs +=3D hw/gpio +trace-events-subdirs +=3D migration +trace-events-subdirs +=3D net +trace-events-subdirs +=3D ui +endif +trace-events-subdirs +=3D hw/display trace-events-subdirs +=3D io trace-events-subdirs +=3D linux-user -trace-events-subdirs +=3D migration trace-events-subdirs +=3D nbd -trace-events-subdirs +=3D net trace-events-subdirs +=3D qapi trace-events-subdirs +=3D qom trace-events-subdirs +=3D scsi @@ -189,7 +192,6 @@ trace-events-subdirs +=3D target/ppc trace-events-subdirs +=3D target/riscv trace-events-subdirs +=3D target/s390x trace-events-subdirs +=3D target/sparc -trace-events-subdirs +=3D ui trace-events-subdirs +=3D util =20 trace-events-files =3D $(SRC_PATH)/trace-events $(trace-events-subdirs:%= =3D$(SRC_PATH)/%/trace-events) --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557954660; cv=none; d=zoho.com; s=zohoarc; b=VjULdKHnZjoNIei1dOYBuZF5Aeq9L48RP6RlE9ePScT4jFO7bwbMH6AIK/IO7sQSHtNriczS0T59YfM1miTiHpkPOjgYeopI641V0SV/+Zc2Es3U+vsUJP1gYDyZRGvLI06QQT6dvgaxb+yjje/6Lkhc2dbC7MHKOmfXEVHai0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557954660; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=U29R4+WdUECfwpxG3tyaMd0d5HA5ejtFvc4ZZy532M4=; b=IDpHmdfak1POcz+eovTvCj74YVrxZQ2qybABOevsvC1SzUsvOtf+KxGDxj7ZO1cUI0wiJaEHTJZ6JGxUkwv2nU9MZGjKaQnhjMkxJcChr5nJ+t9HARjMcFcVOkKUuQxGqwCXdf4X0sX36vpSwdAp4YkracSNHZuIjKZGHcEbl+8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155795466079931.01397404125362; Wed, 15 May 2019 14:11:00 -0700 (PDT) Received: from localhost ([127.0.0.1]:42653 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR1Av-00056r-N0 for importer@patchew.org; Wed, 15 May 2019 17:10:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0s4-0006Wi-JW for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0s2-0001eo-Ic for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39464) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0ry-0001Wq-Nu for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:23 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 97F493019880 for ; Wed, 15 May 2019 20:51:08 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id A09245C5B0; Wed, 15 May 2019 20:51:07 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:27 +0200 Message-Id: <1557953433-19663-16-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 15 May 2019 20:51:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 15/21] build: replace GENERATED_FILES by generated-files-y X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Laurent Vivier When possible use generated-files-$(FLAG) to disable some targets (like KEYCODEMAP_FILES). Suggested-by: Paolo Bonzini Signed-off-by: Laurent Vivier Message-Id: <20190401141222.30034-3-lvivier@redhat.com> --- Makefile | 36 +++++++++++++++++------------------- Makefile.target | 6 +++--- target/s390x/Makefile.objs | 2 +- tests/Makefile.include | 26 +++++++++++++------------- 4 files changed, 34 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index 66d5c65..d9a3040 100644 --- a/Makefile +++ b/Makefile @@ -101,7 +101,7 @@ QEMU_PKGVERSION :=3D $(if $(PKGVERSION),$(PKGVERSION),$= (shell \ # Either "version (pkgversion)", or just "version" if pkgversion not set FULL_VERSION :=3D $(if $(QEMU_PKGVERSION),$(VERSION) ($(QEMU_PKGVERSION)),= $(VERSION)) =20 -GENERATED_FILES =3D qemu-version.h config-host.h qemu-options.def +generated-files-y =3D qemu-version.h config-host.h qemu-options.def =20 GENERATED_QAPI_FILES =3D qapi/qapi-builtin-types.h qapi/qapi-builtin-types= .c GENERATED_QAPI_FILES +=3D qapi/qapi-types.h qapi/qapi-types.c @@ -121,20 +121,18 @@ GENERATED_QAPI_FILES +=3D $(QAPI_MODULES:%=3Dqapi/qap= i-events-%.c) GENERATED_QAPI_FILES +=3D qapi/qapi-introspect.c qapi/qapi-introspect.h GENERATED_QAPI_FILES +=3D qapi/qapi-doc.texi =20 -GENERATED_FILES +=3D $(GENERATED_QAPI_FILES) +generated-files-y +=3D $(GENERATED_QAPI_FILES) =20 -GENERATED_FILES +=3D trace/generated-tcg-tracers.h +generated-files-y +=3D trace/generated-tcg-tracers.h =20 -GENERATED_FILES +=3D trace/generated-helpers-wrappers.h -GENERATED_FILES +=3D trace/generated-helpers.h -GENERATED_FILES +=3D trace/generated-helpers.c +generated-files-y +=3D trace/generated-helpers-wrappers.h +generated-files-y +=3D trace/generated-helpers.h +generated-files-y +=3D trace/generated-helpers.c =20 -ifdef CONFIG_TRACE_UST -GENERATED_FILES +=3D trace-ust-all.h -GENERATED_FILES +=3D trace-ust-all.c -endif +generated-files-$(CONFIG_TRACE_UST) +=3D trace-ust-all.h +generated-files-$(CONFIG_TRACE_UST) +=3D trace-ust-all.c =20 -GENERATED_FILES +=3D module_block.h +generated-files-y +=3D module_block.h =20 TRACE_HEADERS =3D trace-root.h $(trace-events-subdirs:%=3D%/trace.h) TRACE_SOURCES =3D trace-root.c $(trace-events-subdirs:%=3D%/trace.c) @@ -147,10 +145,10 @@ ifdef CONFIG_TRACE_UST TRACE_HEADERS +=3D trace-ust-root.h $(trace-events-subdirs:%=3D%/trace-ust= .h) endif =20 -GENERATED_FILES +=3D $(TRACE_HEADERS) -GENERATED_FILES +=3D $(TRACE_SOURCES) -GENERATED_FILES +=3D $(BUILD_DIR)/trace-events-all -GENERATED_FILES +=3D .git-submodule-status +generated-files-y +=3D $(TRACE_HEADERS) +generated-files-y +=3D $(TRACE_SOURCES) +generated-files-y +=3D $(BUILD_DIR)/trace-events-all +generated-files-y +=3D .git-submodule-status =20 trace-group-name =3D $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g') =20 @@ -281,7 +279,7 @@ KEYCODEMAP_FILES =3D \ ui/input-keymap-osx-to-qcode.c \ $(NULL) =20 -GENERATED_FILES +=3D $(KEYCODEMAP_FILES) +generated-files-$(CONFIG_SOFTMMU) +=3D $(KEYCODEMAP_FILES) =20 ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Ma= kefile.objs $(call quiet-command,\ @@ -643,10 +641,10 @@ clean: rm -f fsdev/*.pod scsi/*.pod rm -f qemu-img-cmds.h rm -f ui/shader/*-vert.h ui/shader/*-frag.h - @# May not be present in GENERATED_FILES + @# May not be present in generated-files-y rm -f trace/generated-tracers-dtrace.dtrace* rm -f trace/generated-tracers-dtrace.h* - rm -f $(foreach f,$(GENERATED_FILES),$(f) $(f)-timestamp) + rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp) rm -f qapi-gen-timestamp rm -rf qga/qapi-generated for d in $(ALL_SUBDIRS); do \ @@ -1062,7 +1060,7 @@ endif # CONFIG_WIN # rebuilt before other object files ifneq ($(wildcard config-host.mak),) ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOAL= S),,fail)) -Makefile: $(GENERATED_FILES) +Makefile: $(generated-files-y) endif endif =20 diff --git a/Makefile.target b/Makefile.target index ae02495..fdbe7c8 100644 --- a/Makefile.target +++ b/Makefile.target @@ -166,7 +166,7 @@ else obj-y +=3D hw/$(TARGET_BASE_ARCH)/ endif =20 -GENERATED_FILES +=3D hmp-commands.h hmp-commands-info.h +generated-files-y +=3D hmp-commands.h hmp-commands-info.h =20 endif # CONFIG_SOFTMMU =20 @@ -236,5 +236,5 @@ ifdef CONFIG_TRACE_SYSTEMTAP $(INSTALL_DATA) $(QEMU_PROG)-log.stp "$(DESTDIR)$(qemu_datadir)/../system= tap/tapset/$(QEMU_PROG)-log.stp" endif =20 -GENERATED_FILES +=3D config-target.h -Makefile: $(GENERATED_FILES) +generated-files-y +=3D config-target.h +Makefile: $(generated-files-y) diff --git a/target/s390x/Makefile.objs b/target/s390x/Makefile.objs index 68eeee3..312bf4f 100644 --- a/target/s390x/Makefile.objs +++ b/target/s390x/Makefile.objs @@ -12,7 +12,7 @@ obj-$(call lnot,$(CONFIG_TCG)) +=3D tcg-stub.o feat-src =3D $(SRC_PATH)/target/$(TARGET_BASE_ARCH)/ feat-dst =3D $(BUILD_DIR)/$(TARGET_DIR) ifneq ($(MAKECMDGOALS),clean) -GENERATED_FILES +=3D $(feat-dst)gen-features.h +generated-files-y +=3D $(feat-dst)gen-features.h endif =20 $(feat-dst)gen-features.h: $(feat-dst)gen-features.h-timestamp diff --git a/tests/Makefile.include b/tests/Makefile.include index 60de085..ad95a14 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -468,19 +468,19 @@ qapi-schema +=3D unknown-expr-key.json =20 check-qapi-schema-y :=3D $(addprefix tests/qapi-schema/, $(qapi-schema)) =20 -GENERATED_FILES +=3D tests/test-qapi-types.h \ - tests/include/test-qapi-types-sub-module.h \ - tests/test-qapi-types-sub-sub-module.h \ - tests/test-qapi-visit.h \ - tests/include/test-qapi-visit-sub-module.h \ - tests/test-qapi-visit-sub-sub-module.h \ - tests/test-qapi-commands.h \ - tests/include/test-qapi-commands-sub-module.h \ - tests/test-qapi-commands-sub-sub-module.h \ - tests/test-qapi-events.h \ - tests/include/test-qapi-events-sub-module.h \ - tests/test-qapi-events-sub-sub-module.h \ - tests/test-qapi-introspect.h +generated-files-y +=3D tests/test-qapi-types.h +generated-files-y +=3D tests/include/test-qapi-types-sub-module.h +generated-files-y +=3D tests/test-qapi-types-sub-sub-module.h +generated-files-y +=3D tests/test-qapi-visit.h +generated-files-y +=3D tests/include/test-qapi-visit-sub-module.h +generated-files-y +=3D tests/test-qapi-visit-sub-sub-module.h +generated-files-y +=3D tests/test-qapi-commands.h +generated-files-y +=3D tests/include/test-qapi-commands-sub-module.h +generated-files-y +=3D tests/test-qapi-commands-sub-sub-module.h +generated-files-y +=3D tests/test-qapi-events.h +generated-files-y +=3D tests/include/test-qapi-events-sub-module.h +generated-files-y +=3D tests/test-qapi-events-sub-sub-module.h +generated-files-y +=3D tests/test-qapi-introspect.h =20 QEMU_CFLAGS +=3D -I$(SRC_PATH)/tests =20 --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557954456; cv=none; d=zoho.com; s=zohoarc; b=lH/WEnDAed6QpUQVpQLKRAItqCwNt2tacXQ6Y8pkAQODtO51AcTfNwR+PGLfPFK8LkElMuvEv5G9UXyQyLU32sNmm+9pLKZti/VCcr/Q3RAGLNpsJI5OXTXWlVKt1lHcYTFInvR3NXBBeSYLa8XB/S8CKY5kjeh9hq2+dJcSHBw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557954456; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=qrVT+rEVI7/SsIOFvWSVB5Dzl2YPeeZc/CzSWYr5tLw=; b=bPWUvodk12y9grTtNUb3FaCttAVz6Qr52phFaNLeWlv3Q3Uz2m1bquhes0fI42pPRFLtsKAvi/SKFa/f7xH/imVMVDqbs/I/q/T573YJWoy62iGoIoQpcLpC+c5eywmZbbW2Ab8z9QY8jdK4/IT5YfurlkRsvB881Src9gHg9Rc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557954456262201.87535359166202; Wed, 15 May 2019 14:07:36 -0700 (PDT) Received: from localhost ([127.0.0.1]:42592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR17b-0002kD-DO for importer@patchew.org; Wed, 15 May 2019 17:07:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0s4-0006Wg-JB for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0s2-0001f0-J2 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50342) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rz-0001XK-BE for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:24 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0941230B337F for ; Wed, 15 May 2019 20:51:10 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18ADC5C5B0; Wed, 15 May 2019 20:51:08 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:28 +0200 Message-Id: <1557953433-19663-17-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 15 May 2019 20:51:10 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 16/21] configure: qemu-ga is only needed with softmmu targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Laurent Vivier Remove it from the list of tools if --disable-system and --disable-tools are used as we don't need it for linux-user targets. Suggested-by: Paolo Bonzini [lv: I also disable it with disable-tools, not only with disable-system] Signed-off-by: Laurent Vivier Message-Id: <20190401141222.30034-4-lvivier@redhat.com> --- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 8999698..d2fc346 100755 --- a/configure +++ b/configure @@ -6079,7 +6079,9 @@ fi # Probe for guest agent support/options =20 if [ "$guest_agent" !=3D "no" ]; then - if [ "$linux" =3D "yes" -o "$bsd" =3D "yes" -o "$solaris" =3D "yes" -o "= $mingw32" =3D "yes" ] ; then + if [ "$softmmu" =3D no -a "$want_tools" =3D no ] ; then + guest_agent=3Dno + elif [ "$linux" =3D "yes" -o "$bsd" =3D "yes" -o "$solaris" =3D "yes" -o= "$mingw32" =3D "yes" ] ; then tools=3D"qemu-ga $tools" guest_agent=3Dyes elif [ "$guest_agent" !=3D yes ]; then --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557954579; cv=none; d=zoho.com; s=zohoarc; b=baO0USSwTklJHArCiYWjnbTFcPHgZOqnvLOxkglFy7UCIFh5Q/AQfj/S2j05/WO7Dx8AxOwtyCR+ZZqf7KZuNhalkdTEDzH1ZUs4gKtEg6sv8Qdf4mDVAlPhIjcagnQhy/3ZeIXa6K09Rih7zWo7octKZXeGXYitO3iR4KJw4ho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557954579; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=n0D52/DGD6Hs+XEakFh9qa5NTg5BxsGAoj/7rLvBso8=; b=SfKg2sE6fQDBjNRnlY7nw3ciT1G8zt/ksYExIA6VtkgHlp9cP0c3g1OAvn5oC23Q4v8OfHJMpO7AVcd0PQjSVZJRScih32cM0duNlXpslT1/slbzf7DhnJinyEVy+ZGvbPJXa8lCWRIWrJmDUiSSi5HEQ/YzCgcFjQQcDwbkntI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557954579955786.7923757343253; Wed, 15 May 2019 14:09:39 -0700 (PDT) Received: from localhost ([127.0.0.1]:42604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR19c-0004LE-SH for importer@patchew.org; Wed, 15 May 2019 17:09:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0s4-0006Wz-Pa for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0s2-0001fJ-Lk for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48328) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0s0-0001Xu-Ik for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:26 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 64819307D98F for ; Wed, 15 May 2019 20:51:11 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B3F45C5B0; Wed, 15 May 2019 20:51:10 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:29 +0200 Message-Id: <1557953433-19663-18-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 15 May 2019 20:51:11 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 17/21] build: chardev is only needed for softmmu targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Laurent Vivier Move the dependency from SUBDIR_RULES to SOFTMMU_SUBDIR_RULES Suggested-by: Paolo Bonzini Signed-off-by: Laurent Vivier Message-Id: <20190401141222.30034-5-lvivier@redhat.com> --- Makefile | 3 ++- Makefile.objs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d9a3040..1851f8c 100644 --- a/Makefile +++ b/Makefile @@ -444,6 +444,7 @@ SOFTMMU_SUBDIR_RULES=3D$(filter %-softmmu,$(SUBDIR_RULE= S)) =20 $(SOFTMMU_SUBDIR_RULES): $(authz-obj-y) $(SOFTMMU_SUBDIR_RULES): $(block-obj-y) +$(SOFTMMU_SUBDIR_RULES): $(chardev-obj-y) $(SOFTMMU_SUBDIR_RULES): $(crypto-obj-y) $(SOFTMMU_SUBDIR_RULES): $(io-obj-y) $(SOFTMMU_SUBDIR_RULES): config-all-devices.mak @@ -480,7 +481,7 @@ subdir-capstone: .git-submodule-status subdir-slirp: .git-submodule-status $(call quiet-command,$(MAKE) -C $(SRC_PATH)/slirp BUILD_DIR=3D"$(BUILD_DI= R)/slirp" CC=3D"$(CC)" AR=3D"$(AR)" LD=3D"$(LD)" RANLIB=3D"$(RANLIB)" CFLAG= S=3D"$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS=3D"$(LDFLAGS)") =20 -$(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \ +$(SUBDIR_RULES): libqemuutil.a $(common-obj-y) \ $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY)) =20 ROMSUBDIR_RULES=3D$(patsubst %,romsubdir-%, $(ROMS)) diff --git a/Makefile.objs b/Makefile.objs index dda5bbc..43c9e45 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -129,9 +129,9 @@ trace-events-subdirs +=3D accel/kvm trace-events-subdirs +=3D accel/tcg trace-events-subdirs +=3D authz trace-events-subdirs +=3D block -trace-events-subdirs +=3D chardev trace-events-subdirs +=3D crypto ifeq ($(CONFIG_SOFTMMU),y) +trace-events-subdirs +=3D chardev trace-events-subdirs +=3D audio trace-events-subdirs +=3D hw/9pfs trace-events-subdirs +=3D hw/acpi --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557954258; cv=none; d=zoho.com; s=zohoarc; b=oi+gDFSBjwfoRvmnZokoQSNJFjfHYqNscv6pC5Y0EyYC82KdhbLbZXXF26PtGQUgKSBaU0pwB5LMbRpxDdo5motfugk/ws6JOWYvwSO9gEtETARv8SsSG9S29IkBBjFhrnfd6AnLyYLS7MYg5kx5qwTD+TkOEjqlxEmjZySmrx4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557954258; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=GegQRthj/L/DnebqQMJXiklpyubUa9hGR9Re51UeIU4=; b=RAvI3Cwg8hD+6VCOMY5ck2VYBkohgg3nHOW3iQ1zYA27hekBMD3hRyJ7qJYYsOitHD5gIfn47UPwny3Q3mNsCOjl6SQhSLIJ/AcyNu+GXSkWkzLpIXVvPQjzt7naKTdCAnB6v5CMcHk66JTMNvSWbDYosjNby/sxaAKCB8CfEdM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557954258794590.0427326459893; Wed, 15 May 2019 14:04:18 -0700 (PDT) Received: from localhost ([127.0.0.1]:42522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR14O-0000Fw-No for importer@patchew.org; Wed, 15 May 2019 17:04:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0sA-0006c6-V9 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0s4-0001hL-Ua for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48330) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0s4-0001Yu-IB for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA38A307D9CE; Wed, 15 May 2019 20:51:13 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB1AC5C557; Wed, 15 May 2019 20:51:11 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:30 +0200 Message-Id: <1557953433-19663-19-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 15 May 2019 20:51:13 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 18/21] build: don't build hardware objects with linux-user X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Laurent Vivier Some objects are only needed for system emulation and tools. We can ignore them for the user mode case Update tests to run accordingly: conditionally build some tests on CONFIG_BLOCK. Some tests use components that are only built when softmmu or block tools are enabled, not for linux-user. So, if these components are not available, disable the tests. Signed-off-by: Laurent Vivier Message-Id: <20190401141222.30034-6-lvivier@redhat.com> --- Makefile | 4 +++ Makefile.objs | 14 +++++--- tests/Makefile.include | 90 +++++++++++++++++++++++++---------------------= ---- 3 files changed, 58 insertions(+), 50 deletions(-) diff --git a/Makefile b/Makefile index 1851f8c..155f066 100644 --- a/Makefile +++ b/Makefile @@ -87,6 +87,10 @@ endif =20 include $(SRC_PATH)/rules.mak =20 +# notempy and lor are defined in rules.mak +CONFIG_TOOLS :=3D $(call notempty,$(TOOLS)) +CONFIG_BLOCK :=3D $(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)) + # Create QEMU_PKGVERSION and FULL_VERSION strings # If PKGVERSION is set, use that; otherwise get version and -dirty status = from git QEMU_PKGVERSION :=3D $(if $(PKGVERSION),$(PKGVERSION),$(shell \ diff --git a/Makefile.objs b/Makefile.objs index 43c9e45..2b0793e 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -127,9 +127,17 @@ rdmacm-mux-obj-y =3D contrib/rdmacm-mux/ trace-events-subdirs =3D trace-events-subdirs +=3D accel/kvm trace-events-subdirs +=3D accel/tcg +trace-events-subdirs +=3D crypto +ifeq ($(CONFIG_USER_ONLY),y) +trace-events-subdirs +=3D linux-user +endif +ifeq ($(CONFIG_BLOCK),y) trace-events-subdirs +=3D authz trace-events-subdirs +=3D block -trace-events-subdirs +=3D crypto +trace-events-subdirs +=3D io +trace-events-subdirs +=3D nbd +trace-events-subdirs +=3D scsi +endif ifeq ($(CONFIG_SOFTMMU),y) trace-events-subdirs +=3D chardev trace-events-subdirs +=3D audio @@ -178,12 +186,8 @@ trace-events-subdirs +=3D net trace-events-subdirs +=3D ui endif trace-events-subdirs +=3D hw/display -trace-events-subdirs +=3D io -trace-events-subdirs +=3D linux-user -trace-events-subdirs +=3D nbd trace-events-subdirs +=3D qapi trace-events-subdirs +=3D qom -trace-events-subdirs +=3D scsi trace-events-subdirs +=3D target/arm trace-events-subdirs +=3D target/hppa trace-events-subdirs +=3D target/i386 diff --git a/tests/Makefile.include b/tests/Makefile.include index ad95a14..1865f6b 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -45,7 +45,7 @@ SYSEMU_TARGET_LIST :=3D $(subst -softmmu.mak,,$(notdir \ =20 check-unit-y +=3D tests/check-qdict$(EXESUF) check-unit-y +=3D tests/check-block-qdict$(EXESUF) -check-unit-y +=3D tests/test-char$(EXESUF) +check-unit-$(CONFIG_SOFTMMU) +=3D tests/test-char$(EXESUF) check-unit-y +=3D tests/check-qnum$(EXESUF) check-unit-y +=3D tests/check-qstring$(EXESUF) check-unit-y +=3D tests/check-qlist$(EXESUF) @@ -61,21 +61,21 @@ check-unit-y +=3D tests/test-string-input-visitor$(EXES= UF) check-unit-y +=3D tests/test-string-output-visitor$(EXESUF) check-unit-y +=3D tests/test-qmp-event$(EXESUF) check-unit-y +=3D tests/test-opts-visitor$(EXESUF) -check-unit-y +=3D tests/test-coroutine$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-coroutine$(EXESUF) check-unit-y +=3D tests/test-visitor-serialization$(EXESUF) check-unit-y +=3D tests/test-iov$(EXESUF) -check-unit-y +=3D tests/test-aio$(EXESUF) -check-unit-y +=3D tests/test-aio-multithread$(EXESUF) -check-unit-y +=3D tests/test-throttle$(EXESUF) -check-unit-y +=3D tests/test-thread-pool$(EXESUF) -check-unit-y +=3D tests/test-hbitmap$(EXESUF) -check-unit-y +=3D tests/test-bdrv-drain$(EXESUF) -check-unit-y +=3D tests/test-bdrv-graph-mod$(EXESUF) -check-unit-y +=3D tests/test-blockjob$(EXESUF) -check-unit-y +=3D tests/test-blockjob-txn$(EXESUF) -check-unit-y +=3D tests/test-block-backend$(EXESUF) -check-unit-y +=3D tests/test-block-iothread$(EXESUF) -check-unit-y +=3D tests/test-image-locking$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-aio$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-aio-multithread$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-throttle$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-thread-pool$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-hbitmap$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-bdrv-drain$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-bdrv-graph-mod$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-blockjob$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-blockjob-txn$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-block-backend$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-block-iothread$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-image-locking$(EXESUF) check-unit-y +=3D tests/test-x86-cpuid$(EXESUF) # all code tested by test-x86-cpuid is inside topology.h ifeq ($(CONFIG_SOFTMMU),y) @@ -101,40 +101,40 @@ check-unit-y +=3D tests/check-qom-interface$(EXESUF) check-unit-y +=3D tests/check-qom-proplist$(EXESUF) check-unit-y +=3D tests/test-qemu-opts$(EXESUF) check-unit-y +=3D tests/test-keyval$(EXESUF) -check-unit-y +=3D tests/test-write-threshold$(EXESUF) -check-unit-y +=3D tests/test-crypto-hash$(EXESUF) -check-speed-y +=3D tests/benchmark-crypto-hash$(EXESUF) -check-unit-y +=3D tests/test-crypto-hmac$(EXESUF) -check-speed-y +=3D tests/benchmark-crypto-hmac$(EXESUF) -check-unit-y +=3D tests/test-crypto-cipher$(EXESUF) -check-speed-y +=3D tests/benchmark-crypto-cipher$(EXESUF) -check-unit-y +=3D tests/test-crypto-secret$(EXESUF) -check-unit-$(CONFIG_GNUTLS) +=3D tests/test-crypto-tlscredsx509$(EXESUF) -check-unit-$(CONFIG_GNUTLS) +=3D tests/test-crypto-tlssession$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-write-threshold$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-crypto-hash$(EXESUF) +check-speed-$(CONFIG_BLOCK) +=3D tests/benchmark-crypto-hash$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-crypto-hmac$(EXESUF) +check-speed-$(CONFIG_BLOCK) +=3D tests/benchmark-crypto-hmac$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-crypto-cipher$(EXESUF) +check-speed-$(CONFIG_BLOCK) +=3D tests/benchmark-crypto-cipher$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-crypto-secret$(EXESUF) +check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) +=3D tests/test-c= rypto-tlscredsx509$(EXESUF) +check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) +=3D tests/test-c= rypto-tlssession$(EXESUF) ifneq (,$(findstring qemu-ga,$(TOOLS))) check-unit-$(call land,$(CONFIG_LINUX),$(CONFIG_VIRTIO_SERIAL)) +=3D tests= /test-qga$(EXESUF) endif check-unit-y +=3D tests/test-timed-average$(EXESUF) check-unit-$(CONFIG_INOTIFY1) +=3D tests/test-util-filemonitor$(EXESUF) check-unit-y +=3D tests/test-util-sockets$(EXESUF) -check-unit-y +=3D tests/test-authz-simple$(EXESUF) -check-unit-y +=3D tests/test-authz-list$(EXESUF) -check-unit-y +=3D tests/test-authz-listfile$(EXESUF) -check-unit-$(CONFIG_AUTH_PAM) +=3D tests/test-authz-pam$(EXESUF) -check-unit-y +=3D tests/test-io-task$(EXESUF) -check-unit-y +=3D tests/test-io-channel-socket$(EXESUF) -check-unit-y +=3D tests/test-io-channel-file$(EXESUF) -check-unit-$(CONFIG_GNUTLS) +=3D tests/test-io-channel-tls$(EXESUF) -check-unit-y +=3D tests/test-io-channel-command$(EXESUF) -check-unit-y +=3D tests/test-io-channel-buffer$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-authz-simple$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-authz-list$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-authz-listfile$(EXESUF) +check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_AUTH_PAM)) +=3D tests/test= -authz-pam$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-io-task$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-io-channel-socket$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-io-channel-file$(EXESUF) +check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) +=3D tests/test-i= o-channel-tls$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-io-channel-command$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-io-channel-buffer$(EXESUF) check-unit-y +=3D tests/test-base64$(EXESUF) -check-unit-$(if $(CONFIG_NETTLE),y,$(CONFIG_GCRYPT)) +=3D tests/test-crypt= o-pbkdf$(EXESUF) -check-unit-y +=3D tests/test-crypto-ivgen$(EXESUF) -check-unit-y +=3D tests/test-crypto-afsplit$(EXESUF) -check-unit-y +=3D tests/test-crypto-xts$(EXESUF) -check-unit-y +=3D tests/test-crypto-block$(EXESUF) +check-unit-$(call land,$(CONFIG_BLOCK),$(if $(CONFIG_NETTLE),y,$(CONFIG_GC= RYPT))) +=3D tests/test-crypto-pbkdf$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-crypto-ivgen$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-crypto-afsplit$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-crypto-xts$(EXESUF) +check-unit-$(CONFIG_BLOCK) +=3D tests/test-crypto-block$(EXESUF) check-unit-y +=3D tests/test-logging$(EXESUF) -check-unit-$(CONFIG_REPLICATION) +=3D tests/test-replication$(EXESUF) +check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_REPLICATION)) +=3D tests/t= est-replication$(EXESUF) check-unit-y +=3D tests/test-bufferiszero$(EXESUF) check-unit-y +=3D tests/test-uuid$(EXESUF) check-unit-y +=3D tests/ptimer-test$(EXESUF) @@ -496,11 +496,11 @@ test-qapi-obj-y =3D tests/test-qapi-types.o \ tests/test-qapi-visit-sub-sub-module.o \ tests/test-qapi-introspect.o \ $(test-qom-obj-y) -benchmark-crypto-obj-y =3D $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y) -test-crypto-obj-y =3D $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y) -test-io-obj-y =3D $(io-obj-y) $(test-crypto-obj-y) -test-authz-obj-y =3D $(test-qom-obj-y) $(authz-obj-y) -test-block-obj-y =3D $(block-obj-y) $(test-io-obj-y) tests/iothread.o +benchmark-crypto-obj-$(CONFIG_BLOCK) =3D $(authz-obj-y) $(crypto-obj-y) $(= test-qom-obj-y) +test-crypto-obj-$(CONFIG_BLOCK) =3D $(authz-obj-y) $(crypto-obj-y) $(test-= qom-obj-y) +test-io-obj-$(CONFIG_BLOCK) =3D $(io-obj-y) $(test-crypto-obj-y) +test-authz-obj-$(CONFIG_BLOCK) =3D $(test-qom-obj-y) $(authz-obj-y) +test-block-obj-$(CONFIG_BLOCK) =3D $(block-obj-y) $(test-io-obj-y) tests/i= othread.o =20 tests/check-qnum$(EXESUF): tests/check-qnum.o $(test-util-obj-y) tests/check-qstring$(EXESUF): tests/check-qstring.o $(test-util-obj-y) --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557954274; cv=none; d=zoho.com; s=zohoarc; b=ep60bqT9WcSbAI9ZZghXYpQqecikE28SAAE+1j1arQgXNKcMpJ2OHpEi38I+XiSs0x73PdEB3hEoKOUH877pXVEquS3BpN23/jQJFWRTqf06YtEtUKWI0XApcIMjd/4fO1+3SWTEkpNhTUZTQE2HT2ZQ34NWX9loCreJ8rV90a4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557954274; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=BugB0LbMvew3Ed+1RAvqfllskJqfhpUXDMLXWFSAaNE=; b=btEm5XTVETP/ilC2eqbFa5sooJLZOEP5Rs7G9/BBnmMtWHpWDayIL+DiRTVByHrcPoH9O1y9ttyFkIjp8KXFiZGZcbc+Zs81FRLRUl5ckYWYcoQ60FYGg18e674HuYayFCV9MFDwvZMU4gL1Ra0FXWEsrtunoQWNdCV95DTnksE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557954274132313.5238024564127; Wed, 15 May 2019 14:04:34 -0700 (PDT) Received: from localhost ([127.0.0.1]:42528 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR14e-0000Rl-UK for importer@patchew.org; Wed, 15 May 2019 17:04:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0s4-0006Wf-Ix for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0s2-0001eK-3q for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55286) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0ry-0001ZM-ND for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:23 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4713A300BEA8 for ; Wed, 15 May 2019 20:51:15 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BF7B1820E; Wed, 15 May 2019 20:51:14 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:31 +0200 Message-Id: <1557953433-19663-20-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 15 May 2019 20:51:15 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 19/21] ioapic: allow buggy guests mishandling level-triggered interrupts to make progress X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vitaly Kuznetsov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Vitaly Kuznetsov It was found that Hyper-V 2016 on KVM in some configurations (q35 machine + piix4-usb-uhci) hangs on boot. Root-cause was that one of Hyper-V level-triggered interrupt handler performs EOI before fixing the cause of the interrupt. This results in IOAPIC keep re-raising the level-triggered interrupt after EOI because irq-line remains asserted. Gory details: https://www.spinics.net/lists/kvm/msg184484.html (the whole thread). Turns out we were dealing with similar issues before; in-kernel IOAPIC implementation has commit 184564efae4d ("kvm: ioapic: conditionally delay irq delivery duringeoi broadcast") which describes a very similar issue. Steal the idea from the above mentioned commit for IOAPIC implementation in QEMU. SUCCESSIVE_IRQ_MAX_COUNT, delay and the comment are borrowed as well. Signed-off-by: Vitaly Kuznetsov Message-Id: <20190402080215.10747-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini --- hw/intc/ioapic.c | 57 +++++++++++++++++++++++++++++++++++= ---- hw/intc/trace-events | 1 + include/hw/i386/ioapic_internal.h | 3 +++ 3 files changed, 56 insertions(+), 5 deletions(-) diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index 9d75f84..7074489 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -139,6 +139,15 @@ static void ioapic_service(IOAPICCommonState *s) } } =20 +#define SUCCESSIVE_IRQ_MAX_COUNT 10000 + +static void delayed_ioapic_service_cb(void *opaque) +{ + IOAPICCommonState *s =3D opaque; + + ioapic_service(s); +} + static void ioapic_set_irq(void *opaque, int vector, int level) { IOAPICCommonState *s =3D opaque; @@ -222,13 +231,39 @@ void ioapic_eoi_broadcast(int vector) } for (n =3D 0; n < IOAPIC_NUM_PINS; n++) { entry =3D s->ioredtbl[n]; - if ((entry & IOAPIC_LVT_REMOTE_IRR) - && (entry & IOAPIC_VECTOR_MASK) =3D=3D vector) { - trace_ioapic_clear_remote_irr(n, vector); - s->ioredtbl[n] =3D entry & ~IOAPIC_LVT_REMOTE_IRR; - if (!(entry & IOAPIC_LVT_MASKED) && (s->irr & (1 << n))) { + + if ((entry & IOAPIC_VECTOR_MASK) !=3D vector || + ((entry >> IOAPIC_LVT_TRIGGER_MODE_SHIFT) & 1) !=3D IOAPIC= _TRIGGER_LEVEL) { + continue; + } + + if (!(entry & IOAPIC_LVT_REMOTE_IRR)) { + continue; + } + + trace_ioapic_clear_remote_irr(n, vector); + s->ioredtbl[n] =3D entry & ~IOAPIC_LVT_REMOTE_IRR; + + if (!(entry & IOAPIC_LVT_MASKED) && (s->irr & (1 << n))) { + ++s->irq_eoi[vector]; + if (s->irq_eoi[vector] >=3D SUCCESSIVE_IRQ_MAX_COUNT) { + /* + * Real hardware does not deliver the interrupt immedi= ately + * during eoi broadcast, and this lets a buggy guest m= ake + * slow progress even if it does not correctly handle a + * level-triggered interrupt. Emulate this behavior if= we + * detect an interrupt storm. + */ + s->irq_eoi[vector] =3D 0; + timer_mod_anticipate(s->delayed_ioapic_service_timer, + qemu_clock_get_ns(QEMU_CLOCK_VIRT= UAL) + + NANOSECONDS_PER_SECOND / 100); + trace_ioapic_eoi_delayed_reassert(vector); + } else { ioapic_service(s); } + } else { + s->irq_eoi[vector] =3D 0; } } } @@ -401,6 +436,9 @@ static void ioapic_realize(DeviceState *dev, Error **er= rp) memory_region_init_io(&s->io_memory, OBJECT(s), &ioapic_io_ops, s, "ioapic", 0x1000); =20 + s->delayed_ioapic_service_timer =3D + timer_new_ns(QEMU_CLOCK_VIRTUAL, delayed_ioapic_service_cb, s); + qdev_init_gpio_in(dev, ioapic_set_irq, IOAPIC_NUM_PINS); =20 ioapics[ioapic_no] =3D s; @@ -408,6 +446,14 @@ static void ioapic_realize(DeviceState *dev, Error **e= rrp) qemu_add_machine_init_done_notifier(&s->machine_done); } =20 +static void ioapic_unrealize(DeviceState *dev, Error **errp) +{ + IOAPICCommonState *s =3D IOAPIC_COMMON(dev); + + timer_del(s->delayed_ioapic_service_timer); + timer_free(s->delayed_ioapic_service_timer); +} + static Property ioapic_properties[] =3D { DEFINE_PROP_UINT8("version", IOAPICCommonState, version, IOAPIC_VER_DE= F), DEFINE_PROP_END_OF_LIST(), @@ -419,6 +465,7 @@ static void ioapic_class_init(ObjectClass *klass, void = *data) DeviceClass *dc =3D DEVICE_CLASS(klass); =20 k->realize =3D ioapic_realize; + k->unrealize =3D ioapic_unrealize; /* * If APIC is in kernel, we need to update the kernel cache after * migration, otherwise first 24 gsi routes will be invalid. diff --git a/hw/intc/trace-events b/hw/intc/trace-events index a28bdce..90c9d07 100644 --- a/hw/intc/trace-events +++ b/hw/intc/trace-events @@ -25,6 +25,7 @@ apic_mem_writel(uint64_t addr, uint32_t val) "0x%"PRIx64"= =3D 0x%08x" ioapic_set_remote_irr(int n) "set remote irr for pin %d" ioapic_clear_remote_irr(int n, int vector) "clear remote irr for pin %d ve= ctor %d" ioapic_eoi_broadcast(int vector) "EOI broadcast for vector %d" +ioapic_eoi_delayed_reassert(int vector) "delayed reassert on EOI broadcast= for vector %d" ioapic_mem_read(uint8_t addr, uint8_t regsel, uint8_t size, uint32_t val) = "ioapic mem read addr 0x%"PRIx8" regsel: 0x%"PRIx8" size 0x%"PRIx8" retval = 0x%"PRIx32 ioapic_mem_write(uint8_t addr, uint8_t regsel, uint8_t size, uint32_t val)= "ioapic mem write addr 0x%"PRIx8" regsel: 0x%"PRIx8" size 0x%"PRIx8" val 0= x%"PRIx32 ioapic_set_irq(int vector, int level) "vector: %d level: %d" diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_int= ernal.h index 9848f39..07002f9 100644 --- a/include/hw/i386/ioapic_internal.h +++ b/include/hw/i386/ioapic_internal.h @@ -96,6 +96,7 @@ typedef struct IOAPICCommonClass { SysBusDeviceClass parent_class; =20 DeviceRealize realize; + DeviceUnrealize unrealize; void (*pre_save)(IOAPICCommonState *s); void (*post_load)(IOAPICCommonState *s); } IOAPICCommonClass; @@ -111,6 +112,8 @@ struct IOAPICCommonState { uint8_t version; uint64_t irq_count[IOAPIC_NUM_PINS]; int irq_level[IOAPIC_NUM_PINS]; + int irq_eoi[IOAPIC_NUM_PINS]; + QEMUTimer *delayed_ioapic_service_timer; }; =20 void ioapic_reset_common(DeviceState *dev); --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557954344; cv=none; d=zoho.com; s=zohoarc; b=BYb8LEXCQ1W8sMtxICZbtlIH7YPFxaDNThoVZDoa3M4TUSlbINYmTTX88HR+gjtbs2SYe2XHlmclza6K30bIgUN/k7mxCMxjSXsWpKSh7x/MK3Ku9Ap2hsuq/JFFZar88d8+v410aOf2XP/5MofFS9kdgsXxwzrYLUh7Evn5pnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557954344; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=4/8JSzGmI7dgPf+w1mSxpPA4CcJ5oqTlad7OaBee5nE=; b=aigJ9KfQw4fRqughNwy2/8bEdGgCzJaE1X2kXw+KaPhJcTDwwLABrNw4hJKLhZlfjWHgJQGJQ3CKffqpxGSbjdj3zX2Dv0WHqu0BuRgBqo/+ceho2MSRODYbkmOX6Tg6z9NLgT+v7fS7rOcEuQg/LOTQrYSXhcbKDXZ4W1MgRUM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557954344808163.17422808935055; Wed, 15 May 2019 14:05:44 -0700 (PDT) Received: from localhost ([127.0.0.1]:42548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR15o-0001Dm-KW for importer@patchew.org; Wed, 15 May 2019 17:05:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0s2-0006Us-K7 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0ry-0001d6-Op for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34290) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0rw-0001Zl-Op for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:21 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A5300C05B038 for ; Wed, 15 May 2019 20:51:16 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id B878E5C557; Wed, 15 May 2019 20:51:15 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:32 +0200 Message-Id: <1557953433-19663-21-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 15 May 2019 20:51:16 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 20/21] hw/char: Move multi-serial devices into separate file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth In our downstream distribution of QEMU, we'd like to ship the binary without the multi-serial PCI devices. To make this disablement easier, let's move the devices into a separate file and add a proper Kconfig- switch for these devices. Signed-off-by: Thomas Huth Message-Id: <1554036028-31410-1-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- hw/char/Kconfig | 6 ++ hw/char/Makefile.objs | 1 + hw/char/serial-pci-multi.c | 208 +++++++++++++++++++++++++++++++++++++++++= ++++ hw/char/serial-pci.c | 170 ------------------------------------ 4 files changed, 215 insertions(+), 170 deletions(-) create mode 100644 hw/char/serial-pci-multi.c diff --git a/hw/char/Kconfig b/hw/char/Kconfig index 6360c9f..40e7a8b 100644 --- a/hw/char/Kconfig +++ b/hw/char/Kconfig @@ -24,6 +24,12 @@ config SERIAL_PCI depends on PCI select SERIAL =20 +config SERIAL_PCI_MULTI + bool + default y if PCI_DEVICES + depends on PCI + select SERIAL + config VIRTIO_SERIAL bool default y diff --git a/hw/char/Makefile.objs b/hw/char/Makefile.objs index cf086e7..02d8a66 100644 --- a/hw/char/Makefile.objs +++ b/hw/char/Makefile.objs @@ -7,6 +7,7 @@ common-obj-$(CONFIG_PL011) +=3D pl011.o common-obj-$(CONFIG_SERIAL) +=3D serial.o common-obj-$(CONFIG_SERIAL_ISA) +=3D serial-isa.o common-obj-$(CONFIG_SERIAL_PCI) +=3D serial-pci.o +common-obj-$(CONFIG_SERIAL_PCI_MULTI) +=3D serial-pci-multi.o common-obj-$(CONFIG_VIRTIO_SERIAL) +=3D virtio-console.o common-obj-$(CONFIG_XILINX) +=3D xilinx_uartlite.o common-obj-$(CONFIG_XEN) +=3D xen_console.o diff --git a/hw/char/serial-pci-multi.c b/hw/char/serial-pci-multi.c new file mode 100644 index 0000000..63dcbaa --- /dev/null +++ b/hw/char/serial-pci-multi.c @@ -0,0 +1,208 @@ +/* + * QEMU 16550A multi UART emulation + * + * SPDX-License-Identifier: MIT + * + * Copyright (c) 2003-2004 Fabrice Bellard + * Copyright (c) 2008 Citrix Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +/* see docs/specs/pci-serial.txt */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/char/serial.h" +#include "hw/pci/pci.h" + +#define PCI_SERIAL_MAX_PORTS 4 + +typedef struct PCIMultiSerialState { + PCIDevice dev; + MemoryRegion iobar; + uint32_t ports; + char *name[PCI_SERIAL_MAX_PORTS]; + SerialState state[PCI_SERIAL_MAX_PORTS]; + uint32_t level[PCI_SERIAL_MAX_PORTS]; + qemu_irq *irqs; + uint8_t prog_if; +} PCIMultiSerialState; + +static void multi_serial_pci_exit(PCIDevice *dev) +{ + PCIMultiSerialState *pci =3D DO_UPCAST(PCIMultiSerialState, dev, dev); + SerialState *s; + int i; + + for (i =3D 0; i < pci->ports; i++) { + s =3D pci->state + i; + serial_exit_core(s); + memory_region_del_subregion(&pci->iobar, &s->io); + g_free(pci->name[i]); + } + qemu_free_irqs(pci->irqs, pci->ports); +} + +static void multi_serial_irq_mux(void *opaque, int n, int level) +{ + PCIMultiSerialState *pci =3D opaque; + int i, pending =3D 0; + + pci->level[n] =3D level; + for (i =3D 0; i < pci->ports; i++) { + if (pci->level[i]) { + pending =3D 1; + } + } + pci_set_irq(&pci->dev, pending); +} + +static void multi_serial_pci_realize(PCIDevice *dev, Error **errp) +{ + PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(dev); + PCIMultiSerialState *pci =3D DO_UPCAST(PCIMultiSerialState, dev, dev); + SerialState *s; + Error *err =3D NULL; + int i, nr_ports =3D 0; + + switch (pc->device_id) { + case 0x0003: + nr_ports =3D 2; + break; + case 0x0004: + nr_ports =3D 4; + break; + } + assert(nr_ports > 0); + assert(nr_ports <=3D PCI_SERIAL_MAX_PORTS); + + pci->dev.config[PCI_CLASS_PROG] =3D pci->prog_if; + pci->dev.config[PCI_INTERRUPT_PIN] =3D 0x01; + memory_region_init(&pci->iobar, OBJECT(pci), "multiserial", 8 * nr_por= ts); + pci_register_bar(&pci->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &pci->iobar); + pci->irqs =3D qemu_allocate_irqs(multi_serial_irq_mux, pci, + nr_ports); + + for (i =3D 0; i < nr_ports; i++) { + s =3D pci->state + i; + s->baudbase =3D 115200; + serial_realize_core(s, &err); + if (err !=3D NULL) { + error_propagate(errp, err); + multi_serial_pci_exit(dev); + return; + } + s->irq =3D pci->irqs[i]; + pci->name[i] =3D g_strdup_printf("uart #%d", i + 1); + memory_region_init_io(&s->io, OBJECT(pci), &serial_io_ops, s, + pci->name[i], 8); + memory_region_add_subregion(&pci->iobar, 8 * i, &s->io); + pci->ports++; + } +} + +static const VMStateDescription vmstate_pci_multi_serial =3D { + .name =3D "pci-serial-multi", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_PCI_DEVICE(dev, PCIMultiSerialState), + VMSTATE_STRUCT_ARRAY(state, PCIMultiSerialState, PCI_SERIAL_MAX_PO= RTS, + 0, vmstate_serial, SerialState), + VMSTATE_UINT32_ARRAY(level, PCIMultiSerialState, PCI_SERIAL_MAX_PO= RTS), + VMSTATE_END_OF_LIST() + } +}; + +static Property multi_2x_serial_pci_properties[] =3D { + DEFINE_PROP_CHR("chardev1", PCIMultiSerialState, state[0].chr), + DEFINE_PROP_CHR("chardev2", PCIMultiSerialState, state[1].chr), + DEFINE_PROP_UINT8("prog_if", PCIMultiSerialState, prog_if, 0x02), + DEFINE_PROP_END_OF_LIST(), +}; + +static Property multi_4x_serial_pci_properties[] =3D { + DEFINE_PROP_CHR("chardev1", PCIMultiSerialState, state[0].chr), + DEFINE_PROP_CHR("chardev2", PCIMultiSerialState, state[1].chr), + DEFINE_PROP_CHR("chardev3", PCIMultiSerialState, state[2].chr), + DEFINE_PROP_CHR("chardev4", PCIMultiSerialState, state[3].chr), + DEFINE_PROP_UINT8("prog_if", PCIMultiSerialState, prog_if, 0x02), + DEFINE_PROP_END_OF_LIST(), +}; + +static void multi_2x_serial_pci_class_initfn(ObjectClass *klass, void *dat= a) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + PCIDeviceClass *pc =3D PCI_DEVICE_CLASS(klass); + pc->realize =3D multi_serial_pci_realize; + pc->exit =3D multi_serial_pci_exit; + pc->vendor_id =3D PCI_VENDOR_ID_REDHAT; + pc->device_id =3D PCI_DEVICE_ID_REDHAT_SERIAL2; + pc->revision =3D 1; + pc->class_id =3D PCI_CLASS_COMMUNICATION_SERIAL; + dc->vmsd =3D &vmstate_pci_multi_serial; + dc->props =3D multi_2x_serial_pci_properties; + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); +} + +static void multi_4x_serial_pci_class_initfn(ObjectClass *klass, void *dat= a) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + PCIDeviceClass *pc =3D PCI_DEVICE_CLASS(klass); + pc->realize =3D multi_serial_pci_realize; + pc->exit =3D multi_serial_pci_exit; + pc->vendor_id =3D PCI_VENDOR_ID_REDHAT; + pc->device_id =3D PCI_DEVICE_ID_REDHAT_SERIAL4; + pc->revision =3D 1; + pc->class_id =3D PCI_CLASS_COMMUNICATION_SERIAL; + dc->vmsd =3D &vmstate_pci_multi_serial; + dc->props =3D multi_4x_serial_pci_properties; + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); +} + +static const TypeInfo multi_2x_serial_pci_info =3D { + .name =3D "pci-serial-2x", + .parent =3D TYPE_PCI_DEVICE, + .instance_size =3D sizeof(PCIMultiSerialState), + .class_init =3D multi_2x_serial_pci_class_initfn, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { }, + }, +}; + +static const TypeInfo multi_4x_serial_pci_info =3D { + .name =3D "pci-serial-4x", + .parent =3D TYPE_PCI_DEVICE, + .instance_size =3D sizeof(PCIMultiSerialState), + .class_init =3D multi_4x_serial_pci_class_initfn, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { }, + }, +}; + +static void multi_serial_pci_register_types(void) +{ + type_register_static(&multi_2x_serial_pci_info); + type_register_static(&multi_4x_serial_pci_info); +} + +type_init(multi_serial_pci_register_types) diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c index cb0d04c..2d5ffae 100644 --- a/hw/char/serial-pci.c +++ b/hw/char/serial-pci.c @@ -30,26 +30,12 @@ #include "hw/char/serial.h" #include "hw/pci/pci.h" =20 -#define PCI_SERIAL_MAX_PORTS 4 - typedef struct PCISerialState { PCIDevice dev; SerialState state; uint8_t prog_if; } PCISerialState; =20 -typedef struct PCIMultiSerialState { - PCIDevice dev; - MemoryRegion iobar; - uint32_t ports; - char *name[PCI_SERIAL_MAX_PORTS]; - SerialState state[PCI_SERIAL_MAX_PORTS]; - uint32_t level[PCI_SERIAL_MAX_PORTS]; - qemu_irq *irqs; - uint8_t prog_if; -} PCIMultiSerialState; - -static void multi_serial_pci_exit(PCIDevice *dev); =20 static void serial_pci_realize(PCIDevice *dev, Error **errp) { @@ -72,64 +58,6 @@ static void serial_pci_realize(PCIDevice *dev, Error **e= rrp) pci_register_bar(&pci->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io); } =20 -static void multi_serial_irq_mux(void *opaque, int n, int level) -{ - PCIMultiSerialState *pci =3D opaque; - int i, pending =3D 0; - - pci->level[n] =3D level; - for (i =3D 0; i < pci->ports; i++) { - if (pci->level[i]) { - pending =3D 1; - } - } - pci_set_irq(&pci->dev, pending); -} - -static void multi_serial_pci_realize(PCIDevice *dev, Error **errp) -{ - PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(dev); - PCIMultiSerialState *pci =3D DO_UPCAST(PCIMultiSerialState, dev, dev); - SerialState *s; - Error *err =3D NULL; - int i, nr_ports =3D 0; - - switch (pc->device_id) { - case 0x0003: - nr_ports =3D 2; - break; - case 0x0004: - nr_ports =3D 4; - break; - } - assert(nr_ports > 0); - assert(nr_ports <=3D PCI_SERIAL_MAX_PORTS); - - pci->dev.config[PCI_CLASS_PROG] =3D pci->prog_if; - pci->dev.config[PCI_INTERRUPT_PIN] =3D 0x01; - memory_region_init(&pci->iobar, OBJECT(pci), "multiserial", 8 * nr_por= ts); - pci_register_bar(&pci->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &pci->iobar); - pci->irqs =3D qemu_allocate_irqs(multi_serial_irq_mux, pci, - nr_ports); - - for (i =3D 0; i < nr_ports; i++) { - s =3D pci->state + i; - s->baudbase =3D 115200; - serial_realize_core(s, &err); - if (err !=3D NULL) { - error_propagate(errp, err); - multi_serial_pci_exit(dev); - return; - } - s->irq =3D pci->irqs[i]; - pci->name[i] =3D g_strdup_printf("uart #%d", i+1); - memory_region_init_io(&s->io, OBJECT(pci), &serial_io_ops, s, - pci->name[i], 8); - memory_region_add_subregion(&pci->iobar, 8 * i, &s->io); - pci->ports++; - } -} - static void serial_pci_exit(PCIDevice *dev) { PCISerialState *pci =3D DO_UPCAST(PCISerialState, dev, dev); @@ -139,21 +67,6 @@ static void serial_pci_exit(PCIDevice *dev) qemu_free_irq(s->irq); } =20 -static void multi_serial_pci_exit(PCIDevice *dev) -{ - PCIMultiSerialState *pci =3D DO_UPCAST(PCIMultiSerialState, dev, dev); - SerialState *s; - int i; - - for (i =3D 0; i < pci->ports; i++) { - s =3D pci->state + i; - serial_exit_core(s); - memory_region_del_subregion(&pci->iobar, &s->io); - g_free(pci->name[i]); - } - qemu_free_irqs(pci->irqs, pci->ports); -} - static const VMStateDescription vmstate_pci_serial =3D { .name =3D "pci-serial", .version_id =3D 1, @@ -165,41 +78,12 @@ static const VMStateDescription vmstate_pci_serial =3D= { } }; =20 -static const VMStateDescription vmstate_pci_multi_serial =3D { - .name =3D "pci-serial-multi", - .version_id =3D 1, - .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { - VMSTATE_PCI_DEVICE(dev, PCIMultiSerialState), - VMSTATE_STRUCT_ARRAY(state, PCIMultiSerialState, PCI_SERIAL_MAX_PO= RTS, - 0, vmstate_serial, SerialState), - VMSTATE_UINT32_ARRAY(level, PCIMultiSerialState, PCI_SERIAL_MAX_PO= RTS), - VMSTATE_END_OF_LIST() - } -}; - static Property serial_pci_properties[] =3D { DEFINE_PROP_CHR("chardev", PCISerialState, state.chr), DEFINE_PROP_UINT8("prog_if", PCISerialState, prog_if, 0x02), DEFINE_PROP_END_OF_LIST(), }; =20 -static Property multi_2x_serial_pci_properties[] =3D { - DEFINE_PROP_CHR("chardev1", PCIMultiSerialState, state[0].chr), - DEFINE_PROP_CHR("chardev2", PCIMultiSerialState, state[1].chr), - DEFINE_PROP_UINT8("prog_if", PCIMultiSerialState, prog_if, 0x02), - DEFINE_PROP_END_OF_LIST(), -}; - -static Property multi_4x_serial_pci_properties[] =3D { - DEFINE_PROP_CHR("chardev1", PCIMultiSerialState, state[0].chr), - DEFINE_PROP_CHR("chardev2", PCIMultiSerialState, state[1].chr), - DEFINE_PROP_CHR("chardev3", PCIMultiSerialState, state[2].chr), - DEFINE_PROP_CHR("chardev4", PCIMultiSerialState, state[3].chr), - DEFINE_PROP_UINT8("prog_if", PCIMultiSerialState, prog_if, 0x02), - DEFINE_PROP_END_OF_LIST(), -}; - static void serial_pci_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -215,36 +99,6 @@ static void serial_pci_class_initfn(ObjectClass *klass,= void *data) set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } =20 -static void multi_2x_serial_pci_class_initfn(ObjectClass *klass, void *dat= a) -{ - DeviceClass *dc =3D DEVICE_CLASS(klass); - PCIDeviceClass *pc =3D PCI_DEVICE_CLASS(klass); - pc->realize =3D multi_serial_pci_realize; - pc->exit =3D multi_serial_pci_exit; - pc->vendor_id =3D PCI_VENDOR_ID_REDHAT; - pc->device_id =3D PCI_DEVICE_ID_REDHAT_SERIAL2; - pc->revision =3D 1; - pc->class_id =3D PCI_CLASS_COMMUNICATION_SERIAL; - dc->vmsd =3D &vmstate_pci_multi_serial; - dc->props =3D multi_2x_serial_pci_properties; - set_bit(DEVICE_CATEGORY_INPUT, dc->categories); -} - -static void multi_4x_serial_pci_class_initfn(ObjectClass *klass, void *dat= a) -{ - DeviceClass *dc =3D DEVICE_CLASS(klass); - PCIDeviceClass *pc =3D PCI_DEVICE_CLASS(klass); - pc->realize =3D multi_serial_pci_realize; - pc->exit =3D multi_serial_pci_exit; - pc->vendor_id =3D PCI_VENDOR_ID_REDHAT; - pc->device_id =3D PCI_DEVICE_ID_REDHAT_SERIAL4; - pc->revision =3D 1; - pc->class_id =3D PCI_CLASS_COMMUNICATION_SERIAL; - dc->vmsd =3D &vmstate_pci_multi_serial; - dc->props =3D multi_4x_serial_pci_properties; - set_bit(DEVICE_CATEGORY_INPUT, dc->categories); -} - static const TypeInfo serial_pci_info =3D { .name =3D "pci-serial", .parent =3D TYPE_PCI_DEVICE, @@ -256,33 +110,9 @@ static const TypeInfo serial_pci_info =3D { }, }; =20 -static const TypeInfo multi_2x_serial_pci_info =3D { - .name =3D "pci-serial-2x", - .parent =3D TYPE_PCI_DEVICE, - .instance_size =3D sizeof(PCIMultiSerialState), - .class_init =3D multi_2x_serial_pci_class_initfn, - .interfaces =3D (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; - -static const TypeInfo multi_4x_serial_pci_info =3D { - .name =3D "pci-serial-4x", - .parent =3D TYPE_PCI_DEVICE, - .instance_size =3D sizeof(PCIMultiSerialState), - .class_init =3D multi_4x_serial_pci_class_initfn, - .interfaces =3D (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; - static void serial_pci_register_types(void) { type_register_static(&serial_pci_info); - type_register_static(&multi_2x_serial_pci_info); - type_register_static(&multi_4x_serial_pci_info); } =20 type_init(serial_pci_register_types) --=20 1.8.3.1 From nobody Thu Apr 25 13:57:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557954818; cv=none; d=zoho.com; s=zohoarc; b=lWCvSegzXYs2Jm314dl56A6mnWQEF1rviCyqAEGkbOWBdkHJJZVHAF9Akikcoo7WYjx0Dah8mSJF6tkHzYWaJx/jJbRZIRyE7lVcVGP1v6FPDYihFWDBmtuxHRkHTnZG3s2zVRvqvteonjnA4U9vcmP56m9gOMmlwsi8hwd123I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557954818; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=0RDk+uVpFxI2f9rLx2CgU/EpukdrGE+iYzYqDji5Jn0=; b=b48KyWiHsd58/ZoecXjzguI/WSd5/NqoSKlhkP8UoFzLy+cH0oNoIqgpFJqau5PRNWZRmkUMLqV3TSxxa/RBM0/uhjOTbnuiANmLaOee1tX6QueqT5QcIKYKCyuIvi33OWotcUtgRLuaLR9nsPhw1t2/uhyxYiocxTXuRP1/ju0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557954818229844.1853519548457; Wed, 15 May 2019 14:13:38 -0700 (PDT) Received: from localhost ([127.0.0.1]:42669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR1DS-0007dR-Vl for importer@patchew.org; Wed, 15 May 2019 17:13:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0sB-0006cE-1A for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0s4-0001h1-R9 for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55076) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0s4-0001dC-EL for qemu-devel@nongnu.org; Wed, 15 May 2019 16:51:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A8B15A971A for ; Wed, 15 May 2019 20:51:22 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 283821820E; Wed, 15 May 2019 20:51:16 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2019 22:50:33 +0200 Message-Id: <1557953433-19663-22-git-send-email-pbonzini@redhat.com> In-Reply-To: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> References: <1557953433-19663-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 15 May 2019 20:51:22 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 21/21] hw/net/ne2000: Extract the PCI device from the chipset common code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 The ne2000.c file contains functions common the the ISA and PCI devices. To allow to build with one or another, extract the PCI specific part into a new file. This fix an issue where the NE2000_ISA Kconfig had to pull the full PCI core objects. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190504123538.14952-1-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/net/Kconfig | 7 ++- hw/net/Makefile.objs | 3 +- hw/net/ne2000-pci.c | 132 +++++++++++++++++++++++++++++++++++++++++++++++= ++++ hw/net/ne2000.c | 105 ---------------------------------------- 4 files changed, 139 insertions(+), 108 deletions(-) create mode 100644 hw/net/ne2000-pci.c diff --git a/hw/net/Kconfig b/hw/net/Kconfig index 7d7bbc5..4ef86dc 100644 --- a/hw/net/Kconfig +++ b/hw/net/Kconfig @@ -1,10 +1,14 @@ config DP8393X bool =20 +config NE2000_COMMON + bool + config NE2000_PCI bool default y if PCI_DEVICES depends on PCI + select NE2000_COMMON =20 config EEPRO100_PCI bool @@ -51,8 +55,7 @@ config NE2000_ISA bool default y depends on ISA_BUS - depends on PCI # for NE2000State - select NE2000_PCI + select NE2000_COMMON =20 config OPENCORES_ETH bool diff --git a/hw/net/Makefile.objs b/hw/net/Makefile.objs index ea63715..9904273 100644 --- a/hw/net/Makefile.objs +++ b/hw/net/Makefile.objs @@ -1,8 +1,9 @@ common-obj-$(CONFIG_DP8393X) +=3D dp8393x.o common-obj-$(CONFIG_XEN) +=3D xen_nic.o +common-obj-$(CONFIG_NE2000_COMMON) +=3D ne2000.o =20 # PCI network cards -common-obj-$(CONFIG_NE2000_PCI) +=3D ne2000.o +common-obj-$(CONFIG_NE2000_PCI) +=3D ne2000-pci.o common-obj-$(CONFIG_EEPRO100_PCI) +=3D eepro100.o common-obj-$(CONFIG_PCNET_PCI) +=3D pcnet-pci.o common-obj-$(CONFIG_PCNET_COMMON) +=3D pcnet.o diff --git a/hw/net/ne2000-pci.c b/hw/net/ne2000-pci.c new file mode 100644 index 0000000..cb05744 --- /dev/null +++ b/hw/net/ne2000-pci.c @@ -0,0 +1,132 @@ +/* + * QEMU NE2000 emulation (PCI bus) + * + * Copyright (c) 2003-2004 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ +#include "qemu/osdep.h" +#include "hw/pci/pci.h" +#include "ne2000.h" +#include "sysemu/sysemu.h" + +typedef struct PCINE2000State { + PCIDevice dev; + NE2000State ne2000; +} PCINE2000State; + +static const VMStateDescription vmstate_pci_ne2000 =3D { + .name =3D "ne2000", + .version_id =3D 3, + .minimum_version_id =3D 3, + .fields =3D (VMStateField[]) { + VMSTATE_PCI_DEVICE(dev, PCINE2000State), + VMSTATE_STRUCT(ne2000, PCINE2000State, 0, vmstate_ne2000, NE2000St= ate), + VMSTATE_END_OF_LIST() + } +}; + +static NetClientInfo net_ne2000_info =3D { + .type =3D NET_CLIENT_DRIVER_NIC, + .size =3D sizeof(NICState), + .receive =3D ne2000_receive, +}; + +static void pci_ne2000_realize(PCIDevice *pci_dev, Error **errp) +{ + PCINE2000State *d =3D DO_UPCAST(PCINE2000State, dev, pci_dev); + NE2000State *s; + uint8_t *pci_conf; + + pci_conf =3D d->dev.config; + pci_conf[PCI_INTERRUPT_PIN] =3D 1; /* interrupt pin A */ + + s =3D &d->ne2000; + ne2000_setup_io(s, DEVICE(pci_dev), 0x100); + pci_register_bar(&d->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io); + s->irq =3D pci_allocate_irq(&d->dev); + + qemu_macaddr_default_if_unset(&s->c.macaddr); + ne2000_reset(s); + + s->nic =3D qemu_new_nic(&net_ne2000_info, &s->c, + object_get_typename(OBJECT(pci_dev)), + pci_dev->qdev.id, s); + qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a); +} + +static void pci_ne2000_exit(PCIDevice *pci_dev) +{ + PCINE2000State *d =3D DO_UPCAST(PCINE2000State, dev, pci_dev); + NE2000State *s =3D &d->ne2000; + + qemu_del_nic(s->nic); + qemu_free_irq(s->irq); +} + +static void ne2000_instance_init(Object *obj) +{ + PCIDevice *pci_dev =3D PCI_DEVICE(obj); + PCINE2000State *d =3D DO_UPCAST(PCINE2000State, dev, pci_dev); + NE2000State *s =3D &d->ne2000; + + device_add_bootindex_property(obj, &s->c.bootindex, + "bootindex", "/ethernet-phy@0", + &pci_dev->qdev, NULL); +} + +static Property ne2000_properties[] =3D { + DEFINE_NIC_PROPERTIES(PCINE2000State, ne2000.c), + DEFINE_PROP_END_OF_LIST(), +}; + +static void ne2000_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); + + k->realize =3D pci_ne2000_realize; + k->exit =3D pci_ne2000_exit; + k->romfile =3D "efi-ne2k_pci.rom", + k->vendor_id =3D PCI_VENDOR_ID_REALTEK; + k->device_id =3D PCI_DEVICE_ID_REALTEK_8029; + k->class_id =3D PCI_CLASS_NETWORK_ETHERNET; + dc->vmsd =3D &vmstate_pci_ne2000; + dc->props =3D ne2000_properties; + set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); +} + +static const TypeInfo ne2000_info =3D { + .name =3D "ne2k_pci", + .parent =3D TYPE_PCI_DEVICE, + .instance_size =3D sizeof(PCINE2000State), + .class_init =3D ne2000_class_init, + .instance_init =3D ne2000_instance_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { }, + }, +}; + +static void ne2000_register_types(void) +{ + type_register_static(&ne2000_info); +} + +type_init(ne2000_register_types) diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c index 037afc8..ca792d9 100644 --- a/hw/net/ne2000.c +++ b/hw/net/ne2000.c @@ -22,7 +22,6 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" -#include "hw/pci/pci.h" #include "net/eth.h" #include "ne2000.h" #include "sysemu/sysemu.h" @@ -118,11 +117,6 @@ #define ENTSR_CDH 0x40 /* The collision detect "heartbeat" signal was lost= . */ #define ENTSR_OWC 0x80 /* There was an out-of-window collision. */ =20 -typedef struct PCINE2000State { - PCIDevice dev; - NE2000State ne2000; -} PCINE2000State; - void ne2000_reset(NE2000State *s) { int i; @@ -644,17 +638,6 @@ const VMStateDescription vmstate_ne2000 =3D { } }; =20 -static const VMStateDescription vmstate_pci_ne2000 =3D { - .name =3D "ne2000", - .version_id =3D 3, - .minimum_version_id =3D 3, - .fields =3D (VMStateField[]) { - VMSTATE_PCI_DEVICE(dev, PCINE2000State), - VMSTATE_STRUCT(ne2000, PCINE2000State, 0, vmstate_ne2000, NE2000St= ate), - VMSTATE_END_OF_LIST() - } -}; - static uint64_t ne2000_read(void *opaque, hwaddr addr, unsigned size) { @@ -711,91 +694,3 @@ void ne2000_setup_io(NE2000State *s, DeviceState *dev,= unsigned size) { memory_region_init_io(&s->io, OBJECT(dev), &ne2000_ops, s, "ne2000", s= ize); } - -static NetClientInfo net_ne2000_info =3D { - .type =3D NET_CLIENT_DRIVER_NIC, - .size =3D sizeof(NICState), - .receive =3D ne2000_receive, -}; - -static void pci_ne2000_realize(PCIDevice *pci_dev, Error **errp) -{ - PCINE2000State *d =3D DO_UPCAST(PCINE2000State, dev, pci_dev); - NE2000State *s; - uint8_t *pci_conf; - - pci_conf =3D d->dev.config; - pci_conf[PCI_INTERRUPT_PIN] =3D 1; /* interrupt pin A */ - - s =3D &d->ne2000; - ne2000_setup_io(s, DEVICE(pci_dev), 0x100); - pci_register_bar(&d->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io); - s->irq =3D pci_allocate_irq(&d->dev); - - qemu_macaddr_default_if_unset(&s->c.macaddr); - ne2000_reset(s); - - s->nic =3D qemu_new_nic(&net_ne2000_info, &s->c, - object_get_typename(OBJECT(pci_dev)), pci_dev->q= dev.id, s); - qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a); -} - -static void pci_ne2000_exit(PCIDevice *pci_dev) -{ - PCINE2000State *d =3D DO_UPCAST(PCINE2000State, dev, pci_dev); - NE2000State *s =3D &d->ne2000; - - qemu_del_nic(s->nic); - qemu_free_irq(s->irq); -} - -static void ne2000_instance_init(Object *obj) -{ - PCIDevice *pci_dev =3D PCI_DEVICE(obj); - PCINE2000State *d =3D DO_UPCAST(PCINE2000State, dev, pci_dev); - NE2000State *s =3D &d->ne2000; - - device_add_bootindex_property(obj, &s->c.bootindex, - "bootindex", "/ethernet-phy@0", - &pci_dev->qdev, NULL); -} - -static Property ne2000_properties[] =3D { - DEFINE_NIC_PROPERTIES(PCINE2000State, ne2000.c), - DEFINE_PROP_END_OF_LIST(), -}; - -static void ne2000_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc =3D DEVICE_CLASS(klass); - PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); - - k->realize =3D pci_ne2000_realize; - k->exit =3D pci_ne2000_exit; - k->romfile =3D "efi-ne2k_pci.rom", - k->vendor_id =3D PCI_VENDOR_ID_REALTEK; - k->device_id =3D PCI_DEVICE_ID_REALTEK_8029; - k->class_id =3D PCI_CLASS_NETWORK_ETHERNET; - dc->vmsd =3D &vmstate_pci_ne2000; - dc->props =3D ne2000_properties; - set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); -} - -static const TypeInfo ne2000_info =3D { - .name =3D "ne2k_pci", - .parent =3D TYPE_PCI_DEVICE, - .instance_size =3D sizeof(PCINE2000State), - .class_init =3D ne2000_class_init, - .instance_init =3D ne2000_instance_init, - .interfaces =3D (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; - -static void ne2000_register_types(void) -{ - type_register_static(&ne2000_info); -} - -type_init(ne2000_register_types) --=20 1.8.3.1