From nobody Fri May 10 18:42:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709999980857904.0865693556883; Sat, 9 Mar 2024 07:59:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riz50-00079S-Jt; Sat, 09 Mar 2024 10:57:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz4y-000793-8D; Sat, 09 Mar 2024 10:57:44 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz4w-0004Fq-D7; Sat, 09 Mar 2024 10:57:44 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 148EC54526; Sat, 9 Mar 2024 18:58:28 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 7613B944BB; Sat, 9 Mar 2024 18:57:31 +0300 (MSK) Received: (nullmailer pid 1694647 invoked by uid 1000); Sat, 09 Mar 2024 15:57:29 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 01/11] replay: Improve error messages about configuration conflicts Date: Sat, 9 Mar 2024 18:57:19 +0300 Message-Id: <20240309155729.1694607-2-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240309155729.1694607-1-mjt@tls.msk.ru> References: <20240309155729.1694607-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1709999982990100003 From: Markus Armbruster Improve Record/replay feature is not supported for '-rtc base=3Dlocaltime' Record/replay feature is not supported for 'smp' Record/replay feature is not supported for '-snapshot' to Record/replay is not supported with -rtc base=3Dlocaltime Record/replay is not supported with multiple CPUs Record/replay is not supported with -snapshot Signed-off-by: Markus Armbruster Reviewed-by: Pavel Dovgalyuk Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- replay/replay.c | 2 +- system/vl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/replay/replay.c b/replay/replay.c index 3fd241a4fc..a2c576c16e 100644 --- a/replay/replay.c +++ b/replay/replay.c @@ -511,7 +511,7 @@ void replay_add_blocker(const char *feature) { Error *reason =3D NULL; =20 - error_setg(&reason, "Record/replay feature is not supported for '%s'", + error_setg(&reason, "Record/replay is not supported with %s", feature); replay_blockers =3D g_slist_prepend(replay_blockers, reason); } diff --git a/system/vl.c b/system/vl.c index 48aae6e053..70f4cece7f 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1932,7 +1932,7 @@ static void qemu_apply_machine_options(QDict *qdict) } =20 if (current_machine->smp.cpus > 1) { - replay_add_blocker("smp"); + replay_add_blocker("multiple CPUs"); } } =20 --=20 2.39.2 From nobody Fri May 10 18:42:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710000012172984.121417369878; Sat, 9 Mar 2024 08:00:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riz53-0007BM-A2; Sat, 09 Mar 2024 10:57:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz51-00079o-8R; Sat, 09 Mar 2024 10:57:47 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz4z-0004Gr-JD; Sat, 09 Mar 2024 10:57:47 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 82D2A54527; Sat, 9 Mar 2024 18:58:29 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id CD6A8944BC; Sat, 9 Mar 2024 18:57:32 +0300 (MSK) Received: (nullmailer pid 1694650 invoked by uid 1000); Sat, 09 Mar 2024 15:57:29 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Frediano Ziglio , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 02/11] hw/vfio/pci.c: Make some structure static Date: Sat, 9 Mar 2024 18:57:20 +0300 Message-Id: <20240309155729.1694607-3-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240309155729.1694607-1-mjt@tls.msk.ru> References: <20240309155729.1694607-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1710000013189100013 From: Frediano Ziglio Not used outside C module. Signed-off-by: Frediano Ziglio Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by Tokarev Signed-off-by: Michael Tokarev Reviewed-by Tokarev --- hw/vfio/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 4fa387f043..a1522a011a 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -2558,7 +2558,7 @@ static bool vfio_display_migration_needed(void *opaqu= e) (vdev->ramfb_migrate =3D=3D ON_OFF_AUTO_AUTO && vdev->enable_ramfb= ); } =20 -const VMStateDescription vmstate_vfio_display =3D { +static const VMStateDescription vmstate_vfio_display =3D { .name =3D "VFIOPCIDevice/VFIODisplay", .version_id =3D 1, .minimum_version_id =3D 1, @@ -2570,7 +2570,7 @@ const VMStateDescription vmstate_vfio_display =3D { } }; =20 -const VMStateDescription vmstate_vfio_pci_config =3D { +static const VMStateDescription vmstate_vfio_pci_config =3D { .name =3D "VFIOPCIDevice", .version_id =3D 1, .minimum_version_id =3D 1, --=20 2.39.2 From nobody Fri May 10 18:42:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709999953216928.2846360731819; Sat, 9 Mar 2024 07:59:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riz56-0007IS-Ri; Sat, 09 Mar 2024 10:57:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz52-0007Av-QL; Sat, 09 Mar 2024 10:57:48 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz51-0004Gz-4c; Sat, 09 Mar 2024 10:57:48 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id EC8B454528; Sat, 9 Mar 2024 18:58:30 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 505A8944BD; Sat, 9 Mar 2024 18:57:34 +0300 (MSK) Received: (nullmailer pid 1694653 invoked by uid 1000); Sat, 09 Mar 2024 15:57:29 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: BALATON Zoltan , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 03/11] hw/scsi/lsi53c895a: Fix typo in comment Date: Sat, 9 Mar 2024 18:57:21 +0300 Message-Id: <20240309155729.1694607-4-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240309155729.1694607-1-mjt@tls.msk.ru> References: <20240309155729.1694607-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1709999955047100003 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Signed-off-by: BALATON Zoltan Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- hw/scsi/lsi53c895a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index d607a5f9fb..f8598a17f5 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -225,7 +225,7 @@ struct LSIState { MemoryRegion io_io; AddressSpace pci_io_as; =20 - int carry; /* ??? Should this be an a visible register somewhere? */ + int carry; /* ??? Should this be in a visible register somewhere? */ int status; int msg_action; int msg_len; --=20 2.39.2 From nobody Fri May 10 18:42:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710000009087633.4219467446779; Sat, 9 Mar 2024 08:00:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riz58-0007Jn-Op; Sat, 09 Mar 2024 10:57:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz54-0007EF-A4; Sat, 09 Mar 2024 10:57:50 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz52-0004HG-LW; Sat, 09 Mar 2024 10:57:50 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B66E554529; Sat, 9 Mar 2024 18:58:31 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 7E480944BE; Sat, 9 Mar 2024 18:57:35 +0300 (MSK) Received: (nullmailer pid 1694656 invoked by uid 1000); Sat, 09 Mar 2024 15:57:29 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Michael Tokarev , qemu-trivial@nongnu.org Subject: [PULL 04/11] make-release: switch to .xz format by default Date: Sat, 9 Mar 2024 18:57:22 +0300 Message-Id: <20240309155729.1694607-5-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240309155729.1694607-1-mjt@tls.msk.ru> References: <20240309155729.1694607-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1710000011210100011 For a long time, we provide two compression formats in the download area, .bz2 and .xz. There's absolutely no reason to provide two in parallel, .xz compresses better, and all the links we use points to .xz. Downstream distributions mostly use .xz too. For the release maintenance providing two formats is definitely extra burden too. Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi --- scripts/make-release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/make-release b/scripts/make-release index 9c570b87f4..6e0433de24 100755 --- a/scripts/make-release +++ b/scripts/make-release @@ -47,5 +47,5 @@ meson subprojects download $SUBPROJECTS CryptoPkg/Library/OpensslLib/openssl \ MdeModulePkg/Library/BrotliCustomDecompressLib/brotli) popd -tar --exclude=3D.git -cjf ${destination}.tar.bz2 ${destination} +tar --exclude=3D.git -cJf ${destination}.tar.xz ${destination} rm -rf ${destination} --=20 2.39.2 From nobody Fri May 10 18:42:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709999959858341.5926338948924; Sat, 9 Mar 2024 07:59:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riz5G-0007Mr-FT; Sat, 09 Mar 2024 10:58:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz55-0007H0-TY; Sat, 09 Mar 2024 10:57:51 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz54-0004HT-6c; Sat, 09 Mar 2024 10:57:51 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D52065452A; Sat, 9 Mar 2024 18:58:32 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 565A9944BF; Sat, 9 Mar 2024 18:57:36 +0300 (MSK) Received: (nullmailer pid 1694659 invoked by uid 1000); Sat, 09 Mar 2024 15:57:29 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 05/11] char: Slightly better error reporting when chardev is in use Date: Sat, 9 Mar 2024 18:57:23 +0300 Message-Id: <20240309155729.1694607-6-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240309155729.1694607-1-mjt@tls.msk.ru> References: <20240309155729.1694607-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1709999960880100001 From: Markus Armbruster Both $ qemu-system-x86_64 -chardev null,id=3Dchr0,mux=3Don -mon chardev=3Dch= r0 -mon chardev=3Dchr0 -mon chardev=3Dchr0 -mon chardev=3Dchr0 -mon chardev= =3Dchr0 and $ qemu-system-x86_64 -chardev null,id=3Dchr0 -mon chardev=3Dchr0 -mon c= hardev=3Dchr0 fail with qemu-system-x86_64: -mon chardev=3Dchr0: Device 'chr0' is in use Improve to qemu-system-x86_64: -mon chardev=3Dchr0: too many uses of multiplexed c= hardev 'chr0' (maximum is 4) and qemu-system-x86_64: -mon chardev=3Dchr0: chardev 'chr0' is already in u= se Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- chardev/char-fe.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/chardev/char-fe.c b/chardev/char-fe.c index 20222a4cad..66cee8475a 100644 --- a/chardev/char-fe.c +++ b/chardev/char-fe.c @@ -199,13 +199,18 @@ bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Err= or **errp) MuxChardev *d =3D MUX_CHARDEV(s); =20 if (d->mux_cnt >=3D MAX_MUX) { - goto unavailable; + error_setg(errp, + "too many uses of multiplexed chardev '%s'" + " (maximum is " stringify(MAX_MUX) ")", + s->label); + return false; } =20 d->backends[d->mux_cnt] =3D b; tag =3D d->mux_cnt++; } else if (s->be) { - goto unavailable; + error_setg(errp, "chardev '%s' is already in use", s->label); + return false; } else { s->be =3D b; } @@ -215,10 +220,6 @@ bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Erro= r **errp) b->tag =3D tag; b->chr =3D s; return true; - -unavailable: - error_setg(errp, QERR_DEVICE_IN_USE, s->label); - return false; } =20 void qemu_chr_fe_deinit(CharBackend *b, bool del) --=20 2.39.2 From nobody Fri May 10 18:42:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170999994594141.44165140021619; Sat, 9 Mar 2024 07:59:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riz58-0007Jm-Pa; Sat, 09 Mar 2024 10:57:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz57-0007JF-JK; Sat, 09 Mar 2024 10:57:53 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz55-0004Hh-QN; Sat, 09 Mar 2024 10:57:53 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 286935452B; Sat, 9 Mar 2024 18:58:34 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 637A0944C0; Sat, 9 Mar 2024 18:57:37 +0300 (MSK) Received: (nullmailer pid 1694662 invoked by uid 1000); Sat, 09 Mar 2024 15:57:29 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 06/11] blockdev: Fix block_resize error reporting for op blockers Date: Sat, 9 Mar 2024 18:57:24 +0300 Message-Id: <20240309155729.1694607-7-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240309155729.1694607-1-mjt@tls.msk.ru> References: <20240309155729.1694607-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1709999948202100011 From: Markus Armbruster When block_resize() runs into an op blocker, it creates an error like this: error_setg(errp, "Device '%s' is in use", device); Trouble is @device can be null. My system formats null as "(null)", but other systems might crash. Reproducer: 1. Create two block devices -> {"execute": "blockdev-add", "arguments": {"driver": "file", "node-na= me": "blk0", "filename": "64k.img"}} <- {"return": {}} -> {"execute": "blockdev-add", "arguments": {"driver": "file", "node-na= me": "blk1", "filename": "m.img"}} <- {"return": {}} 2. Put a blocker on one them -> {"execute": "blockdev-mirror", "arguments": {"job-id": "job0", "devi= ce": "blk0", "target": "blk1", "sync": "full"}} {"return": {}} -> {"execute": "job-pause", "arguments": {"id": "job0"}} {"return": {}} -> {"execute": "job-complete", "arguments": {"id": "job0"}} {"return": {}} Note: job events elided for brevity. 3. Attempt to resize -> {"execute": "block_resize", "arguments": {"node-name": "blk1", "size= ":32768}} <- {"error": {"class": "GenericError", "desc": "Device '(null)' is in u= se"}} Broken when commit 3b1dbd11a60 made @device optional. Fixed in commit ed3d2ec98a3 (block: Add errp to b{lk,drv}_truncate()), except for this one instance. Fix it by using the error message provided by the op blocker instead, so it fails like this: <- {"error": {"class": "GenericError", "desc": "Node 'blk1' is busy: bl= ock device is in use by block job: mirror"}} Fixes: 3b1dbd11a60d (qmp: Allow block_resize to manipulate bs graph nodes.) Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- blockdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index f8bb0932f8..d8fb3399f5 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2252,8 +2252,7 @@ void coroutine_fn qmp_block_resize(const char *device= , const char *node_name, } =20 bdrv_graph_co_rdlock(); - if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_RESIZE, NULL)) { - error_setg(errp, QERR_DEVICE_IN_USE, device); + if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_RESIZE, errp)) { bdrv_graph_co_rdunlock(); return; } --=20 2.39.2 From nobody Fri May 10 18:42:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709999946070125.33900998079059; Sat, 9 Mar 2024 07:59:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riz5F-0007Li-Hr; Sat, 09 Mar 2024 10:58:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz58-0007K3-Vc; Sat, 09 Mar 2024 10:57:54 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz57-0004Hu-9c; Sat, 09 Mar 2024 10:57:54 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id AAE5D5452C; Sat, 9 Mar 2024 18:58:35 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id EB234944C1; Sat, 9 Mar 2024 18:57:38 +0300 (MSK) Received: (nullmailer pid 1694665 invoked by uid 1000); Sat, 09 Mar 2024 15:57:29 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 07/11] qerror: QERR_DEVICE_IN_USE is no longer used, drop Date: Sat, 9 Mar 2024 18:57:25 +0300 Message-Id: <20240309155729.1694607-8-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240309155729.1694607-1-mjt@tls.msk.ru> References: <20240309155729.1694607-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1709999948080100009 From: Markus Armbruster Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- include/qapi/qmp/qerror.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 8dd9fcb071..0c2689cf8a 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -23,9 +23,6 @@ #define QERR_DEVICE_HAS_NO_MEDIUM \ "Device '%s' has no medium" =20 -#define QERR_DEVICE_IN_USE \ - "Device '%s' is in use" - #define QERR_DEVICE_NO_HOTPLUG \ "Device '%s' does not support hotplugging" =20 --=20 2.39.2 From nobody Fri May 10 18:42:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709999973833715.6338730628062; Sat, 9 Mar 2024 07:59:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riz5G-0007Mp-Du; Sat, 09 Mar 2024 10:58:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz5B-0007LT-Qy; Sat, 09 Mar 2024 10:57:57 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz59-0004IL-3p; Sat, 09 Mar 2024 10:57:56 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 53DB35452D; Sat, 9 Mar 2024 18:58:37 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 8A922944C2; Sat, 9 Mar 2024 18:57:40 +0300 (MSK) Received: (nullmailer pid 1694668 invoked by uid 1000); Sat, 09 Mar 2024 15:57:29 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Thomas Huth , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 08/11] hw/cxl/cxl-cdat: Fix type of buf in ct3_load_cdat() Date: Sat, 9 Mar 2024 18:57:26 +0300 Message-Id: <20240309155729.1694607-9-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240309155729.1694607-1-mjt@tls.msk.ru> References: <20240309155729.1694607-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1709999974965100001 Content-Type: text/plain; charset="utf-8" From: Thomas Huth When setting GLIB_VERSION_MAX_ALLOWED to GLIB_VERSION_2_58 or higher (which we'll certainly do in the not too distant future), glib adds type safety checks to the g_steal_pointer() macro. This trigger an error in the ct3_load_cdat() function: The local char *buf variable is assigned to uint8_t *buf in CDATObject, i.e. a pointer of a different type. Change the local variable to the same type as buf in CDATObject to avoid the error. Signed-off-by: Thomas Huth Reviewed-by: Jonathan Cameron Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- hw/cxl/cxl-cdat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/cxl/cxl-cdat.c b/hw/cxl/cxl-cdat.c index 2fea975671..551545f782 100644 --- a/hw/cxl/cxl-cdat.c +++ b/hw/cxl/cxl-cdat.c @@ -114,7 +114,7 @@ static void ct3_build_cdat(CDATObject *cdat, Error **er= rp) static void ct3_load_cdat(CDATObject *cdat, Error **errp) { g_autofree CDATEntry *cdat_st =3D NULL; - g_autofree char *buf =3D NULL; + g_autofree uint8_t *buf =3D NULL; uint8_t sum =3D 0; int num_ent; int i =3D 0, ent =3D 1; @@ -171,7 +171,7 @@ static void ct3_load_cdat(CDATObject *cdat, Error **err= p) cdat_st[ent].base =3D hdr; cdat_st[ent].length =3D hdr->length; =20 - while (buf + i < (char *)cdat_st[ent].base + cdat_st[ent].length) { + while (buf + i < (uint8_t *)cdat_st[ent].base + cdat_st[ent].lengt= h) { assert(i < file_size); sum +=3D buf[i++]; } --=20 2.39.2 From nobody Fri May 10 18:42:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710000008148907.3905995208887; Sat, 9 Mar 2024 08:00:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riz5O-0007RS-Kn; Sat, 09 Mar 2024 10:58:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz5E-0007Lq-MV; Sat, 09 Mar 2024 10:58:01 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz5C-0004Iu-JR; Sat, 09 Mar 2024 10:58:00 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8682F54531; Sat, 9 Mar 2024 18:58:38 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 08292944C3; Sat, 9 Mar 2024 18:57:41 +0300 (MSK) Received: (nullmailer pid 1694671 invoked by uid 1000); Sat, 09 Mar 2024 15:57:29 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Thomas Huth , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 09/11] hw/pci-bridge/cxl_upstream: Fix problem with g_steal_pointer() Date: Sat, 9 Mar 2024 18:57:27 +0300 Message-Id: <20240309155729.1694607-10-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240309155729.1694607-1-mjt@tls.msk.ru> References: <20240309155729.1694607-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1710000009193100005 Content-Type: text/plain; charset="utf-8" From: Thomas Huth When setting GLIB_VERSION_MAX_ALLOWED to GLIB_VERSION_2_58 or higher, glib adds type safety checks to the g_steal_pointer() macro. This triggers errors in the build_cdat_table() function which uses the g_steal_pointer() for type-casting from one pointer type to the other (which also looks quite weird since the local pointers have all been declared with g_autofree though they are never freed here). Let's fix it by using a proper typecast instead. For making this possible, we have to remove the QEMU_PACKED attribute from some structs since GCC otherwise complains that the source and destination pointer might have different alignment restrictions. Removing the QEMU_PACKED should be fine here since the structs are already naturally aligned. Anyway, add some QEMU_BUILD_BUG_ON() statements to make sure that we've got the right sizes (without padding in the structs). Signed-off-by: Thomas Huth Reviewed-by: Jonathan Cameron Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- hw/pci-bridge/cxl_upstream.c | 8 ++++---- include/hw/cxl/cxl_cdat.h | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/pci-bridge/cxl_upstream.c b/hw/pci-bridge/cxl_upstream.c index e87eb40177..537f9affb8 100644 --- a/hw/pci-bridge/cxl_upstream.c +++ b/hw/pci-bridge/cxl_upstream.c @@ -192,8 +192,8 @@ enum { =20 static int build_cdat_table(CDATSubHeader ***cdat_table, void *priv) { - g_autofree CDATSslbis *sslbis_latency =3D NULL; - g_autofree CDATSslbis *sslbis_bandwidth =3D NULL; + CDATSslbis *sslbis_latency; + CDATSslbis *sslbis_bandwidth; CXLUpstreamPort *us =3D CXL_USP(priv); PCIBus *bus =3D &PCI_BRIDGE(us)->sec_bus; int devfn, sslbis_size, i; @@ -270,8 +270,8 @@ static int build_cdat_table(CDATSubHeader ***cdat_table= , void *priv) *cdat_table =3D g_new0(CDATSubHeader *, CXL_USP_CDAT_NUM_ENTRIES); =20 /* Header always at start of structure */ - (*cdat_table)[CXL_USP_CDAT_SSLBIS_LAT] =3D g_steal_pointer(&sslbis_lat= ency); - (*cdat_table)[CXL_USP_CDAT_SSLBIS_BW] =3D g_steal_pointer(&sslbis_band= width); + (*cdat_table)[CXL_USP_CDAT_SSLBIS_LAT] =3D (CDATSubHeader *)sslbis_lat= ency; + (*cdat_table)[CXL_USP_CDAT_SSLBIS_BW] =3D (CDATSubHeader *)sslbis_band= width; =20 return CXL_USP_CDAT_NUM_ENTRIES; } diff --git a/include/hw/cxl/cxl_cdat.h b/include/hw/cxl/cxl_cdat.h index 8e3d094608..b44cefaad6 100644 --- a/include/hw/cxl/cxl_cdat.h +++ b/include/hw/cxl/cxl_cdat.h @@ -130,7 +130,8 @@ typedef struct CDATSslbisHeader { uint8_t data_type; uint8_t reserved[3]; uint64_t entry_base_unit; -} QEMU_PACKED CDATSslbisHeader; +} CDATSslbisHeader; +QEMU_BUILD_BUG_ON(sizeof(CDATSslbisHeader) !=3D 16); =20 #define CDAT_PORT_ID_USP 0x100 /* Switch Scoped Latency and Bandwidth Entry - CDAT Table 10 */ @@ -139,12 +140,13 @@ typedef struct CDATSslbe { uint16_t port_y_id; uint16_t latency_bandwidth; uint16_t reserved; -} QEMU_PACKED CDATSslbe; +} CDATSslbe; +QEMU_BUILD_BUG_ON(sizeof(CDATSslbe) !=3D 8); =20 typedef struct CDATSslbis { CDATSslbisHeader sslbis_header; CDATSslbe sslbe[]; -} QEMU_PACKED CDATSslbis; +} CDATSslbis; =20 typedef struct CDATEntry { void *base; --=20 2.39.2 From nobody Fri May 10 18:42:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710000040656924.7041683753833; Sat, 9 Mar 2024 08:00:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riz5M-0007Q8-9D; Sat, 09 Mar 2024 10:58:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz5G-0007NC-Gb; Sat, 09 Mar 2024 10:58:03 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz5D-0004JJ-6A; Sat, 09 Mar 2024 10:58:01 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 5577654532; Sat, 9 Mar 2024 18:58:39 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id ECE42944C4; Sat, 9 Mar 2024 18:57:42 +0300 (MSK) Received: (nullmailer pid 1694674 invoked by uid 1000); Sat, 09 Mar 2024 15:57:29 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Thomas Huth , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 10/11] hw/mem/cxl_type3: Fix problem with g_steal_pointer() Date: Sat, 9 Mar 2024 18:57:28 +0300 Message-Id: <20240309155729.1694607-11-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240309155729.1694607-1-mjt@tls.msk.ru> References: <20240309155729.1694607-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1710000041324100001 Content-Type: text/plain; charset="utf-8" From: Thomas Huth When setting GLIB_VERSION_MAX_ALLOWED to GLIB_VERSION_2_58 or higher, glib adds type safety checks to the g_steal_pointer() macro. This triggers errors in the ct3_build_cdat_entries_for_mr() function which uses the g_steal_pointer() for type-casting from one pointer type to the other (which also looks quite weird since the local pointers have all been declared with g_autofree though they are never freed here). Fix it by using a proper typecast instead. For making this possible, we have to remove the QEMU_PACKED attribute from some structs since GCC otherwise complains that the source and destination pointer might have different alignment restrictions. Removing the QEMU_PACKED should be fine here since the structs are already naturally aligned. Anyway, add some QEMU_BUILD_BUG_ON() statements to make sure that we've got the right sizes (without padding in the structs). Signed-off-by: Thomas Huth Reviewed-by: Jonathan Cameron Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- hw/mem/cxl_type3.c | 24 ++++++++++++------------ include/hw/cxl/cxl_cdat.h | 9 ++++++--- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index e8801805b9..b679dfae1c 100644 --- a/hw/mem/cxl_type3.c +++ b/hw/mem/cxl_type3.c @@ -46,12 +46,12 @@ static void ct3_build_cdat_entries_for_mr(CDATSubHeader= **cdat_table, int dsmad_handle, MemoryRegion *= mr, bool is_pmem, uint64_t dpa_base) { - g_autofree CDATDsmas *dsmas =3D NULL; - g_autofree CDATDslbis *dslbis0 =3D NULL; - g_autofree CDATDslbis *dslbis1 =3D NULL; - g_autofree CDATDslbis *dslbis2 =3D NULL; - g_autofree CDATDslbis *dslbis3 =3D NULL; - g_autofree CDATDsemts *dsemts =3D NULL; + CDATDsmas *dsmas; + CDATDslbis *dslbis0; + CDATDslbis *dslbis1; + CDATDslbis *dslbis2; + CDATDslbis *dslbis3; + CDATDsemts *dsemts; =20 dsmas =3D g_malloc(sizeof(*dsmas)); *dsmas =3D (CDATDsmas) { @@ -135,12 +135,12 @@ static void ct3_build_cdat_entries_for_mr(CDATSubHead= er **cdat_table, }; =20 /* Header always at start of structure */ - cdat_table[CT3_CDAT_DSMAS] =3D g_steal_pointer(&dsmas); - cdat_table[CT3_CDAT_DSLBIS0] =3D g_steal_pointer(&dslbis0); - cdat_table[CT3_CDAT_DSLBIS1] =3D g_steal_pointer(&dslbis1); - cdat_table[CT3_CDAT_DSLBIS2] =3D g_steal_pointer(&dslbis2); - cdat_table[CT3_CDAT_DSLBIS3] =3D g_steal_pointer(&dslbis3); - cdat_table[CT3_CDAT_DSEMTS] =3D g_steal_pointer(&dsemts); + cdat_table[CT3_CDAT_DSMAS] =3D (CDATSubHeader *)dsmas; + cdat_table[CT3_CDAT_DSLBIS0] =3D (CDATSubHeader *)dslbis0; + cdat_table[CT3_CDAT_DSLBIS1] =3D (CDATSubHeader *)dslbis1; + cdat_table[CT3_CDAT_DSLBIS2] =3D (CDATSubHeader *)dslbis2; + cdat_table[CT3_CDAT_DSLBIS3] =3D (CDATSubHeader *)dslbis3; + cdat_table[CT3_CDAT_DSEMTS] =3D (CDATSubHeader *)dsemts; } =20 static int ct3_build_cdat_table(CDATSubHeader ***cdat_table, void *priv) diff --git a/include/hw/cxl/cxl_cdat.h b/include/hw/cxl/cxl_cdat.h index b44cefaad6..17a09066dc 100644 --- a/include/hw/cxl/cxl_cdat.h +++ b/include/hw/cxl/cxl_cdat.h @@ -82,7 +82,8 @@ typedef struct CDATDsmas { uint16_t reserved; uint64_t DPA_base; uint64_t DPA_length; -} QEMU_PACKED CDATDsmas; +} CDATDsmas; +QEMU_BUILD_BUG_ON(sizeof(CDATDsmas) !=3D 24); =20 /* Device Scoped Latency and Bandwidth Information Structure - CDAT Table = 5 */ typedef struct CDATDslbis { @@ -95,7 +96,8 @@ typedef struct CDATDslbis { uint64_t entry_base_unit; uint16_t entry[3]; uint16_t reserved2; -} QEMU_PACKED CDATDslbis; +} CDATDslbis; +QEMU_BUILD_BUG_ON(sizeof(CDATDslbis) !=3D 24); =20 /* Device Scoped Memory Side Cache Information Structure - CDAT Table 6 */ typedef struct CDATDsmscis { @@ -122,7 +124,8 @@ typedef struct CDATDsemts { uint16_t reserved; uint64_t DPA_offset; uint64_t DPA_length; -} QEMU_PACKED CDATDsemts; +} CDATDsemts; +QEMU_BUILD_BUG_ON(sizeof(CDATDsemts) !=3D 24); =20 /* Switch Scoped Latency and Bandwidth Information Structure - CDAT Table = 9 */ typedef struct CDATSslbisHeader { --=20 2.39.2 From nobody Fri May 10 18:42:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710000005185370.75106243267555; Sat, 9 Mar 2024 08:00:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riz5O-0007RT-R8; Sat, 09 Mar 2024 10:58:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz5J-0007PX-CF; Sat, 09 Mar 2024 10:58:06 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riz5H-0004Jt-3O; Sat, 09 Mar 2024 10:58:05 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2C4A654533; Sat, 9 Mar 2024 18:58:40 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id AFE37944C5; Sat, 9 Mar 2024 18:57:43 +0300 (MSK) Received: (nullmailer pid 1694677 invoked by uid 1000); Sat, 09 Mar 2024 15:57:29 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Ani Sinha , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 11/11] docs/acpi/bits: add some clarity and details while also improving formating Date: Sat, 9 Mar 2024 18:57:29 +0300 Message-Id: <20240309155729.1694607-12-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240309155729.1694607-1-mjt@tls.msk.ru> References: <20240309155729.1694607-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1710000007537100003 Content-Type: text/plain; charset="utf-8" From: Ani Sinha Update bios-bits docs to add more details on why a pre-OS environment for testing bioses is useful. Add author's FOSDEM talk link. Also improve the formating of the document while at it. Signed-off-by: Ani Sinha Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- docs/devel/acpi-bits.rst | 55 ++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/docs/devel/acpi-bits.rst b/docs/devel/acpi-bits.rst index 9677b0098f..1ec394f5fb 100644 --- a/docs/devel/acpi-bits.rst +++ b/docs/devel/acpi-bits.rst @@ -1,26 +1,48 @@ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D ACPI/SMBIOS avocado tests using biosbits =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D - +************ +Introduction +************ Biosbits is a software written by Josh Triplett that can be downloaded from https://biosbits.org/. The github codebase can be found -`here `__. It is a software = that executes -the bios components such as acpi and smbios tables directly through acpica -bios interpreter (a freely available C based library written by Intel, +`here `__. It is a software = that +executes the bios components such as acpi and smbios tables directly throu= gh +acpica bios interpreter (a freely available C based library written by Int= el, downloadable from https://acpica.org/ and is included with biosbits) witho= ut an -operating system getting involved in between. +operating system getting involved in between. Bios-bits has python integra= tion +with grub so actual routines that executes bios components can be written = in +python instead of bash-ish (grub's native scripting language). There are several advantages to directly testing the bios in a real physic= al -machine or VM as opposed to indirectly discovering bios issues through the -operating system. For one thing, the OSes tend to hide bios problems from = the -end user. The other is that we have more control of what we wanted to test -and how by directly using acpica interpreter on top of the bios on a runni= ng -system. More details on the inspiration for developing biosbits and its re= al -life uses can be found in [#a]_ and [#b]_. +machine or in a VM as opposed to indirectly discovering bios issues throug= h the +operating system (the OS). Operating systems tend to bypass bios problems = and +hide them from the end user. We have more control of what we wanted to tes= t and +how by being as close to the bios on a running system as possible without a +complicated software component such as an operating system coming in betwe= en. +Another issue is that we cannot exercise bios components such as ACPI and +SMBIOS without being in the highest hardware privilege level, ring 0 for +example in case of x86. Since the OS executes from ring 0 whereas normal u= ser +land software resides in unprivileged ring 3, operating system must be mod= ified +in order to write our test routines that exercise and test the bios. This = is +not possible in all cases. Lastly, test frameworks and routines are prefer= ably +written using a high level scripting language such as python. OSes and +OS modules are generally written using low level languages such as C and +low level assembly machine language. Writing test routines in a low level +language makes things more cumbersome. These and other reasons makes using +bios-bits very attractive for testing bioses. More details on the inspirat= ion +for developing biosbits and its real life uses can be found in [#a]_ and [= #b]_. + For QEMU, we maintain a fork of bios bits in gitlab along with all the -dependent submodules here: https://gitlab.com/qemu-project/biosbits-bits +dependent submodules `here = `__. This fork contains numerous fixes, a newer acpica and changes specific to running this avocado QEMU tests using bits. The author of this document -is the sole maintainer of the QEMU fork of bios bits repo. +is the sole maintainer of the QEMU fork of bios bits repository. For more +information, please see author's `FOSDEM talk on this bios-bits based test +framework `__. + +********************************* +Description of the test framework +********************************* =20 Under the directory ``tests/avocado/``, ``acpi-bits.py`` is a QEMU avocado test that drives all this. @@ -120,8 +142,9 @@ Under ``tests/avocado/`` as the root we have: (b) Add a SPDX license header. (c) Perform modifications to the test. =20 - Commits (a), (b) and (c) should go under separate commits so that the o= riginal - test script and the changes we have made are separated and clear. + Commits (a), (b) and (c) preferably should go under separate commits so= that + the original test script and the changes we have made are separated and + clear. (a) and (b) can sometimes be combined into a single step. =20 The test framework will then use your modified test script to run the t= est. No further changes would be needed. Please check the logs to make sure = that @@ -141,4 +164,4 @@ References: ----------- .. [#a] https://blog.linuxplumbersconf.org/2011/ocw/system/presentations/8= 67/original/bits.pdf .. [#b] https://www.youtube.com/watch?v=3D36QIepyUuhg - +.. [#c] https://fosdem.org/2024/schedule/event/fosdem-2024-2262-exercising= -qemu-generated-acpi-smbios-tables-using-biosbits-from-within-a-guest-vm-/ --=20 2.39.2