From nobody Thu Apr 18 21:33:45 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 154713165802364.5272182110325; Thu, 10 Jan 2019 06:47:38 -0800 (PST) Received: from localhost ([127.0.0.1]:39790 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbcO-0000UH-DP for importer@patchew.org; Thu, 10 Jan 2019 09:47:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbLN-0003m0-F7 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghbLM-0005iF-Ha for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53554) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghbLM-0005ho-6t for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:00 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 797C312F900; Thu, 10 Jan 2019 14:29:59 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF47A600C8; Thu, 10 Jan 2019 14:29:58 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 12:29:46 -0200 Message-Id: <20190110142955.23254-2-ehabkost@redhat.com> In-Reply-To: <20190110142955.23254-1-ehabkost@redhat.com> References: <20190110142955.23254-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 10 Jan 2019 14:29:59 +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 01/10] qemu-deprecated.texi: Rename the HMP section 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: Kashyap Chamarthy 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: Kashyap Chamarthy So that it is consistent with the naming of QMP's Signed-off-by: Kashyap Chamarthy Message-Id: <20181213124224.31585-2-kchamart@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Eduardo Habkost --- qemu-deprecated.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index c3735b698e..3f30f05a61 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -106,7 +106,7 @@ The ``query-cpus'' command is replaced by the ``query-c= pus-fast'' command. The ``arch'' output member of the ``query-cpus-fast'' command is replaced by the ``target'' output member. =20 -@section System emulator human monitor commands +@section Human Monitor Protocol (HMP) commands =20 @subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (sinc= e 3.1) =20 --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 18 21:33:45 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547131701654370.7767035461069; Thu, 10 Jan 2019 06:48:21 -0800 (PST) Received: from localhost ([127.0.0.1]:39970 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbd6-0000xi-6B for importer@patchew.org; Thu, 10 Jan 2019 09:48:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbLP-0003np-89 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghbLO-0005kc-EQ for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36656) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghbLO-0005j0-7c for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:02 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5FD557F086; Thu, 10 Jan 2019 14:30:01 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA67D7E497; Thu, 10 Jan 2019 14:30:00 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 12:29:47 -0200 Message-Id: <20190110142955.23254-3-ehabkost@redhat.com> In-Reply-To: <20190110142955.23254-1-ehabkost@redhat.com> References: <20190110142955.23254-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 10 Jan 2019 14:30:01 +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/10] Update that HMP 'cpu-add' is deprecated in 4.0 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: Kashyap Chamarthy 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: Kashyap Chamarthy Signed-off-by: Kashyap Chamarthy Message-Id: <20181213124224.31585-3-kchamart@redhat.com> Reviewed-by: Igor Mammedov [ehabkost: revert back to 'cpu-add' spelling] Signed-off-by: Eduardo Habkost --- qemu-deprecated.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 3f30f05a61..f4a5cea62b 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -113,7 +113,7 @@ replaced by the ``target'' output member. The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and 'hostfwd_remove' HMP commands has been replaced by @option{netdev_id}. =20 -@subsection cpu-add (since 3.1) +@subsection cpu-add (since 4.0) =20 Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''. See documentation of ``query-hotpluggable-cpus'' for additional details. --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 18 21:33:45 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 Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547131043948692.361135298613; Thu, 10 Jan 2019 06:37:23 -0800 (PST) Received: from localhost ([127.0.0.1]:37085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbS0-0000kq-Jn for importer@patchew.org; Thu, 10 Jan 2019 09:36:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbLe-0003yf-8a for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghbLT-0005m9-B4 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40750) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghbLT-0005lp-5w for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:07 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3225CA7FED; Thu, 10 Jan 2019 14:30:06 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE19C601A7; Thu, 10 Jan 2019 14:30:02 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 12:29:48 -0200 Message-Id: <20190110142955.23254-4-ehabkost@redhat.com> In-Reply-To: <20190110142955.23254-1-ehabkost@redhat.com> References: <20190110142955.23254-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 10 Jan 2019 14:30:06 +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/10] Mention that QMP 'cpu-add' will be 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: Kashyap Chamarthy 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: Kashyap Chamarthy Signed-off-by: Kashyap Chamarthy Message-Id: <20181213124224.31585-4-kchamart@redhat.com> Reviewed-by: Igor Mammedov Reviewed-by: Thomas Huth Signed-off-by: Eduardo Habkost --- qemu-deprecated.texi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index f4a5cea62b..81de5fc019 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -106,6 +106,12 @@ The ``query-cpus'' command is replaced by the ``query-= cpus-fast'' command. The ``arch'' output member of the ``query-cpus-fast'' command is replaced by the ``target'' output member. =20 +@subsection cpu-add (since 4.0) + +Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''. See +documentation of ``query-hotpluggable-cpus'' for additional +details. + @section Human Monitor Protocol (HMP) commands =20 @subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (sinc= e 3.1) --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 18 21:33:45 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547131854113180.86563369216367; Thu, 10 Jan 2019 06:50:54 -0800 (PST) Received: from localhost ([127.0.0.1]:40571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbfY-0002eA-Hi for importer@patchew.org; Thu, 10 Jan 2019 09:50:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbLv-0004Ge-Rk for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghbLu-00061D-Nx for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41130) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghbLu-0005zi-ET for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:34 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DB964420A5; Thu, 10 Jan 2019 14:30:32 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58E115D75C; Thu, 10 Jan 2019 14:30:07 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 12:29:49 -0200 Message-Id: <20190110142955.23254-5-ehabkost@redhat.com> In-Reply-To: <20190110142955.23254-1-ehabkost@redhat.com> References: <20190110142955.23254-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 10 Jan 2019 14:30:32 +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 04/10] range: add some more functions 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: David Hildenbrand 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: David Hildenbrand Add some more functions that will be used in memory-device context. range_init(): Init using lower bound and size, check for validity range_init_nofail(): Init using lower bound and size, validity asserted range_size(): Extract the size of a range range_overlaps_range(): Check for overlaps of two ranges range_contains_range(): Check if one range is contained in the other Reviewed-by: Igor Mammedov Signed-off-by: David Hildenbrand Message-Id: <20181214131043.25071-2-david@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Eduardo Habkost --- include/qemu/range.h | 62 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/include/qemu/range.h b/include/qemu/range.h index 7e75f4e655..ba606c6bc0 100644 --- a/include/qemu/range.h +++ b/include/qemu/range.h @@ -112,6 +112,68 @@ static inline uint64_t range_upb(Range *range) return range->upb; } =20 +/* + * Initialize @range to span the interval [@lob,@lob + @size - 1]. + * @size may be 0. If the range would overflow, returns -ERANGE, otherwise + * 0. + */ +static inline int QEMU_WARN_UNUSED_RESULT range_init(Range *range, uint64_= t lob, + uint64_t size) +{ + if (lob + size < lob) { + return -ERANGE; + } + range->lob =3D lob; + range->upb =3D lob + size - 1; + range_invariant(range); + return 0; +} + +/* + * Initialize @range to span the interval [@lob,@lob + @size - 1]. + * @size may be 0. Range must not overflow. + */ +static inline void range_init_nofail(Range *range, uint64_t lob, uint64_t = size) +{ + range->lob =3D lob; + range->upb =3D lob + size - 1; + range_invariant(range); +} + +/* + * Get the size of @range. + */ +static inline uint64_t range_size(const Range *range) +{ + return range->upb - range->lob + 1; +} + +/* + * Check if @range1 overlaps with @range2. If one of the ranges is empty, + * the result is always "false". + */ +static inline bool range_overlaps_range(const Range *range1, + const Range *range2) +{ + if (range_is_empty(range1) || range_is_empty(range2)) { + return false; + } + return !(range2->upb < range1->lob || range1->upb < range2->lob); +} + +/* + * Check if @range1 contains @range2. If one of the ranges is empty, + * the result is always "false". + */ +static inline bool range_contains_range(const Range *range1, + const Range *range2) +{ + if (range_is_empty(range1) || range_is_empty(range2)) { + return false; + } + return range1->lob <=3D range2->lob && range1->upb >=3D range2->upb; +} + /* * Extend @range to the smallest interval that includes @extend_by, too. */ --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 18 21:33:45 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547131049667511.1773123484569; Thu, 10 Jan 2019 06:37:29 -0800 (PST) Received: from localhost ([127.0.0.1]:37225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbSZ-0001C7-Vq for importer@patchew.org; Thu, 10 Jan 2019 09:37:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbLx-0004Hh-4n for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghbLw-00062N-2G for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56068) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghbLv-00061i-Pp for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:35 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 057727FD4D; Thu, 10 Jan 2019 14:30:35 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A5825D75C; Thu, 10 Jan 2019 14:30:34 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 12:29:50 -0200 Message-Id: <20190110142955.23254-6-ehabkost@redhat.com> In-Reply-To: <20190110142955.23254-1-ehabkost@redhat.com> References: <20190110142955.23254-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 10 Jan 2019 14:30:35 +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/10] memory-device: rewrite address assignment using ranges 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: David Hildenbrand 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: David Hildenbrand Let's rewrite it properly using ranges. This fixes certain overflows that are right now possible. E.g. qemu-system-x86_64 -m 4G,slots=3D20,maxmem=3D40G -M pc \ -object memory-backend-file,id=3Dmem1,share,mem-path=3D/dev/zero,size= =3D2G -device pc-dimm,memdev=3Dmem1,id=3Ddimm1,addr=3D-0x40000000 Now properly errors out instead of succeeding. (Note that qapi parsing of huge uint64_t values is broken and fixes are on the way) "can't add memory device [0xffffffffa0000000:0x80000000], usable range for memory devices [0x140000000:0xe00000000]" Signed-off-by: David Hildenbrand Message-Id: <20181214131043.25071-3-david@redhat.com> Reviewed-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Eduardo Habkost --- hw/mem/memory-device.c | 51 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/hw/mem/memory-device.c b/hw/mem/memory-device.c index 8be63c8032..5f2c408036 100644 --- a/hw/mem/memory-device.c +++ b/hw/mem/memory-device.c @@ -100,9 +100,8 @@ static uint64_t memory_device_get_free_addr(MachineStat= e *ms, uint64_t align, uint64_t size, Error **errp) { - uint64_t address_space_start, address_space_end; GSList *list =3D NULL, *item; - uint64_t new_addr =3D 0; + Range as, new =3D range_empty; =20 if (!ms->device_memory) { error_setg(errp, "memory devices (e.g. for memory hotplug) are not= " @@ -115,13 +114,11 @@ static uint64_t memory_device_get_free_addr(MachineSt= ate *ms, "enabled, please specify the maxmem option"); return 0; } - address_space_start =3D ms->device_memory->base; - address_space_end =3D address_space_start + - memory_region_size(&ms->device_memory->mr); - g_assert(address_space_end >=3D address_space_start); + range_init_nofail(&as, ms->device_memory->base, + memory_region_size(&ms->device_memory->mr)); =20 - /* address_space_start indicates the maximum alignment we expect */ - if (!QEMU_IS_ALIGNED(address_space_start, align)) { + /* start of address space indicates the maximum alignment we expect */ + if (!QEMU_IS_ALIGNED(range_lob(&as), align)) { error_setg(errp, "the alignment (0x%" PRIx64 ") is not supported", align); return 0; @@ -145,20 +142,18 @@ static uint64_t memory_device_get_free_addr(MachineSt= ate *ms, } =20 if (hint) { - new_addr =3D *hint; - if (new_addr < address_space_start) { + if (range_init(&new, *hint, size) || !range_contains_range(&as, &n= ew)) { error_setg(errp, "can't add memory device [0x%" PRIx64 ":0x%" = PRIx64 - "] before 0x%" PRIx64, new_addr, size, - address_space_start); - return 0; - } else if ((new_addr + size) > address_space_end) { - error_setg(errp, "can't add memory device [0x%" PRIx64 ":0x%" = PRIx64 - "] beyond 0x%" PRIx64, new_addr, size, - address_space_end); + "], usable range for memory devices [0x%" PRIx64 ":= 0x%" + PRIx64 "]", *hint, size, range_lob(&as), + range_size(&as)); return 0; } } else { - new_addr =3D address_space_start; + if (range_init(&new, range_lob(&as), size)) { + error_setg(errp, "can't add memory device, device too big"); + return 0; + } } =20 /* find address range that will fit new memory device */ @@ -166,30 +161,36 @@ static uint64_t memory_device_get_free_addr(MachineSt= ate *ms, for (item =3D list; item; item =3D g_slist_next(item)) { const MemoryDeviceState *md =3D item->data; const MemoryDeviceClass *mdc =3D MEMORY_DEVICE_GET_CLASS(OBJECT(md= )); - uint64_t md_size, md_addr; + uint64_t next_addr; + Range tmp; =20 - md_addr =3D mdc->get_addr(md); - md_size =3D memory_device_get_region_size(md, &error_abort); + range_init_nofail(&tmp, mdc->get_addr(md), + memory_device_get_region_size(md, &error_abort)); =20 - if (ranges_overlap(md_addr, md_size, new_addr, size)) { + if (range_overlaps_range(&tmp, &new)) { if (hint) { const DeviceState *d =3D DEVICE(md); error_setg(errp, "address range conflicts with memory devi= ce" " id=3D'%s'", d->id ? d->id : "(unnamed)"); goto out; } - new_addr =3D QEMU_ALIGN_UP(md_addr + md_size, align); + + next_addr =3D QEMU_ALIGN_UP(range_upb(&tmp) + 1, align); + if (!next_addr || range_init(&new, next_addr, range_size(&new)= )) { + range_make_empty(&new); + break; + } } } =20 - if (new_addr + size > address_space_end) { + if (!range_contains_range(&as, &new)) { error_setg(errp, "could not find position in guest address space f= or " "memory device - memory fragmented due to alignments"); goto out; } out: g_slist_free(list); - return new_addr; + return range_lob(&new); } =20 MemoryDeviceInfoList *qmp_memory_device_list(void) --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 18 21:33:45 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547131206946565.8757208663526; Thu, 10 Jan 2019 06:40:06 -0800 (PST) Received: from localhost ([127.0.0.1]:37844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbV7-0003L5-HK for importer@patchew.org; Thu, 10 Jan 2019 09:40:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbLy-0004JG-Vc for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghbLx-00063P-Sz for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55318) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghbLx-00062t-Mz for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:37 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DDCC74025D; Thu, 10 Jan 2019 14:30:36 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 630FE5D757; Thu, 10 Jan 2019 14:30:36 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 12:29:51 -0200 Message-Id: <20190110142955.23254-7-ehabkost@redhat.com> In-Reply-To: <20190110142955.23254-1-ehabkost@redhat.com> References: <20190110142955.23254-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 10 Jan 2019 14:30: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 06/10] spapr: Eliminate SPAPR_PCI_2_7_MMIO_WIN_SIZE macro 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-Type: text/plain; charset="utf-8" The macro is only used in one place, where the purpose of the value is obvious. Eliminate the macro so we don't need to rely on stringify(). Signed-off-by: Eduardo Habkost Message-Id: <20190107193020.21744-2-ehabkost@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Acked-by: David Gibson Reviewed-by: Cornelia Huck Signed-off-by: Eduardo Habkost --- include/hw/pci-host/spapr.h | 1 - hw/ppc/spapr.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 4eb3a2ce3e..a5a7bf4837 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -101,7 +101,6 @@ struct sPAPRPHBState { #define SPAPR_MAX_PHBS ((SPAPR_PCI_LIMIT - SPAPR_PCI_BASE) / \ SPAPR_PCI_MEM64_WIN_SIZE - 1) =20 -#define SPAPR_PCI_2_7_MMIO_WIN_SIZE 0xf80000000 #define SPAPR_PCI_IO_WIN_SIZE 0x10000 =20 #define SPAPR_PCI_MSI_WINDOW 0x40000000000ULL diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 83081defde..54a19d2db8 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4285,7 +4285,7 @@ static void spapr_machine_2_7_class_options(MachineCl= ass *mc) { .driver =3D TYPE_SPAPR_PCI_HOST_BRIDGE, .property =3D "mem_win_size", - .value =3D stringify(SPAPR_PCI_2_7_MMIO_WIN_SIZE), + .value =3D "0xf80000000", }, { .driver =3D TYPE_SPAPR_PCI_HOST_BRIDGE, --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 18 21:33:45 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547132015182540.0412537429605; Thu, 10 Jan 2019 06:53:35 -0800 (PST) Received: from localhost ([127.0.0.1]:41285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbiA-0004qb-4t for importer@patchew.org; Thu, 10 Jan 2019 09:53:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbM9-0004RL-I7 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghbM0-00065Z-A6 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41386) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghbLz-00064w-W9 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:40 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39CE2A7FE1; Thu, 10 Jan 2019 14:30:39 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 769FD5D76C; Thu, 10 Jan 2019 14:30:38 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 12:29:52 -0200 Message-Id: <20190110142955.23254-8-ehabkost@redhat.com> In-Reply-To: <20190110142955.23254-1-ehabkost@redhat.com> References: <20190110142955.23254-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 10 Jan 2019 14:30:39 +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/10] machine: Eliminate unnecessary stringify() usage 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-Type: text/plain; charset="utf-8" stringify() is useful when we need to use macros in compat_props (like when we set virtio-baloon-pci.class=3DPCI_CLASS_MEMORY_RAM at pc_i440fx_1_0_machine_options()), but it is pointless when we are already providing a number literal. Replace stringify() with string literals when appropriate. Signed-off-by: Eduardo Habkost Message-Id: <20190107193020.21744-3-ehabkost@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: David Gibson Reviewed-by: Cornelia Huck Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Eduardo Habkost --- hw/core/machine.c | 8 ++-- hw/i386/pc.c | 94 +++++++++++++++++++++++------------------------ hw/i386/pc_piix.c | 30 +++++++-------- hw/ppc/spapr.c | 2 +- 4 files changed, 67 insertions(+), 67 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index f8563efb86..4b4d6c23de 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -135,11 +135,11 @@ GlobalProperty hw_compat_2_8[] =3D { { .driver =3D "fw_cfg_mem", .property =3D "x-file-slots", - .value =3D stringify(0x10), + .value =3D "0x10", },{ .driver =3D "fw_cfg_io", .property =3D "x-file-slots", - .value =3D stringify(0x10), + .value =3D "0x10", },{ .driver =3D "pflash_cfi01", .property =3D "old-multiple-chip-handling", @@ -337,11 +337,11 @@ GlobalProperty hw_compat_2_1[] =3D { },{ .driver =3D "usb-mouse", .property =3D "usb_version", - .value =3D stringify(1), + .value =3D "1", },{ .driver =3D "usb-kbd", .property =3D "usb_version", - .value =3D stringify(1), + .value =3D "1", },{ .driver =3D "virtio-pci", .property =3D "virtio-pci-bus-master-bug-migration", diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 4952feb476..ff14b6d4df 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -148,11 +148,11 @@ GlobalProperty pc_compat_2_12[] =3D { },{ .driver =3D "EPYC-" TYPE_X86_CPU, .property =3D "xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", },{ .driver =3D "EPYC-IBPB-" TYPE_X86_CPU, .property =3D "xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", }, }; const size_t pc_compat_2_12_len =3D G_N_ELEMENTS(pc_compat_2_12); @@ -191,7 +191,7 @@ GlobalProperty pc_compat_2_9[] =3D { { .driver =3D "mch", .property =3D "extended-tseg-mbytes", - .value =3D stringify(0), + .value =3D "0", }, }; const size_t pc_compat_2_9_len =3D G_N_ELEMENTS(pc_compat_2_9); @@ -365,75 +365,75 @@ GlobalProperty pc_compat_2_3[] =3D { },{ .driver =3D "qemu64" "-" TYPE_X86_CPU, .property =3D "min-level", - .value =3D stringify(4), + .value =3D "4", },{ .driver =3D "kvm64" "-" TYPE_X86_CPU, .property =3D "min-level", - .value =3D stringify(5), + .value =3D "5", },{ .driver =3D "pentium3" "-" TYPE_X86_CPU, .property =3D "min-level", - .value =3D stringify(2), + .value =3D "2", },{ .driver =3D "n270" "-" TYPE_X86_CPU, .property =3D "min-level", - .value =3D stringify(5), + .value =3D "5", },{ .driver =3D "Conroe" "-" TYPE_X86_CPU, .property =3D "min-level", - .value =3D stringify(4), + .value =3D "4", },{ .driver =3D "Penryn" "-" TYPE_X86_CPU, .property =3D "min-level", - .value =3D stringify(4), + .value =3D "4", },{ .driver =3D "Nehalem" "-" TYPE_X86_CPU, .property =3D "min-level", - .value =3D stringify(4), + .value =3D "4", },{ .driver =3D "n270" "-" TYPE_X86_CPU, .property =3D "min-xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", },{ .driver =3D "Penryn" "-" TYPE_X86_CPU, .property =3D "min-xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", },{ .driver =3D "Conroe" "-" TYPE_X86_CPU, .property =3D "min-xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", },{ .driver =3D "Nehalem" "-" TYPE_X86_CPU, .property =3D "min-xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", },{ .driver =3D "Westmere" "-" TYPE_X86_CPU, .property =3D "min-xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", },{ .driver =3D "SandyBridge" "-" TYPE_X86_CPU, .property =3D "min-xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", },{ .driver =3D "IvyBridge" "-" TYPE_X86_CPU, .property =3D "min-xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", },{ .driver =3D "Haswell" "-" TYPE_X86_CPU, .property =3D "min-xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", },{ .driver =3D "Haswell-noTSX" "-" TYPE_X86_CPU, .property =3D "min-xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", },{ .driver =3D "Broadwell" "-" TYPE_X86_CPU, .property =3D "min-xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", },{ .driver =3D "Broadwell-noTSX" "-" TYPE_X86_CPU, .property =3D "min-xlevel", - .value =3D stringify(0x8000000a), + .value =3D "0x8000000a", },{ .driver =3D TYPE_X86_CPU, .property =3D "kvm-no-smi-migration", @@ -566,7 +566,7 @@ GlobalProperty pc_compat_2_0[] =3D { { .driver =3D "apic", .property =3D "version", - .value =3D stringify(0x11), + .value =3D "0x11", }, { .driver =3D "nec-usb-xhci", @@ -581,17 +581,17 @@ GlobalProperty pc_compat_2_0[] =3D { { .driver =3D "pci-serial", .property =3D "prog_if", - .value =3D stringify(0), + .value =3D "0", }, { .driver =3D "pci-serial-2x", .property =3D "prog_if", - .value =3D stringify(0), + .value =3D "0", }, { .driver =3D "pci-serial-4x", .property =3D "prog_if", - .value =3D stringify(0), + .value =3D "0", }, { .driver =3D "virtio-net-pci", @@ -629,7 +629,7 @@ GlobalProperty pc_compat_1_7[] =3D { { .driver =3D "hpet", .property =3D HPET_INTCAP, - .value =3D stringify(4), + .value =3D "4", }, }; const size_t pc_compat_1_7_len =3D G_N_ELEMENTS(pc_compat_1_7); @@ -643,19 +643,19 @@ GlobalProperty pc_compat_1_6[] =3D { },{ .driver =3D "qemu64-" TYPE_X86_CPU, .property =3D "model", - .value =3D stringify(2), + .value =3D "2", },{ .driver =3D "qemu32-" TYPE_X86_CPU, .property =3D "model", - .value =3D stringify(3), + .value =3D "3", },{ .driver =3D "i440FX-pcihost", .property =3D "short_root_bus", - .value =3D stringify(1), + .value =3D "1", },{ .driver =3D "q35-pcihost", .property =3D "short_root_bus", - .value =3D stringify(1), + .value =3D "1", }, }; const size_t pc_compat_1_6_len =3D G_N_ELEMENTS(pc_compat_1_6); @@ -665,27 +665,27 @@ GlobalProperty pc_compat_1_5[] =3D { { .driver =3D "Conroe-" TYPE_X86_CPU, .property =3D "model", - .value =3D stringify(2), + .value =3D "2", },{ .driver =3D "Conroe-" TYPE_X86_CPU, .property =3D "min-level", - .value =3D stringify(2), + .value =3D "2", },{ .driver =3D "Penryn-" TYPE_X86_CPU, .property =3D "model", - .value =3D stringify(2), + .value =3D "2", },{ .driver =3D "Penryn-" TYPE_X86_CPU, .property =3D "min-level", - .value =3D stringify(2), + .value =3D "2", },{ .driver =3D "Nehalem-" TYPE_X86_CPU, .property =3D "model", - .value =3D stringify(2), + .value =3D "2", },{ .driver =3D "Nehalem-" TYPE_X86_CPU, .property =3D "min-level", - .value =3D stringify(2), + .value =3D "2", },{ .driver =3D "virtio-net-pci", .property =3D "any_layout", @@ -697,11 +697,11 @@ GlobalProperty pc_compat_1_5[] =3D { },{ .driver =3D "i440FX-pcihost", .property =3D "short_root_bus", - .value =3D stringify(0), + .value =3D "0", },{ .driver =3D "q35-pcihost", .property =3D "short_root_bus", - .value =3D stringify(0), + .value =3D "0", }, }; const size_t pc_compat_1_5_len =3D G_N_ELEMENTS(pc_compat_1_5); @@ -711,36 +711,36 @@ GlobalProperty pc_compat_1_4[] =3D { { .driver =3D "scsi-hd", .property =3D "discard_granularity", - .value =3D stringify(0), + .value =3D "0", },{ .driver =3D "scsi-cd", .property =3D "discard_granularity", - .value =3D stringify(0), + .value =3D "0", },{ .driver =3D "scsi-disk", .property =3D "discard_granularity", - .value =3D stringify(0), + .value =3D "0", },{ .driver =3D "ide-hd", .property =3D "discard_granularity", - .value =3D stringify(0), + .value =3D "0", },{ .driver =3D "ide-cd", .property =3D "discard_granularity", - .value =3D stringify(0), + .value =3D "0", },{ .driver =3D "ide-drive", .property =3D "discard_granularity", - .value =3D stringify(0), + .value =3D "0", },{ .driver =3D "virtio-blk-pci", .property =3D "discard_granularity", - .value =3D stringify(0), + .value =3D "0", },{ .driver =3D "virtio-serial-pci", .property =3D "vectors", /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */ - .value =3D stringify(0xFFFFFFFF), + .value =3D "0xFFFFFFFF", },{ .driver =3D "virtio-net-pci", .property =3D "ctrl_guest_offloads", @@ -768,7 +768,7 @@ GlobalProperty pc_compat_1_4[] =3D { },{ .driver =3D "486-" TYPE_X86_CPU, .property =3D "model", - .value =3D stringify(0), + .value =3D "0", }, { .driver =3D "n270" "-" TYPE_X86_CPU, diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ed6984638e..fd20227af3 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -697,7 +697,7 @@ static void pc_i440fx_1_3_machine_options(MachineClass = *m) { .driver =3D "usb-tablet", .property =3D "usb_version", - .value =3D stringify(1), + .value =3D "1", },{ .driver =3D "virtio-net-pci", .property =3D "ctrl_mac_addr", @@ -741,11 +741,11 @@ static void pc_i440fx_1_2_machine_options(MachineClas= s *m) },{ .driver =3D "qxl", .property =3D "revision", - .value =3D stringify(3), + .value =3D "3", },{ .driver =3D "qxl-vga", .property =3D "revision", - .value =3D stringify(3), + .value =3D "3", },{ .driver =3D "VGA", .property =3D "mmio", @@ -777,19 +777,19 @@ static void pc_i440fx_1_1_machine_options(MachineClas= s *m) },{ .driver =3D "VGA", .property =3D "vgamem_mb", - .value =3D stringify(8), + .value =3D "8", },{ .driver =3D "vmware-svga", .property =3D "vgamem_mb", - .value =3D stringify(8), + .value =3D "8", },{ .driver =3D "qxl-vga", .property =3D "vgamem_mb", - .value =3D stringify(8), + .value =3D "8", },{ .driver =3D "qxl", .property =3D "vgamem_mb", - .value =3D stringify(8), + .value =3D "8", },{ .driver =3D "virtio-blk-pci", .property =3D "config-wce", @@ -876,11 +876,11 @@ static void pc_i440fx_0_14_machine_options(MachineCla= ss *m) },{ .driver =3D "qxl", .property =3D "revision", - .value =3D stringify(2), + .value =3D "2", },{ .driver =3D "qxl-vga", .property =3D "revision", - .value =3D stringify(2), + .value =3D "2", }, }; =20 @@ -904,19 +904,19 @@ static void pc_i440fx_0_13_machine_options(MachineCla= ss *m) },{ .driver =3D "AC97", .property =3D "use_broken_id", - .value =3D stringify(1), + .value =3D "1", },{ .driver =3D "virtio-9p-pci", .property =3D "vectors", - .value =3D stringify(0), + .value =3D "0", },{ .driver =3D "VGA", .property =3D "rombar", - .value =3D stringify(0), + .value =3D "0", },{ .driver =3D "vmware-svga", .property =3D "rombar", - .value =3D stringify(0), + .value =3D "0", }, }; =20 @@ -936,11 +936,11 @@ static void pc_i440fx_0_12_machine_options(MachineCla= ss *m) { .driver =3D "virtio-serial-pci", .property =3D "max_ports", - .value =3D stringify(1), + .value =3D "1", },{ .driver =3D "virtio-serial-pci", .property =3D "vectors", - .value =3D stringify(0), + .value =3D "0", },{ .driver =3D "usb-mouse", .property =3D "serial", diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 54a19d2db8..b6e42c7775 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4324,7 +4324,7 @@ static void spapr_machine_2_6_class_options(MachineCl= ass *mc) { .driver =3D TYPE_SPAPR_PCI_HOST_BRIDGE, .property =3D "ddw", - .value =3D stringify(off), + .value =3D "off", }, }; =20 --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 18 21:33:45 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 154713142929958.60283523188161; Thu, 10 Jan 2019 06:43:49 -0800 (PST) Received: from localhost ([127.0.0.1]:38826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbYg-0006Dp-JH for importer@patchew.org; Thu, 10 Jan 2019 09:43:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbMF-0004UN-Hm for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:31:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghbM8-00069x-04 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41472) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghbM4-00066q-6X for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:45 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BEC87A429D; Thu, 10 Jan 2019 14:30:41 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 998241001F5E; Thu, 10 Jan 2019 14:30:40 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 12:29:53 -0200 Message-Id: <20190110142955.23254-9-ehabkost@redhat.com> In-Reply-To: <20190110142955.23254-1-ehabkost@redhat.com> References: <20190110142955.23254-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 10 Jan 2019 14:30:41 +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 08/10] machine: Use shorter format for GlobalProperty arrays 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-Type: text/plain; charset="utf-8" Instead of verbose arrays with 4 lines for each entry, make each entry take only one line. This makes long arrays that couldn't fit in the screen become short and readable. Signed-off-by: Eduardo Habkost Message-Id: <20190107193020.21744-4-ehabkost@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Cornelia Huck Signed-off-by: Eduardo Habkost --- include/hw/i386/pc.h | 18 +- hw/core/machine.c | 338 ++++------------- hw/i386/pc.c | 720 +++++++------------------------------ hw/i386/pc_piix.c | 192 ++-------- hw/ppc/spapr.c | 72 +--- hw/s390x/s390-virtio-ccw.c | 75 +--- hw/xen/xen-common.c | 18 +- 7 files changed, 265 insertions(+), 1168 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 84720bede9..0abbe45637 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -354,21 +354,9 @@ extern const size_t pc_compat_1_4_len; * depending on QEMU versions up to QEMU 2.4. */ #define PC_CPU_MODEL_IDS(v) \ - {\ - .driver =3D "qemu32-" TYPE_X86_CPU,\ - .property =3D "model-id",\ - .value =3D "QEMU Virtual CPU version " v,\ - },\ - {\ - .driver =3D "qemu64-" TYPE_X86_CPU,\ - .property =3D "model-id",\ - .value =3D "QEMU Virtual CPU version " v,\ - },\ - {\ - .driver =3D "athlon-" TYPE_X86_CPU,\ - .property =3D "model-id",\ - .value =3D "QEMU Virtual CPU version " v,\ - }, + { "qemu32-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }= ,\ + { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }= ,\ + { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, =20 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *da= ta) \ diff --git a/hw/core/machine.c b/hw/core/machine.c index 4b4d6c23de..5530b71981 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -24,23 +24,10 @@ #include "hw/pci/pci.h" =20 GlobalProperty hw_compat_3_1[] =3D { - { - .driver =3D "pcie-root-port", - .property =3D "x-speed", - .value =3D "2_5", - },{ - .driver =3D "pcie-root-port", - .property =3D "x-width", - .value =3D "1", - },{ - .driver =3D "memory-backend-file", - .property =3D "x-use-canonical-path-for-ramblock-id", - .value =3D "true", - },{ - .driver =3D "memory-backend-memfd", - .property =3D "x-use-canonical-path-for-ramblock-id", - .value =3D "true", - }, + { "pcie-root-port", "x-speed", "2_5" }, + { "pcie-root-port", "x-width", "1" }, + { "memory-backend-file", "x-use-canonical-path-for-ramblock-id", "true= " }, + { "memory-backend-memfd", "x-use-canonical-path-for-ramblock-id", "tru= e" }, }; const size_t hw_compat_3_1_len =3D G_N_ELEMENTS(hw_compat_3_1); =20 @@ -48,269 +35,96 @@ GlobalProperty hw_compat_3_0[] =3D {}; const size_t hw_compat_3_0_len =3D G_N_ELEMENTS(hw_compat_3_0); =20 GlobalProperty hw_compat_2_12[] =3D { - { - .driver =3D "migration", - .property =3D "decompress-error-check", - .value =3D "off", - },{ - .driver =3D "hda-audio", - .property =3D "use-timer", - .value =3D "false", - },{ - .driver =3D "cirrus-vga", - .property =3D "global-vmstate", - .value =3D "true", - },{ - .driver =3D "VGA", - .property =3D "global-vmstate", - .value =3D "true", - },{ - .driver =3D "vmware-svga", - .property =3D "global-vmstate", - .value =3D "true", - },{ - .driver =3D "qxl-vga", - .property =3D "global-vmstate", - .value =3D "true", - }, + { "migration", "decompress-error-check", "off" }, + { "hda-audio", "use-timer", "false" }, + { "cirrus-vga", "global-vmstate", "true" }, + { "VGA", "global-vmstate", "true" }, + { "vmware-svga", "global-vmstate", "true" }, + { "qxl-vga", "global-vmstate", "true" }, }; const size_t hw_compat_2_12_len =3D G_N_ELEMENTS(hw_compat_2_12); =20 GlobalProperty hw_compat_2_11[] =3D { - { - .driver =3D "hpet", - .property =3D "hpet-offset-saved", - .value =3D "false", - },{ - .driver =3D "virtio-blk-pci", - .property =3D "vectors", - .value =3D "2", - },{ - .driver =3D "vhost-user-blk-pci", - .property =3D "vectors", - .value =3D "2", - },{ - .driver =3D "e1000", - .property =3D "migrate_tso_props", - .value =3D "off", - }, + { "hpet", "hpet-offset-saved", "false" }, + { "virtio-blk-pci", "vectors", "2" }, + { "vhost-user-blk-pci", "vectors", "2" }, + { "e1000", "migrate_tso_props", "off" }, }; const size_t hw_compat_2_11_len =3D G_N_ELEMENTS(hw_compat_2_11); =20 GlobalProperty hw_compat_2_10[] =3D { - { - .driver =3D "virtio-mouse-device", - .property =3D "wheel-axis", - .value =3D "false", - },{ - .driver =3D "virtio-tablet-device", - .property =3D "wheel-axis", - .value =3D "false", - }, + { "virtio-mouse-device", "wheel-axis", "false" }, + { "virtio-tablet-device", "wheel-axis", "false" }, }; const size_t hw_compat_2_10_len =3D G_N_ELEMENTS(hw_compat_2_10); =20 GlobalProperty hw_compat_2_9[] =3D { - { - .driver =3D "pci-bridge", - .property =3D "shpc", - .value =3D "off", - },{ - .driver =3D "intel-iommu", - .property =3D "pt", - .value =3D "off", - },{ - .driver =3D "virtio-net-device", - .property =3D "x-mtu-bypass-backend", - .value =3D "off", - },{ - .driver =3D "pcie-root-port", - .property =3D "x-migrate-msix", - .value =3D "false", - }, + { "pci-bridge", "shpc", "off" }, + { "intel-iommu", "pt", "off" }, + { "virtio-net-device", "x-mtu-bypass-backend", "off" }, + { "pcie-root-port", "x-migrate-msix", "false" }, }; const size_t hw_compat_2_9_len =3D G_N_ELEMENTS(hw_compat_2_9); =20 GlobalProperty hw_compat_2_8[] =3D { - { - .driver =3D "fw_cfg_mem", - .property =3D "x-file-slots", - .value =3D "0x10", - },{ - .driver =3D "fw_cfg_io", - .property =3D "x-file-slots", - .value =3D "0x10", - },{ - .driver =3D "pflash_cfi01", - .property =3D "old-multiple-chip-handling", - .value =3D "on", - },{ - .driver =3D "pci-bridge", - .property =3D "shpc", - .value =3D "on", - },{ - .driver =3D TYPE_PCI_DEVICE, - .property =3D "x-pcie-extcap-init", - .value =3D "off", - },{ - .driver =3D "virtio-pci", - .property =3D "x-pcie-deverr-init", - .value =3D "off", - },{ - .driver =3D "virtio-pci", - .property =3D "x-pcie-lnkctl-init", - .value =3D "off", - },{ - .driver =3D "virtio-pci", - .property =3D "x-pcie-pm-init", - .value =3D "off", - },{ - .driver =3D "cirrus-vga", - .property =3D "vgamem_mb", - .value =3D "8", - },{ - .driver =3D "isa-cirrus-vga", - .property =3D "vgamem_mb", - .value =3D "8", - }, + { "fw_cfg_mem", "x-file-slots", "0x10" }, + { "fw_cfg_io", "x-file-slots", "0x10" }, + { "pflash_cfi01", "old-multiple-chip-handling", "on" }, + { "pci-bridge", "shpc", "on" }, + { TYPE_PCI_DEVICE, "x-pcie-extcap-init", "off" }, + { "virtio-pci", "x-pcie-deverr-init", "off" }, + { "virtio-pci", "x-pcie-lnkctl-init", "off" }, + { "virtio-pci", "x-pcie-pm-init", "off" }, + { "cirrus-vga", "vgamem_mb", "8" }, + { "isa-cirrus-vga", "vgamem_mb", "8" }, }; const size_t hw_compat_2_8_len =3D G_N_ELEMENTS(hw_compat_2_8); =20 GlobalProperty hw_compat_2_7[] =3D { - { - .driver =3D "virtio-pci", - .property =3D "page-per-vq", - .value =3D "on", - },{ - .driver =3D "virtio-serial-device", - .property =3D "emergency-write", - .value =3D "off", - },{ - .driver =3D "ioapic", - .property =3D "version", - .value =3D "0x11", - },{ - .driver =3D "intel-iommu", - .property =3D "x-buggy-eim", - .value =3D "true", - },{ - .driver =3D "virtio-pci", - .property =3D "x-ignore-backend-features", - .value =3D "on", - }, + { "virtio-pci", "page-per-vq", "on" }, + { "virtio-serial-device", "emergency-write", "off" }, + { "ioapic", "version", "0x11" }, + { "intel-iommu", "x-buggy-eim", "true" }, + { "virtio-pci", "x-ignore-backend-features", "on" }, }; const size_t hw_compat_2_7_len =3D G_N_ELEMENTS(hw_compat_2_7); =20 GlobalProperty hw_compat_2_6[] =3D { - { - .driver =3D "virtio-mmio", - .property =3D "format_transport_address", - .value =3D "off", - },{ - .driver =3D "virtio-pci", - .property =3D "disable-modern", - .value =3D "on", - },{ - .driver =3D "virtio-pci", - .property =3D "disable-legacy", - .value =3D "off", - }, + { "virtio-mmio", "format_transport_address", "off" }, + { "virtio-pci", "disable-modern", "on" }, + { "virtio-pci", "disable-legacy", "off" }, }; const size_t hw_compat_2_6_len =3D G_N_ELEMENTS(hw_compat_2_6); =20 GlobalProperty hw_compat_2_5[] =3D { - { - .driver =3D "isa-fdc", - .property =3D "fallback", - .value =3D "144", - },{ - .driver =3D "pvscsi", - .property =3D "x-old-pci-configuration", - .value =3D "on", - },{ - .driver =3D "pvscsi", - .property =3D "x-disable-pcie", - .value =3D "on", - }, - { - .driver =3D "vmxnet3", - .property =3D "x-old-msi-offsets", - .value =3D "on", - },{ - .driver =3D "vmxnet3", - .property =3D "x-disable-pcie", - .value =3D "on", - }, + { "isa-fdc", "fallback", "144" }, + { "pvscsi", "x-old-pci-configuration", "on" }, + { "pvscsi", "x-disable-pcie", "on" }, + { "vmxnet3", "x-old-msi-offsets", "on" }, + { "vmxnet3", "x-disable-pcie", "on" }, }; const size_t hw_compat_2_5_len =3D G_N_ELEMENTS(hw_compat_2_5); =20 GlobalProperty hw_compat_2_4[] =3D { - { - .driver =3D "virtio-blk-device", - .property =3D "scsi", - .value =3D "true", - },{ - .driver =3D "e1000", - .property =3D "extra_mac_registers", - .value =3D "off", - },{ - .driver =3D "virtio-pci", - .property =3D "x-disable-pcie", - .value =3D "on", - },{ - .driver =3D "virtio-pci", - .property =3D "migrate-extra", - .value =3D "off", - },{ - .driver =3D "fw_cfg_mem", - .property =3D "dma_enabled", - .value =3D "off", - },{ - .driver =3D "fw_cfg_io", - .property =3D "dma_enabled", - .value =3D "off", - } + { "virtio-blk-device", "scsi", "true" }, + { "e1000", "extra_mac_registers", "off" }, + { "virtio-pci", "x-disable-pcie", "on" }, + { "virtio-pci", "migrate-extra", "off" }, + { "fw_cfg_mem", "dma_enabled", "off" }, + { "fw_cfg_io", "dma_enabled", "off" } }; const size_t hw_compat_2_4_len =3D G_N_ELEMENTS(hw_compat_2_4); =20 GlobalProperty hw_compat_2_3[] =3D { - { - .driver =3D "virtio-blk-pci", - .property =3D "any_layout", - .value =3D "off", - },{ - .driver =3D "virtio-balloon-pci", - .property =3D "any_layout", - .value =3D "off", - },{ - .driver =3D "virtio-serial-pci", - .property =3D "any_layout", - .value =3D "off", - },{ - .driver =3D "virtio-9p-pci", - .property =3D "any_layout", - .value =3D "off", - },{ - .driver =3D "virtio-rng-pci", - .property =3D "any_layout", - .value =3D "off", - },{ - .driver =3D TYPE_PCI_DEVICE, - .property =3D "x-pcie-lnksta-dllla", - .value =3D "off", - },{ - .driver =3D "migration", - .property =3D "send-configuration", - .value =3D "off", - },{ - .driver =3D "migration", - .property =3D "send-section-footer", - .value =3D "off", - },{ - .driver =3D "migration", - .property =3D "store-global-state", - .value =3D "off", - }, + { "virtio-blk-pci", "any_layout", "off" }, + { "virtio-balloon-pci", "any_layout", "off" }, + { "virtio-serial-pci", "any_layout", "off" }, + { "virtio-9p-pci", "any_layout", "off" }, + { "virtio-rng-pci", "any_layout", "off" }, + { TYPE_PCI_DEVICE, "x-pcie-lnksta-dllla", "off" }, + { "migration", "send-configuration", "off" }, + { "migration", "send-section-footer", "off" }, + { "migration", "store-global-state", "off" }, }; const size_t hw_compat_2_3_len =3D G_N_ELEMENTS(hw_compat_2_3); =20 @@ -318,35 +132,13 @@ GlobalProperty hw_compat_2_2[] =3D {}; const size_t hw_compat_2_2_len =3D G_N_ELEMENTS(hw_compat_2_2); =20 GlobalProperty hw_compat_2_1[] =3D { - { - .driver =3D "intel-hda", - .property =3D "old_msi_addr", - .value =3D "on", - },{ - .driver =3D "VGA", - .property =3D "qemu-extended-regs", - .value =3D "off", - },{ - .driver =3D "secondary-vga", - .property =3D "qemu-extended-regs", - .value =3D "off", - },{ - .driver =3D "virtio-scsi-pci", - .property =3D "any_layout", - .value =3D "off", - },{ - .driver =3D "usb-mouse", - .property =3D "usb_version", - .value =3D "1", - },{ - .driver =3D "usb-kbd", - .property =3D "usb_version", - .value =3D "1", - },{ - .driver =3D "virtio-pci", - .property =3D "virtio-pci-bus-master-bug-migration", - .value =3D "on", - }, + { "intel-hda", "old_msi_addr", "on" }, + { "VGA", "qemu-extended-regs", "off" }, + { "secondary-vga", "qemu-extended-regs", "off" }, + { "virtio-scsi-pci", "any_layout", "off" }, + { "usb-mouse", "usb_version", "1" }, + { "usb-kbd", "usb_version", "1" }, + { "virtio-pci", "virtio-pci-bus-master-bug-migration", "on" }, }; const size_t hw_compat_2_1_len =3D G_N_ELEMENTS(hw_compat_2_1); =20 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index ff14b6d4df..f238424499 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -111,174 +111,67 @@ static unsigned e820_entries; struct hpet_fw_config hpet_cfg =3D {.count =3D UINT8_MAX}; =20 GlobalProperty pc_compat_3_1[] =3D { - { - .driver =3D "intel-iommu", - .property =3D "dma-drain", - .value =3D "off", - }, + { "intel-iommu", "dma-drain", "off" }, }; const size_t pc_compat_3_1_len =3D G_N_ELEMENTS(pc_compat_3_1); =20 GlobalProperty pc_compat_3_0[] =3D { - { - .driver =3D TYPE_X86_CPU, - .property =3D "x-hv-synic-kvm-only", - .value =3D "on", - },{ - .driver =3D "Skylake-Server" "-" TYPE_X86_CPU, - .property =3D "pku", - .value =3D "off", - },{ - .driver =3D "Skylake-Server-IBRS" "-" TYPE_X86_CPU, - .property =3D "pku", - .value =3D "off", - }, + { TYPE_X86_CPU, "x-hv-synic-kvm-only", "on" }, + { "Skylake-Server" "-" TYPE_X86_CPU, "pku", "off" }, + { "Skylake-Server-IBRS" "-" TYPE_X86_CPU, "pku", "off" }, }; const size_t pc_compat_3_0_len =3D G_N_ELEMENTS(pc_compat_3_0); =20 GlobalProperty pc_compat_2_12[] =3D { - { - .driver =3D TYPE_X86_CPU, - .property =3D "legacy-cache", - .value =3D "on", - },{ - .driver =3D TYPE_X86_CPU, - .property =3D "topoext", - .value =3D "off", - },{ - .driver =3D "EPYC-" TYPE_X86_CPU, - .property =3D "xlevel", - .value =3D "0x8000000a", - },{ - .driver =3D "EPYC-IBPB-" TYPE_X86_CPU, - .property =3D "xlevel", - .value =3D "0x8000000a", - }, + { TYPE_X86_CPU, "legacy-cache", "on" }, + { TYPE_X86_CPU, "topoext", "off" }, + { "EPYC-" TYPE_X86_CPU, "xlevel", "0x8000000a" }, + { "EPYC-IBPB-" TYPE_X86_CPU, "xlevel", "0x8000000a" }, }; const size_t pc_compat_2_12_len =3D G_N_ELEMENTS(pc_compat_2_12); =20 GlobalProperty pc_compat_2_11[] =3D { - { - .driver =3D TYPE_X86_CPU, - .property =3D "x-migrate-smi-count", - .value =3D "off", - },{ - .driver =3D "Skylake-Server" "-" TYPE_X86_CPU, - .property =3D "clflushopt", - .value =3D "off", - }, + { TYPE_X86_CPU, "x-migrate-smi-count", "off" }, + { "Skylake-Server" "-" TYPE_X86_CPU, "clflushopt", "off" }, }; const size_t pc_compat_2_11_len =3D G_N_ELEMENTS(pc_compat_2_11); =20 GlobalProperty pc_compat_2_10[] =3D { - { - .driver =3D TYPE_X86_CPU, - .property =3D "x-hv-max-vps", - .value =3D "0x40", - },{ - .driver =3D "i440FX-pcihost", - .property =3D "x-pci-hole64-fix", - .value =3D "off", - },{ - .driver =3D "q35-pcihost", - .property =3D "x-pci-hole64-fix", - .value =3D "off", - }, + { TYPE_X86_CPU, "x-hv-max-vps", "0x40" }, + { "i440FX-pcihost", "x-pci-hole64-fix", "off" }, + { "q35-pcihost", "x-pci-hole64-fix", "off" }, }; const size_t pc_compat_2_10_len =3D G_N_ELEMENTS(pc_compat_2_10); =20 GlobalProperty pc_compat_2_9[] =3D { - { - .driver =3D "mch", - .property =3D "extended-tseg-mbytes", - .value =3D "0", - }, + { "mch", "extended-tseg-mbytes", "0" }, }; const size_t pc_compat_2_9_len =3D G_N_ELEMENTS(pc_compat_2_9); =20 GlobalProperty pc_compat_2_8[] =3D { - { - .driver =3D TYPE_X86_CPU, - .property =3D "tcg-cpuid", - .value =3D "off", - }, - { - .driver =3D "kvmclock", - .property =3D "x-mach-use-reliable-get-clock", - .value =3D "off", - }, - { - .driver =3D "ICH9-LPC", - .property =3D "x-smi-broadcast", - .value =3D "off", - }, - { - .driver =3D TYPE_X86_CPU, - .property =3D "vmware-cpuid-freq", - .value =3D "off", - }, - { - .driver =3D "Haswell-" TYPE_X86_CPU, - .property =3D "stepping", - .value =3D "1", - }, + { TYPE_X86_CPU, "tcg-cpuid", "off" }, + { "kvmclock", "x-mach-use-reliable-get-clock", "off" }, + { "ICH9-LPC", "x-smi-broadcast", "off" }, + { TYPE_X86_CPU, "vmware-cpuid-freq", "off" }, + { "Haswell-" TYPE_X86_CPU, "stepping", "1" }, }; const size_t pc_compat_2_8_len =3D G_N_ELEMENTS(pc_compat_2_8); =20 GlobalProperty pc_compat_2_7[] =3D { - { - .driver =3D TYPE_X86_CPU, - .property =3D "l3-cache", - .value =3D "off", - }, - { - .driver =3D TYPE_X86_CPU, - .property =3D "full-cpuid-auto-level", - .value =3D "off", - }, - { - .driver =3D "Opteron_G3" "-" TYPE_X86_CPU, - .property =3D "family", - .value =3D "15", - }, - { - .driver =3D "Opteron_G3" "-" TYPE_X86_CPU, - .property =3D "model", - .value =3D "6", - }, - { - .driver =3D "Opteron_G3" "-" TYPE_X86_CPU, - .property =3D "stepping", - .value =3D "1", - }, - { - .driver =3D "isa-pcspk", - .property =3D "migrate", - .value =3D "off", - }, + { TYPE_X86_CPU, "l3-cache", "off" }, + { TYPE_X86_CPU, "full-cpuid-auto-level", "off" }, + { "Opteron_G3" "-" TYPE_X86_CPU, "family", "15" }, + { "Opteron_G3" "-" TYPE_X86_CPU, "model", "6" }, + { "Opteron_G3" "-" TYPE_X86_CPU, "stepping", "1" }, + { "isa-pcspk", "migrate", "off" }, }; const size_t pc_compat_2_7_len =3D G_N_ELEMENTS(pc_compat_2_7); =20 GlobalProperty pc_compat_2_6[] =3D { - { - .driver =3D TYPE_X86_CPU, - .property =3D "cpuid-0xb", - .value =3D "off", - },{ - .driver =3D "vmxnet3", - .property =3D "romfile", - .value =3D "", - }, - { - .driver =3D TYPE_X86_CPU, - .property =3D "fill-mtrr-mask", - .value =3D "off", - }, - { - .driver =3D "apic-common", - .property =3D "legacy-instance-id", - .value =3D "on", - } + { TYPE_X86_CPU, "cpuid-0xb", "off" }, + { "vmxnet3", "romfile", "" }, + { TYPE_X86_CPU, "fill-mtrr-mask", "off" }, + { "apic-common", "legacy-instance-id", "on", } }; const size_t pc_compat_2_6_len =3D G_N_ELEMENTS(pc_compat_2_6); =20 @@ -287,499 +180,148 @@ const size_t pc_compat_2_5_len =3D G_N_ELEMENTS(pc_= compat_2_5); =20 GlobalProperty pc_compat_2_4[] =3D { PC_CPU_MODEL_IDS("2.4.0") - { - .driver =3D "Haswell-" TYPE_X86_CPU, - .property =3D "abm", - .value =3D "off", - }, - { - .driver =3D "Haswell-noTSX-" TYPE_X86_CPU, - .property =3D "abm", - .value =3D "off", - }, - { - .driver =3D "Broadwell-" TYPE_X86_CPU, - .property =3D "abm", - .value =3D "off", - }, - { - .driver =3D "Broadwell-noTSX-" TYPE_X86_CPU, - .property =3D "abm", - .value =3D "off", - }, - { - .driver =3D "host" "-" TYPE_X86_CPU, - .property =3D "host-cache-info", - .value =3D "on", - }, - { - .driver =3D TYPE_X86_CPU, - .property =3D "check", - .value =3D "off", - }, - { - .driver =3D "qemu64" "-" TYPE_X86_CPU, - .property =3D "sse4a", - .value =3D "on", - }, - { - .driver =3D "qemu64" "-" TYPE_X86_CPU, - .property =3D "abm", - .value =3D "on", - }, - { - .driver =3D "qemu64" "-" TYPE_X86_CPU, - .property =3D "popcnt", - .value =3D "on", - }, - { - .driver =3D "qemu32" "-" TYPE_X86_CPU, - .property =3D "popcnt", - .value =3D "on", - },{ - .driver =3D "Opteron_G2" "-" TYPE_X86_CPU, - .property =3D "rdtscp", - .value =3D "on", - },{ - .driver =3D "Opteron_G3" "-" TYPE_X86_CPU, - .property =3D "rdtscp", - .value =3D "on", - },{ - .driver =3D "Opteron_G4" "-" TYPE_X86_CPU, - .property =3D "rdtscp", - .value =3D "on", - },{ - .driver =3D "Opteron_G5" "-" TYPE_X86_CPU, - .property =3D "rdtscp", - .value =3D "on", - } + { "Haswell-" TYPE_X86_CPU, "abm", "off" }, + { "Haswell-noTSX-" TYPE_X86_CPU, "abm", "off" }, + { "Broadwell-" TYPE_X86_CPU, "abm", "off" }, + { "Broadwell-noTSX-" TYPE_X86_CPU, "abm", "off" }, + { "host" "-" TYPE_X86_CPU, "host-cache-info", "on" }, + { TYPE_X86_CPU, "check", "off" }, + { "qemu64" "-" TYPE_X86_CPU, "sse4a", "on" }, + { "qemu64" "-" TYPE_X86_CPU, "abm", "on" }, + { "qemu64" "-" TYPE_X86_CPU, "popcnt", "on" }, + { "qemu32" "-" TYPE_X86_CPU, "popcnt", "on" }, + { "Opteron_G2" "-" TYPE_X86_CPU, "rdtscp", "on" }, + { "Opteron_G3" "-" TYPE_X86_CPU, "rdtscp", "on" }, + { "Opteron_G4" "-" TYPE_X86_CPU, "rdtscp", "on" }, + { "Opteron_G5" "-" TYPE_X86_CPU, "rdtscp", "on", } }; const size_t pc_compat_2_4_len =3D G_N_ELEMENTS(pc_compat_2_4); =20 GlobalProperty pc_compat_2_3[] =3D { PC_CPU_MODEL_IDS("2.3.0") - { - .driver =3D TYPE_X86_CPU, - .property =3D "arat", - .value =3D "off", - },{ - .driver =3D "qemu64" "-" TYPE_X86_CPU, - .property =3D "min-level", - .value =3D "4", - },{ - .driver =3D "kvm64" "-" TYPE_X86_CPU, - .property =3D "min-level", - .value =3D "5", - },{ - .driver =3D "pentium3" "-" TYPE_X86_CPU, - .property =3D "min-level", - .value =3D "2", - },{ - .driver =3D "n270" "-" TYPE_X86_CPU, - .property =3D "min-level", - .value =3D "5", - },{ - .driver =3D "Conroe" "-" TYPE_X86_CPU, - .property =3D "min-level", - .value =3D "4", - },{ - .driver =3D "Penryn" "-" TYPE_X86_CPU, - .property =3D "min-level", - .value =3D "4", - },{ - .driver =3D "Nehalem" "-" TYPE_X86_CPU, - .property =3D "min-level", - .value =3D "4", - },{ - .driver =3D "n270" "-" TYPE_X86_CPU, - .property =3D "min-xlevel", - .value =3D "0x8000000a", - },{ - .driver =3D "Penryn" "-" TYPE_X86_CPU, - .property =3D "min-xlevel", - .value =3D "0x8000000a", - },{ - .driver =3D "Conroe" "-" TYPE_X86_CPU, - .property =3D "min-xlevel", - .value =3D "0x8000000a", - },{ - .driver =3D "Nehalem" "-" TYPE_X86_CPU, - .property =3D "min-xlevel", - .value =3D "0x8000000a", - },{ - .driver =3D "Westmere" "-" TYPE_X86_CPU, - .property =3D "min-xlevel", - .value =3D "0x8000000a", - },{ - .driver =3D "SandyBridge" "-" TYPE_X86_CPU, - .property =3D "min-xlevel", - .value =3D "0x8000000a", - },{ - .driver =3D "IvyBridge" "-" TYPE_X86_CPU, - .property =3D "min-xlevel", - .value =3D "0x8000000a", - },{ - .driver =3D "Haswell" "-" TYPE_X86_CPU, - .property =3D "min-xlevel", - .value =3D "0x8000000a", - },{ - .driver =3D "Haswell-noTSX" "-" TYPE_X86_CPU, - .property =3D "min-xlevel", - .value =3D "0x8000000a", - },{ - .driver =3D "Broadwell" "-" TYPE_X86_CPU, - .property =3D "min-xlevel", - .value =3D "0x8000000a", - },{ - .driver =3D "Broadwell-noTSX" "-" TYPE_X86_CPU, - .property =3D "min-xlevel", - .value =3D "0x8000000a", - },{ - .driver =3D TYPE_X86_CPU, - .property =3D "kvm-no-smi-migration", - .value =3D "on", - }, + { TYPE_X86_CPU, "arat", "off" }, + { "qemu64" "-" TYPE_X86_CPU, "min-level", "4" }, + { "kvm64" "-" TYPE_X86_CPU, "min-level", "5" }, + { "pentium3" "-" TYPE_X86_CPU, "min-level", "2" }, + { "n270" "-" TYPE_X86_CPU, "min-level", "5" }, + { "Conroe" "-" TYPE_X86_CPU, "min-level", "4" }, + { "Penryn" "-" TYPE_X86_CPU, "min-level", "4" }, + { "Nehalem" "-" TYPE_X86_CPU, "min-level", "4" }, + { "n270" "-" TYPE_X86_CPU, "min-xlevel", "0x8000000a" }, + { "Penryn" "-" TYPE_X86_CPU, "min-xlevel", "0x8000000a" }, + { "Conroe" "-" TYPE_X86_CPU, "min-xlevel", "0x8000000a" }, + { "Nehalem" "-" TYPE_X86_CPU, "min-xlevel", "0x8000000a" }, + { "Westmere" "-" TYPE_X86_CPU, "min-xlevel", "0x8000000a" }, + { "SandyBridge" "-" TYPE_X86_CPU, "min-xlevel", "0x8000000a" }, + { "IvyBridge" "-" TYPE_X86_CPU, "min-xlevel", "0x8000000a" }, + { "Haswell" "-" TYPE_X86_CPU, "min-xlevel", "0x8000000a" }, + { "Haswell-noTSX" "-" TYPE_X86_CPU, "min-xlevel", "0x8000000a" }, + { "Broadwell" "-" TYPE_X86_CPU, "min-xlevel", "0x8000000a" }, + { "Broadwell-noTSX" "-" TYPE_X86_CPU, "min-xlevel", "0x8000000a" }, + { TYPE_X86_CPU, "kvm-no-smi-migration", "on" }, }; const size_t pc_compat_2_3_len =3D G_N_ELEMENTS(pc_compat_2_3); =20 GlobalProperty pc_compat_2_2[] =3D { PC_CPU_MODEL_IDS("2.2.0") - { - .driver =3D "kvm64" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "kvm32" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "Conroe" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "Penryn" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "Nehalem" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "Westmere" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "SandyBridge" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "Haswell" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "Broadwell" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "Opteron_G1" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "Opteron_G2" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "Opteron_G3" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "Opteron_G4" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "Opteron_G5" "-" TYPE_X86_CPU, - .property =3D "vme", - .value =3D "off", - }, - { - .driver =3D "Haswell" "-" TYPE_X86_CPU, - .property =3D "f16c", - .value =3D "off", - }, - { - .driver =3D "Haswell" "-" TYPE_X86_CPU, - .property =3D "rdrand", - .value =3D "off", - }, - { - .driver =3D "Broadwell" "-" TYPE_X86_CPU, - .property =3D "f16c", - .value =3D "off", - }, - { - .driver =3D "Broadwell" "-" TYPE_X86_CPU, - .property =3D "rdrand", - .value =3D "off", - }, + { "kvm64" "-" TYPE_X86_CPU, "vme", "off" }, + { "kvm32" "-" TYPE_X86_CPU, "vme", "off" }, + { "Conroe" "-" TYPE_X86_CPU, "vme", "off" }, + { "Penryn" "-" TYPE_X86_CPU, "vme", "off" }, + { "Nehalem" "-" TYPE_X86_CPU, "vme", "off" }, + { "Westmere" "-" TYPE_X86_CPU, "vme", "off" }, + { "SandyBridge" "-" TYPE_X86_CPU, "vme", "off" }, + { "Haswell" "-" TYPE_X86_CPU, "vme", "off" }, + { "Broadwell" "-" TYPE_X86_CPU, "vme", "off" }, + { "Opteron_G1" "-" TYPE_X86_CPU, "vme", "off" }, + { "Opteron_G2" "-" TYPE_X86_CPU, "vme", "off" }, + { "Opteron_G3" "-" TYPE_X86_CPU, "vme", "off" }, + { "Opteron_G4" "-" TYPE_X86_CPU, "vme", "off" }, + { "Opteron_G5" "-" TYPE_X86_CPU, "vme", "off" }, + { "Haswell" "-" TYPE_X86_CPU, "f16c", "off" }, + { "Haswell" "-" TYPE_X86_CPU, "rdrand", "off" }, + { "Broadwell" "-" TYPE_X86_CPU, "f16c", "off" }, + { "Broadwell" "-" TYPE_X86_CPU, "rdrand", "off" }, }; const size_t pc_compat_2_2_len =3D G_N_ELEMENTS(pc_compat_2_2); =20 GlobalProperty pc_compat_2_1[] =3D { PC_CPU_MODEL_IDS("2.1.0") - { - .driver =3D "coreduo" "-" TYPE_X86_CPU, - .property =3D "vmx", - .value =3D "on", - }, - { - .driver =3D "core2duo" "-" TYPE_X86_CPU, - .property =3D "vmx", - .value =3D "on", - }, + { "coreduo" "-" TYPE_X86_CPU, "vmx", "on" }, + { "core2duo" "-" TYPE_X86_CPU, "vmx", "on" }, }; const size_t pc_compat_2_1_len =3D G_N_ELEMENTS(pc_compat_2_1); =20 GlobalProperty pc_compat_2_0[] =3D { PC_CPU_MODEL_IDS("2.0.0") - { - .driver =3D "virtio-scsi-pci", - .property =3D "any_layout", - .value =3D "off", - },{ - .driver =3D "PIIX4_PM", - .property =3D "memory-hotplug-support", - .value =3D "off", - }, - { - .driver =3D "apic", - .property =3D "version", - .value =3D "0x11", - }, - { - .driver =3D "nec-usb-xhci", - .property =3D "superspeed-ports-first", - .value =3D "off", - }, - { - .driver =3D "nec-usb-xhci", - .property =3D "force-pcie-endcap", - .value =3D "on", - }, - { - .driver =3D "pci-serial", - .property =3D "prog_if", - .value =3D "0", - }, - { - .driver =3D "pci-serial-2x", - .property =3D "prog_if", - .value =3D "0", - }, - { - .driver =3D "pci-serial-4x", - .property =3D "prog_if", - .value =3D "0", - }, - { - .driver =3D "virtio-net-pci", - .property =3D "guest_announce", - .value =3D "off", - }, - { - .driver =3D "ICH9-LPC", - .property =3D "memory-hotplug-support", - .value =3D "off", - },{ - .driver =3D "xio3130-downstream", - .property =3D COMPAT_PROP_PCP, - .value =3D "off", - },{ - .driver =3D "ioh3420", - .property =3D COMPAT_PROP_PCP, - .value =3D "off", - }, + { "virtio-scsi-pci", "any_layout", "off" }, + { "PIIX4_PM", "memory-hotplug-support", "off" }, + { "apic", "version", "0x11" }, + { "nec-usb-xhci", "superspeed-ports-first", "off" }, + { "nec-usb-xhci", "force-pcie-endcap", "on" }, + { "pci-serial", "prog_if", "0" }, + { "pci-serial-2x", "prog_if", "0" }, + { "pci-serial-4x", "prog_if", "0" }, + { "virtio-net-pci", "guest_announce", "off" }, + { "ICH9-LPC", "memory-hotplug-support", "off" }, + { "xio3130-downstream", COMPAT_PROP_PCP, "off" }, + { "ioh3420", COMPAT_PROP_PCP, "off" }, }; const size_t pc_compat_2_0_len =3D G_N_ELEMENTS(pc_compat_2_0); =20 GlobalProperty pc_compat_1_7[] =3D { PC_CPU_MODEL_IDS("1.7.0") - { - .driver =3D TYPE_USB_DEVICE, - .property =3D "msos-desc", - .value =3D "no", - }, - { - .driver =3D "PIIX4_PM", - .property =3D "acpi-pci-hotplug-with-bridge-support", - .value =3D "off", - }, - { - .driver =3D "hpet", - .property =3D HPET_INTCAP, - .value =3D "4", - }, + { TYPE_USB_DEVICE, "msos-desc", "no" }, + { "PIIX4_PM", "acpi-pci-hotplug-with-bridge-support", "off" }, + { "hpet", HPET_INTCAP, "4" }, }; const size_t pc_compat_1_7_len =3D G_N_ELEMENTS(pc_compat_1_7); =20 GlobalProperty pc_compat_1_6[] =3D { PC_CPU_MODEL_IDS("1.6.0") - { - .driver =3D "e1000", - .property =3D "mitigation", - .value =3D "off", - },{ - .driver =3D "qemu64-" TYPE_X86_CPU, - .property =3D "model", - .value =3D "2", - },{ - .driver =3D "qemu32-" TYPE_X86_CPU, - .property =3D "model", - .value =3D "3", - },{ - .driver =3D "i440FX-pcihost", - .property =3D "short_root_bus", - .value =3D "1", - },{ - .driver =3D "q35-pcihost", - .property =3D "short_root_bus", - .value =3D "1", - }, + { "e1000", "mitigation", "off" }, + { "qemu64-" TYPE_X86_CPU, "model", "2" }, + { "qemu32-" TYPE_X86_CPU, "model", "3" }, + { "i440FX-pcihost", "short_root_bus", "1" }, + { "q35-pcihost", "short_root_bus", "1" }, }; const size_t pc_compat_1_6_len =3D G_N_ELEMENTS(pc_compat_1_6); =20 GlobalProperty pc_compat_1_5[] =3D { PC_CPU_MODEL_IDS("1.5.0") - { - .driver =3D "Conroe-" TYPE_X86_CPU, - .property =3D "model", - .value =3D "2", - },{ - .driver =3D "Conroe-" TYPE_X86_CPU, - .property =3D "min-level", - .value =3D "2", - },{ - .driver =3D "Penryn-" TYPE_X86_CPU, - .property =3D "model", - .value =3D "2", - },{ - .driver =3D "Penryn-" TYPE_X86_CPU, - .property =3D "min-level", - .value =3D "2", - },{ - .driver =3D "Nehalem-" TYPE_X86_CPU, - .property =3D "model", - .value =3D "2", - },{ - .driver =3D "Nehalem-" TYPE_X86_CPU, - .property =3D "min-level", - .value =3D "2", - },{ - .driver =3D "virtio-net-pci", - .property =3D "any_layout", - .value =3D "off", - },{ - .driver =3D TYPE_X86_CPU, - .property =3D "pmu", - .value =3D "on", - },{ - .driver =3D "i440FX-pcihost", - .property =3D "short_root_bus", - .value =3D "0", - },{ - .driver =3D "q35-pcihost", - .property =3D "short_root_bus", - .value =3D "0", - }, + { "Conroe-" TYPE_X86_CPU, "model", "2" }, + { "Conroe-" TYPE_X86_CPU, "min-level", "2" }, + { "Penryn-" TYPE_X86_CPU, "model", "2" }, + { "Penryn-" TYPE_X86_CPU, "min-level", "2" }, + { "Nehalem-" TYPE_X86_CPU, "model", "2" }, + { "Nehalem-" TYPE_X86_CPU, "min-level", "2" }, + { "virtio-net-pci", "any_layout", "off" }, + { TYPE_X86_CPU, "pmu", "on" }, + { "i440FX-pcihost", "short_root_bus", "0" }, + { "q35-pcihost", "short_root_bus", "0" }, }; const size_t pc_compat_1_5_len =3D G_N_ELEMENTS(pc_compat_1_5); =20 GlobalProperty pc_compat_1_4[] =3D { PC_CPU_MODEL_IDS("1.4.0") - { - .driver =3D "scsi-hd", - .property =3D "discard_granularity", - .value =3D "0", - },{ - .driver =3D "scsi-cd", - .property =3D "discard_granularity", - .value =3D "0", - },{ - .driver =3D "scsi-disk", - .property =3D "discard_granularity", - .value =3D "0", - },{ - .driver =3D "ide-hd", - .property =3D "discard_granularity", - .value =3D "0", - },{ - .driver =3D "ide-cd", - .property =3D "discard_granularity", - .value =3D "0", - },{ - .driver =3D "ide-drive", - .property =3D "discard_granularity", - .value =3D "0", - },{ - .driver =3D "virtio-blk-pci", - .property =3D "discard_granularity", - .value =3D "0", - },{ - .driver =3D "virtio-serial-pci", - .property =3D "vectors", - /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */ - .value =3D "0xFFFFFFFF", - },{ - .driver =3D "virtio-net-pci", - .property =3D "ctrl_guest_offloads", - .value =3D "off", - },{ - .driver =3D "e1000", - .property =3D "romfile", - .value =3D "pxe-e1000.rom", - },{ - .driver =3D "ne2k_pci", - .property =3D "romfile", - .value =3D "pxe-ne2k_pci.rom", - },{ - .driver =3D "pcnet", - .property =3D "romfile", - .value =3D "pxe-pcnet.rom", - },{ - .driver =3D "rtl8139", - .property =3D "romfile", - .value =3D "pxe-rtl8139.rom", - },{ - .driver =3D "virtio-net-pci", - .property =3D "romfile", - .value =3D "pxe-virtio.rom", - },{ - .driver =3D "486-" TYPE_X86_CPU, - .property =3D "model", - .value =3D "0", - }, - { - .driver =3D "n270" "-" TYPE_X86_CPU, - .property =3D "movbe", - .value =3D "off", - }, - { - .driver =3D "Westmere" "-" TYPE_X86_CPU, - .property =3D "pclmulqdq", - .value =3D "off", - }, + { "scsi-hd", "discard_granularity", "0" }, + { "scsi-cd", "discard_granularity", "0" }, + { "scsi-disk", "discard_granularity", "0" }, + { "ide-hd", "discard_granularity", "0" }, + { "ide-cd", "discard_granularity", "0" }, + { "ide-drive", "discard_granularity", "0" }, + { "virtio-blk-pci", "discard_granularity", "0" }, + /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string: */ + { "virtio-serial-pci", "vectors", "0xFFFFFFFF" }, + { "virtio-net-pci", "ctrl_guest_offloads", "off" }, + { "e1000", "romfile", "pxe-e1000.rom" }, + { "ne2k_pci", "romfile", "pxe-ne2k_pci.rom" }, + { "pcnet", "romfile", "pxe-pcnet.rom" }, + { "rtl8139", "romfile", "pxe-rtl8139.rom" }, + { "virtio-net-pci", "romfile", "pxe-virtio.rom" }, + { "486-" TYPE_X86_CPU, "model", "0" }, + { "n270" "-" TYPE_X86_CPU, "movbe", "off" }, + { "Westmere" "-" TYPE_X86_CPU, "pclmulqdq", "off" }, }; const size_t pc_compat_1_4_len =3D G_N_ELEMENTS(pc_compat_1_4); =20 diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index fd20227af3..5088e2f492 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -694,23 +694,10 @@ static void pc_i440fx_1_3_machine_options(MachineClas= s *m) { static GlobalProperty compat[] =3D { PC_CPU_MODEL_IDS("1.3.0") - { - .driver =3D "usb-tablet", - .property =3D "usb_version", - .value =3D "1", - },{ - .driver =3D "virtio-net-pci", - .property =3D "ctrl_mac_addr", - .value =3D "off", - },{ - .driver =3D "virtio-net-pci", - .property =3D "mq", - .value =3D "off", - }, { - .driver =3D "e1000", - .property =3D "autonegotiation", - .value =3D "off", - }, + { "usb-tablet", "usb_version", "1" }, + { "virtio-net-pci", "ctrl_mac_addr", "off" }, + { "virtio-net-pci", "mq", "off" }, + { "e1000", "autonegotiation", "off" }, }; =20 pc_i440fx_1_4_machine_options(m); @@ -726,31 +713,12 @@ static void pc_i440fx_1_2_machine_options(MachineClas= s *m) { static GlobalProperty compat[] =3D { PC_CPU_MODEL_IDS("1.2.0") - { - .driver =3D "nec-usb-xhci", - .property =3D "msi", - .value =3D "off", - },{ - .driver =3D "nec-usb-xhci", - .property =3D "msix", - .value =3D "off", - },{ - .driver =3D "ivshmem", - .property =3D "use64", - .value =3D "0", - },{ - .driver =3D "qxl", - .property =3D "revision", - .value =3D "3", - },{ - .driver =3D "qxl-vga", - .property =3D "revision", - .value =3D "3", - },{ - .driver =3D "VGA", - .property =3D "mmio", - .value =3D "off", - }, + { "nec-usb-xhci", "msi", "off" }, + { "nec-usb-xhci", "msix", "off" }, + { "ivshmem", "use64", "0" }, + { "qxl", "revision", "3" }, + { "qxl-vga", "revision", "3" }, + { "VGA", "mmio", "off" }, }; =20 pc_i440fx_1_3_machine_options(m); @@ -766,35 +734,13 @@ static void pc_i440fx_1_1_machine_options(MachineClas= s *m) { static GlobalProperty compat[] =3D { PC_CPU_MODEL_IDS("1.1.0") - { - .driver =3D "virtio-scsi-pci", - .property =3D "hotplug", - .value =3D "off", - },{ - .driver =3D "virtio-scsi-pci", - .property =3D "param_change", - .value =3D "off", - },{ - .driver =3D "VGA", - .property =3D "vgamem_mb", - .value =3D "8", - },{ - .driver =3D "vmware-svga", - .property =3D "vgamem_mb", - .value =3D "8", - },{ - .driver =3D "qxl-vga", - .property =3D "vgamem_mb", - .value =3D "8", - },{ - .driver =3D "qxl", - .property =3D "vgamem_mb", - .value =3D "8", - },{ - .driver =3D "virtio-blk-pci", - .property =3D "config-wce", - .value =3D "off", - }, + { "virtio-scsi-pci", "hotplug", "off" }, + { "virtio-scsi-pci", "param_change", "off" }, + { "VGA", "vgamem_mb", "8" }, + { "vmware-svga", "vgamem_mb", "8" }, + { "qxl-vga", "vgamem_mb", "8" }, + { "qxl", "vgamem_mb", "8" }, + { "virtio-blk-pci", "config-wce", "off" }, }; =20 pc_i440fx_1_2_machine_options(m); @@ -809,23 +755,10 @@ static void pc_i440fx_1_0_machine_options(MachineClas= s *m) { static GlobalProperty compat[] =3D { PC_CPU_MODEL_IDS("1.0") - { - .driver =3D TYPE_ISA_FDC, - .property =3D "check_media_rate", - .value =3D "off", - },{ - .driver =3D "virtio-balloon-pci", - .property =3D "class", - .value =3D stringify(PCI_CLASS_MEMORY_RAM), - },{ - .driver =3D "apic-common", - .property =3D "vapic", - .value =3D "off", - },{ - .driver =3D TYPE_USB_DEVICE, - .property =3D "full-path", - .value =3D "no", - }, + { TYPE_ISA_FDC, "check_media_rate", "off" }, + { "virtio-balloon-pci", "class", stringify(PCI_CLASS_MEMORY_RAM) }, + { "apic-common", "vapic", "off" }, + { TYPE_USB_DEVICE, "full-path", "no" }, }; =20 pc_i440fx_1_1_machine_options(m); @@ -857,31 +790,12 @@ static void pc_i440fx_0_14_machine_options(MachineCla= ss *m) { static GlobalProperty compat[] =3D { PC_CPU_MODEL_IDS("0.14") - { - .driver =3D "virtio-blk-pci", - .property =3D "event_idx", - .value =3D "off", - },{ - .driver =3D "virtio-serial-pci", - .property =3D "event_idx", - .value =3D "off", - },{ - .driver =3D "virtio-net-pci", - .property =3D "event_idx", - .value =3D "off", - },{ - .driver =3D "virtio-balloon-pci", - .property =3D "event_idx", - .value =3D "off", - },{ - .driver =3D "qxl", - .property =3D "revision", - .value =3D "2", - },{ - .driver =3D "qxl-vga", - .property =3D "revision", - .value =3D "2", - }, + { "virtio-blk-pci", "event_idx", "off" }, + { "virtio-serial-pci", "event_idx", "off" }, + { "virtio-net-pci", "event_idx", "off" }, + { "virtio-balloon-pci", "event_idx", "off" }, + { "qxl", "revision", "2" }, + { "qxl-vga", "revision", "2" }, }; =20 pc_i440fx_0_15_machine_options(m); @@ -897,27 +811,11 @@ static void pc_i440fx_0_13_machine_options(MachineCla= ss *m) PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); static GlobalProperty compat[] =3D { PC_CPU_MODEL_IDS("0.13") - { - .driver =3D TYPE_PCI_DEVICE, - .property =3D "command_serr_enable", - .value =3D "off", - },{ - .driver =3D "AC97", - .property =3D "use_broken_id", - .value =3D "1", - },{ - .driver =3D "virtio-9p-pci", - .property =3D "vectors", - .value =3D "0", - },{ - .driver =3D "VGA", - .property =3D "rombar", - .value =3D "0", - },{ - .driver =3D "vmware-svga", - .property =3D "rombar", - .value =3D "0", - }, + { TYPE_PCI_DEVICE, "command_serr_enable", "off" }, + { "AC97", "use_broken_id", "1" }, + { "virtio-9p-pci", "vectors", "0" }, + { "VGA", "rombar", "0" }, + { "vmware-svga", "rombar", "0" }, }; =20 pc_i440fx_0_14_machine_options(m); @@ -933,27 +831,11 @@ static void pc_i440fx_0_12_machine_options(MachineCla= ss *m) { static GlobalProperty compat[] =3D { PC_CPU_MODEL_IDS("0.12") - { - .driver =3D "virtio-serial-pci", - .property =3D "max_ports", - .value =3D "1", - },{ - .driver =3D "virtio-serial-pci", - .property =3D "vectors", - .value =3D "0", - },{ - .driver =3D "usb-mouse", - .property =3D "serial", - .value =3D "1", - },{ - .driver =3D "usb-tablet", - .property =3D "serial", - .value =3D "1", - },{ - .driver =3D "usb-kbd", - .property =3D "serial", - .value =3D "1", - }, + { "virtio-serial-pci", "max_ports", "1" }, + { "virtio-serial-pci", "vectors", "0" }, + { "usb-mouse", "serial", "1" }, + { "usb-tablet", "serial", "1" }, + { "usb-kbd", "serial", "1" }, }; =20 pc_i440fx_0_13_machine_options(m); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index b6e42c7775..0942f35bf8 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4113,16 +4113,8 @@ static void spapr_machine_2_12_class_options(Machine= Class *mc) { sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); static GlobalProperty compat[] =3D { - { - .driver =3D TYPE_POWERPC_CPU, - .property =3D "pre-3.0-migration", - .value =3D "on", - }, - { - .driver =3D TYPE_SPAPR_CPU_CORE, - .property =3D "pre-3.0-migration", - .value =3D "on", - }, + { TYPE_POWERPC_CPU, "pre-3.0-migration", "on" }, + { TYPE_SPAPR_CPU_CORE, "pre-3.0-migration", "on" }, }; =20 spapr_machine_3_0_class_options(mc); @@ -4186,11 +4178,7 @@ static void spapr_machine_2_9_class_options(MachineC= lass *mc) { sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); static GlobalProperty compat[] =3D { - { - .driver =3D TYPE_POWERPC_CPU, - .property =3D "pre-2.10-migration", - .value =3D "on", - }, + { TYPE_POWERPC_CPU, "pre-2.10-migration", "on" }, }; =20 spapr_machine_2_10_class_options(mc); @@ -4210,11 +4198,7 @@ DEFINE_SPAPR_MACHINE(2_9, "2.9", false); static void spapr_machine_2_8_class_options(MachineClass *mc) { static GlobalProperty compat[] =3D { - { - .driver =3D TYPE_SPAPR_PCI_HOST_BRIDGE, - .property =3D "pcie-extended-configuration-space", - .value =3D "off", - }, + { TYPE_SPAPR_PCI_HOST_BRIDGE, "pcie-extended-configuration-space",= "off" }, }; =20 spapr_machine_2_9_class_options(mc); @@ -4282,26 +4266,10 @@ static void spapr_machine_2_7_class_options(Machine= Class *mc) { sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); static GlobalProperty compat[] =3D { - { - .driver =3D TYPE_SPAPR_PCI_HOST_BRIDGE, - .property =3D "mem_win_size", - .value =3D "0xf80000000", - }, - { - .driver =3D TYPE_SPAPR_PCI_HOST_BRIDGE, - .property =3D "mem64_win_size", - .value =3D "0", - }, - { - .driver =3D TYPE_POWERPC_CPU, - .property =3D "pre-2.8-migration", - .value =3D "on", - }, - { - .driver =3D TYPE_SPAPR_PCI_HOST_BRIDGE, - .property =3D "pre-2.8-migration", - .value =3D "on", - }, + { TYPE_SPAPR_PCI_HOST_BRIDGE, "mem_win_size", "0xf80000000", }, + { TYPE_SPAPR_PCI_HOST_BRIDGE, "mem64_win_size", "0", }, + { TYPE_POWERPC_CPU, "pre-2.8-migration", "on", }, + { TYPE_SPAPR_PCI_HOST_BRIDGE, "pre-2.8-migration", "on", }, }; =20 spapr_machine_2_8_class_options(mc); @@ -4321,11 +4289,7 @@ DEFINE_SPAPR_MACHINE(2_7, "2.7", false); static void spapr_machine_2_6_class_options(MachineClass *mc) { static GlobalProperty compat[] =3D { - { - .driver =3D TYPE_SPAPR_PCI_HOST_BRIDGE, - .property =3D "ddw", - .value =3D "off", - }, + { TYPE_SPAPR_PCI_HOST_BRIDGE, "ddw", "off" }, }; =20 spapr_machine_2_7_class_options(mc); @@ -4344,11 +4308,7 @@ static void spapr_machine_2_5_class_options(MachineC= lass *mc) { sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); static GlobalProperty compat[] =3D { - { - .driver =3D "spapr-vlan", - .property =3D "use-rx-buffer-pools", - .value =3D "off", - }, + { "spapr-vlan", "use-rx-buffer-pools", "off" }, }; =20 spapr_machine_2_6_class_options(mc); @@ -4381,11 +4341,7 @@ DEFINE_SPAPR_MACHINE(2_4, "2.4", false); static void spapr_machine_2_3_class_options(MachineClass *mc) { static GlobalProperty compat[] =3D { - { - .driver =3D "spapr-pci-host-bridge", - .property =3D "dynamic-reconfiguration", - .value =3D "off", - }, + { "spapr-pci-host-bridge", "dynamic-reconfiguration", "off" }, }; spapr_machine_2_4_class_options(mc); compat_props_add(mc->compat_props, hw_compat_2_3, hw_compat_2_3_len); @@ -4400,11 +4356,7 @@ DEFINE_SPAPR_MACHINE(2_3, "2.3", false); static void spapr_machine_2_2_class_options(MachineClass *mc) { static GlobalProperty compat[] =3D { - { - .driver =3D TYPE_SPAPR_PCI_HOST_BRIDGE, - .property =3D "mem_win_size", - .value =3D "0x20000000", - }, + { TYPE_SPAPR_PCI_HOST_BRIDGE, "mem_win_size", "0x20000000" }, }; =20 spapr_machine_2_3_class_options(mc); diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index c737507053..811fdf913d 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -712,11 +712,7 @@ static void ccw_machine_2_11_instance_options(MachineS= tate *machine) static void ccw_machine_2_11_class_options(MachineClass *mc) { static GlobalProperty compat[] =3D { - { - .driver =3D TYPE_SCLP_EVENT_FACILITY, - .property =3D "allow_all_mask_sizes", - .value =3D "off", - }, + { TYPE_SCLP_EVENT_FACILITY, "allow_all_mask_sizes", "off", }, }; =20 ccw_machine_2_12_class_options(mc); @@ -751,11 +747,7 @@ static void ccw_machine_2_9_class_options(MachineClass= *mc) { S390CcwMachineClass *s390mc =3D S390_MACHINE_CLASS(mc); static GlobalProperty compat[] =3D { - { - .driver =3D TYPE_S390_STATTRIB, - .property =3D "migration-enabled", - .value =3D "off", - }, + { TYPE_S390_STATTRIB, "migration-enabled", "off", }, }; =20 ccw_machine_2_10_class_options(mc); @@ -773,11 +765,7 @@ static void ccw_machine_2_8_instance_options(MachineSt= ate *machine) static void ccw_machine_2_8_class_options(MachineClass *mc) { static GlobalProperty compat[] =3D { - { - .driver =3D TYPE_S390_FLIC_COMMON, - .property =3D "adapter_routes_max_batch", - .value =3D "64", - }, + { TYPE_S390_FLIC_COMMON, "adapter_routes_max_batch", "64", }, }; =20 ccw_machine_2_9_class_options(mc); @@ -810,15 +798,8 @@ static void ccw_machine_2_6_class_options(MachineClass= *mc) { S390CcwMachineClass *s390mc =3D S390_MACHINE_CLASS(mc); static GlobalProperty compat[] =3D { - { - .driver =3D TYPE_S390_IPL, - .property =3D "iplbext_migration", - .value =3D "off", - }, { - .driver =3D TYPE_VIRTUAL_CSS_BRIDGE, - .property =3D "css_dev_path", - .value =3D "off", - }, + { TYPE_S390_IPL, "iplbext_migration", "off", }, + { TYPE_VIRTUAL_CSS_BRIDGE, "css_dev_path", "off", }, }; =20 s390mc->ri_allowed =3D false; @@ -848,43 +829,15 @@ static void ccw_machine_2_4_instance_options(MachineS= tate *machine) static void ccw_machine_2_4_class_options(MachineClass *mc) { static GlobalProperty compat[] =3D { - { - .driver =3D TYPE_S390_SKEYS, - .property =3D "migration-enabled", - .value =3D "off", - },{ - .driver =3D "virtio-blk-ccw", - .property =3D "max_revision", - .value =3D "0", - },{ - .driver =3D "virtio-balloon-ccw", - .property =3D "max_revision", - .value =3D "0", - },{ - .driver =3D "virtio-serial-ccw", - .property =3D "max_revision", - .value =3D "0", - },{ - .driver =3D "virtio-9p-ccw", - .property =3D "max_revision", - .value =3D "0", - },{ - .driver =3D "virtio-rng-ccw", - .property =3D "max_revision", - .value =3D "0", - },{ - .driver =3D "virtio-net-ccw", - .property =3D "max_revision", - .value =3D "0", - },{ - .driver =3D "virtio-scsi-ccw", - .property =3D "max_revision", - .value =3D "0", - },{ - .driver =3D "vhost-scsi-ccw", - .property =3D "max_revision", - .value =3D "0", - }, + { TYPE_S390_SKEYS, "migration-enabled", "off", }, + { "virtio-blk-ccw", "max_revision", "0", }, + { "virtio-balloon-ccw", "max_revision", "0", }, + { "virtio-serial-ccw", "max_revision", "0", }, + { "virtio-9p-ccw", "max_revision", "0", }, + { "virtio-rng-ccw", "max_revision", "0", }, + { "virtio-net-ccw", "max_revision", "0", }, + { "virtio-scsi-ccw", "max_revision", "0", }, + { "vhost-scsi-ccw", "max_revision", "0", }, }; =20 ccw_machine_2_5_class_options(mc); diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c index d51148b6b3..18a9045556 100644 --- a/hw/xen/xen-common.c +++ b/hw/xen/xen-common.c @@ -163,21 +163,9 @@ static void xen_accel_class_init(ObjectClass *oc, void= *data) { AccelClass *ac =3D ACCEL_CLASS(oc); static GlobalProperty compat[] =3D { - { - .driver =3D "migration", - .property =3D "store-global-state", - .value =3D "off", - }, - { - .driver =3D "migration", - .property =3D "send-configuration", - .value =3D "off", - }, - { - .driver =3D "migration", - .property =3D "send-section-footer", - .value =3D "off", - } + { "migration", "store-global-state", "off" }, + { "migration", "send-configuration", "off" }, + { "migration", "send-section-footer", "off" }, }; =20 ac->name =3D "Xen"; --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 18 21:33:45 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547132115628883.5731185614025; Thu, 10 Jan 2019 06:55:15 -0800 (PST) Received: from localhost ([127.0.0.1]:41762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbji-00068I-LH for importer@patchew.org; Thu, 10 Jan 2019 09:55:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbMH-0004Vr-BM for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:31:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghbMA-0006Bb-Eo for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57636) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghbM7-00068N-CN for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:48 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A68967AEAC; Thu, 10 Jan 2019 14:30:44 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F5E560BE7; Thu, 10 Jan 2019 14:30:43 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 12:29:54 -0200 Message-Id: <20190110142955.23254-10-ehabkost@redhat.com> In-Reply-To: <20190110142955.23254-1-ehabkost@redhat.com> References: <20190110142955.23254-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 10 Jan 2019 14:30: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 09/10] qdev: fix -device scsi-hd, help regression 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?Marc-Andr=C3=A9=20Lureau?= 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 Since commit ea9ce8934, device_post_init() applies globals directly from machines and accelerator classes. There are cases, such as -device scsi-hd,help, where the machine is setup but there in no accelerator. Let's skip accelerator globals in this case. Fixes SEGV: #0 0x0000555558ea04ff in object_get_class (obj=3D0x0) at /home/elmarco/sr= c/qemu/build/../qom/object.c:857 #1 0x000055555854c797 in object_apply_compat_props (obj=3D0x616000078980)= at /home/elmarco/src/qemu/build/../hw/core/qdev.c:978 #2 0x000055555854c797 in object_apply_compat_props (obj=3D0x616000078980)= at /home/elmarco/src/qemu/build/../hw/core/qdev.c:973 #3 0x000055555854c959 in device_post_init (obj=3D0x616000078980) at /home= /elmarco/src/qemu/build/../hw/core/qdev.c:989 #4 0x0000555558e9e250 in object_post_init_with_type (ti=3D= , obj=3D0x616000078980) at /home/elmarco/src/qemu/build/../qom/object.c:365 #5 0x0000555558e9e250 in object_initialize_with_type (data=3D0x6160000789= 80, size=3D616, type=3D) at /home/elmarco/src/qemu/build/../= qom/object.c:425 #6 0x0000555558e9e571 in object_new_with_type (type=3D0x613000031900) at = /home/elmarco/src/qemu/build/../qom/object.c:588 #7 0x000055555830c048 in qmp_device_list_properties (typename=3Dtypename@= entry=3D0x60200000c2d0 "scsi-hd", errp=3Derrp@entry=3D0x7fffffffc540) at /h= ome/elmarco/src/qemu/qmp.c:519 #8 0x00005555582c4027 in qdev_device_help (opts=3D) at /ho= me/elmarco/src/qemu/qdev-monitor.c:283 #9 0x0000555559378fa2 in qemu_opts_foreach (list=3D, func= =3Dfunc@entry=3D0x5555582cfca0 , opaque=3Dopaque@entry=3D= 0x0, errp=3Derrp@entry=3D0x0) at /home/elmarco/src/qemu/util/qemu-option.c:= 1171 https://bugzilla.redhat.com/show_bug.cgi?id=3D1664364 Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190109102311.7635-1-marcandre.lureau@redhat.com> Reviewed-by: Cornelia Huck Reviewed-by: Luk=C3=A1=C5=A1 Doktor Reviewed-by: Igor Mammedov Signed-off-by: Eduardo Habkost --- hw/core/qdev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 3769a2bccb..47bddacb4f 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -975,10 +975,13 @@ void object_apply_compat_props(Object *obj) if (object_dynamic_cast(qdev_get_machine(), TYPE_MACHINE)) { MachineState *m =3D MACHINE(qdev_get_machine()); MachineClass *mc =3D MACHINE_GET_CLASS(m); - AccelClass *ac =3D ACCEL_GET_CLASS(m->accelerator); =20 - if (ac->compat_props) { - object_apply_global_props(obj, ac->compat_props, &error_abort); + if (m->accelerator) { + AccelClass *ac =3D ACCEL_GET_CLASS(m->accelerator); + + if (ac->compat_props) { + object_apply_global_props(obj, ac->compat_props, &error_ab= ort); + } } object_apply_global_props(obj, mc->compat_props, &error_abort); } --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 18 21:33:45 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547131898569528.3790798046207; Thu, 10 Jan 2019 06:51:38 -0800 (PST) Received: from localhost ([127.0.0.1]:40749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbgH-0003If-76 for importer@patchew.org; Thu, 10 Jan 2019 09:51:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbMH-0004Vo-9N for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghbMD-0006DE-Hd for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55638) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghbMA-0006AF-E7 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 09:30:52 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B68EE42BD3; Thu, 10 Jan 2019 14:30:47 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B29B60BE7; Thu, 10 Jan 2019 14:30:46 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 12:29:55 -0200 Message-Id: <20190110142955.23254-11-ehabkost@redhat.com> In-Reply-To: <20190110142955.23254-1-ehabkost@redhat.com> References: <20190110142955.23254-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 10 Jan 2019 14:30:48 +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/10] qom: Don't keep error value between object_property_parse() calls 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-Type: text/plain; charset="utf-8" When handling errp=3D=3DNULL at object_apply_global_props(), we are leaving the old error value in `err` after printing a warning. This makes QEMU crash if two global properties generate warnings: $ echo device_add rtl8139 | qemu-system-x86_64 -monitor stdio -global rtl= 8139.xxx=3Dyyy -global rtl8139.xxx=3Dzzz warning: can't apply global rtl8139.xxx=3Dyyy: Property '.xxx' not found qemu-system-x86_64: util/error.c:57: error_setv: Assertion `*errp =3D=3D = NULL' failed. Aborted (core dumped) Fix that by making `err` go out of scope immediately after the warn_report_err() call. Fixes: 50545b2cc029 "qdev-props: call object_apply_global_props()" Signed-off-by: Eduardo Habkost Message-Id: <20190110020259.8492-2-ehabkost@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Cornelia Huck Signed-off-by: Eduardo Habkost --- qom/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qom/object.c b/qom/object.c index aa6f3a2a71..4e5226ca12 100644 --- a/qom/object.c +++ b/qom/object.c @@ -372,7 +372,6 @@ static void object_post_init_with_type(Object *obj, Typ= eImpl *ti) =20 void object_apply_global_props(Object *obj, const GPtrArray *props, Error = **errp) { - Error *err =3D NULL; int i; =20 if (!props) { @@ -381,6 +380,7 @@ void object_apply_global_props(Object *obj, const GPtrA= rray *props, Error **errp =20 for (i =3D 0; i < props->len; i++) { GlobalProperty *p =3D g_ptr_array_index(props, i); + Error *err =3D NULL; =20 if (object_dynamic_cast(obj, p->driver) =3D=3D NULL) { continue; --=20 2.18.0.rc1.1.g3f1ff2140