From nobody Tue Nov 26 22:17:41 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 1703491893752291.8504478572827; Mon, 25 Dec 2023 00:11:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHg2b-0007iM-Ep; Mon, 25 Dec 2023 03:10:25 -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 1rHg2R-0007he-IC; Mon, 25 Dec 2023 03:10:15 -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 1rHg2O-0008J2-KM; Mon, 25 Dec 2023 03:10:15 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 434DB3E965; Mon, 25 Dec 2023 11:10: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 004A55300C; Mon, 25 Dec 2023 11:10:07 +0300 (MSK) Received: (nullmailer pid 78174 invoked by uid 1000); Mon, 25 Dec 2023 08:10:07 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Natanael Copa , qemu-trivial@nongnu.org, qemu-stable@nongnu.org, Michael Tokarev Subject: [PULL 1/7] target/riscv/kvm: do not use non-portable strerrorname_np() Date: Mon, 25 Dec 2023 11:10:01 +0300 Message-Id: <20231225081007.78141-2-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231225081007.78141-1-mjt@tls.msk.ru> References: <20231225081007.78141-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: 1703491894908100001 Content-Type: text/plain; charset="utf-8" From: Natanael Copa strerrorname_np is non-portable and breaks building with musl libc. Use strerror(errno) instead, like we do other places. Cc: qemu-stable@nongnu.org Fixes: commit 082e9e4a58ba (target/riscv/kvm: improve 'init_multiext_cfg' e= rror msg) Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2041 Buglink: https://gitlab.alpinelinux.org/alpine/aports/-/issues/15541 Signed-off-by: Natanael Copa Reviewed-by: Daniel Henrique Barboza Signed-off-by: Michael Tokarev --- target/riscv/kvm/kvm-cpu.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 45b6cf1cfa..117e33cf90 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -832,9 +832,8 @@ static void kvm_riscv_read_multiext_legacy(RISCVCPU *cp= u, multi_ext_cfg->supported =3D false; val =3D false; } else { - error_report("Unable to read ISA_EXT KVM register %s, " - "error code: %s", multi_ext_cfg->name, - strerrorname_np(errno)); + error_report("Unable to read ISA_EXT KVM register %s: %s", + multi_ext_cfg->name, strerror(errno)); exit(EXIT_FAILURE); } } else { @@ -895,8 +894,8 @@ static void kvm_riscv_init_multiext_cfg(RISCVCPU *cpu, = KVMScratchCPU *kvmcpu) * * Error out if we get any other errno. */ - error_report("Error when accessing get-reg-list, code: %s", - strerrorname_np(errno)); + error_report("Error when accessing get-reg-list: %s", + strerror(errno)); exit(EXIT_FAILURE); } =20 @@ -905,8 +904,8 @@ static void kvm_riscv_init_multiext_cfg(RISCVCPU *cpu, = KVMScratchCPU *kvmcpu) reglist->n =3D rl_struct.n; ret =3D ioctl(kvmcpu->cpufd, KVM_GET_REG_LIST, reglist); if (ret) { - error_report("Error when reading KVM_GET_REG_LIST, code %s ", - strerrorname_np(errno)); + error_report("Error when reading KVM_GET_REG_LIST: %s", + strerror(errno)); exit(EXIT_FAILURE); } =20 @@ -927,9 +926,8 @@ static void kvm_riscv_init_multiext_cfg(RISCVCPU *cpu, = KVMScratchCPU *kvmcpu) reg.addr =3D (uint64_t)&val; ret =3D ioctl(kvmcpu->cpufd, KVM_GET_ONE_REG, ®); if (ret !=3D 0) { - error_report("Unable to read ISA_EXT KVM register %s, " - "error code: %s", multi_ext_cfg->name, - strerrorname_np(errno)); + error_report("Unable to read ISA_EXT KVM register %s: %s", + multi_ext_cfg->name, strerror(errno)); exit(EXIT_FAILURE); } =20 --=20 2.39.2 From nobody Tue Nov 26 22:17:41 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 1703491905957235.00926163277745; Mon, 25 Dec 2023 00:11:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHg2o-0007l5-0B; Mon, 25 Dec 2023 03:10:38 -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 1rHg2T-0007hv-Kv; Mon, 25 Dec 2023 03:10:17 -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 1rHg2R-0008Jz-Id; Mon, 25 Dec 2023 03:10:17 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 546D23E966; Mon, 25 Dec 2023 11:10: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 125115300D; Mon, 25 Dec 2023 11:10:08 +0300 (MSK) Received: (nullmailer pid 78177 invoked by uid 1000); Mon, 25 Dec 2023 08:10:07 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Akihiko Odaki , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 2/7] qemu-options: Unify the help entries for cocoa Date: Mon, 25 Dec 2023 11:10:02 +0300 Message-Id: <20231225081007.78141-3-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231225081007.78141-1-mjt@tls.msk.ru> References: <20231225081007.78141-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: 1703491906884100001 From: Akihiko Odaki Apparently the help entries were not merged when the patches got in. Fixes: f844cdb99714 ("ui/cocoa: capture all keys and combos when mouse is g= rabbed") Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Michael Tokarev --- qemu-options.hx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 68f2c09b00..ef49b856d6 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2087,6 +2087,7 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, #endif #if defined(CONFIG_COCOA) "-display cocoa[,full-grab=3Don|off][,swap-opt-cmd=3Don|off]\n" + " [,show-cursor=3Don|off][,left-command-key=3Don|off]\n" #endif #if defined(CONFIG_OPENGL) "-display egl-headless[,rendernode=3D]\n" @@ -2094,9 +2095,6 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, #if defined(CONFIG_DBUS_DISPLAY) "-display dbus[,addr=3D]\n" " [,gl=3Don|core|es|off][,rendernode=3D]\n" -#endif -#if defined(CONFIG_COCOA) - "-display cocoa[,show-cursor=3Don|off][,left-command-key=3Don|off]\n" #endif "-display none\n" " select display backend type\n" --=20 2.39.2 From nobody Tue Nov 26 22:17:41 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 170349187914481.07743406706845; Mon, 25 Dec 2023 00:11:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHg2l-0007kA-3a; Mon, 25 Dec 2023 03:10:35 -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 1rHg2V-0007iC-RJ; Mon, 25 Dec 2023 03:10:21 -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 1rHg2T-0008KE-0F; Mon, 25 Dec 2023 03:10:18 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 644D53E967; Mon, 25 Dec 2023 11:10: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 227A95300E; Mon, 25 Dec 2023 11:10:08 +0300 (MSK) Received: (nullmailer pid 78180 invoked by uid 1000); Mon, 25 Dec 2023 08:10:07 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Akihiko Odaki , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 3/7] qemu-options: Tell more for -display cocoa Date: Mon, 25 Dec 2023 11:10:03 +0300 Message-Id: <20231225081007.78141-4-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231225081007.78141-1-mjt@tls.msk.ru> References: <20231225081007.78141-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: 1703491880272100001 Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki Some options for -display cocoa were not described or not listed at all. Reported-by: BALATON Zoltan Signed-off-by: Akihiko Odaki Signed-off-by: Michael Tokarev --- qemu-options.hx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index ef49b856d6..b66570ae00 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2088,6 +2088,7 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, #if defined(CONFIG_COCOA) "-display cocoa[,full-grab=3Don|off][,swap-opt-cmd=3Don|off]\n" " [,show-cursor=3Don|off][,left-command-key=3Don|off]\n" + " [,full-screen=3Don|off][,zoom-to-fit=3Don|off]\n" #endif #if defined(CONFIG_OPENGL) "-display egl-headless[,rendernode=3D]\n" @@ -2189,10 +2190,26 @@ SRST provides drop-down menus and other UI elements to configure and control the VM during runtime. Valid parameters are: =20 + ``full-grab=3Don|off`` : Capture all key presses, including system= combos. + This requires accessibility permissions, si= nce it + performs a global grab on key events. + (default: off) See + https://support.apple.com/en-in/guide/mac-h= elp/mh32356/mac + + ``swap-opt-cmd=3Don|off`` : Swap the Option and Command keys so th= at their + key codes match their position on non-Mac + keyboards and you can use Meta/Super and= Alt + where you expect them. (default: off) + ``show-cursor=3Don|off`` : Force showing the mouse cursor =20 ``left-command-key=3Don|off`` : Disable forwarding left command ke= y to host =20 + ``full-screen=3Don|off`` : Start in fullscreen mode + + ``zoom-to-fit=3Don|off`` : Expand video output to the window size, + defaults to "off" + ``egl-headless[,rendernode=3D]`` Offload all OpenGL operations to a local DRI device. For any graphical display, this display needs to be paired with either --=20 2.39.2 From nobody Tue Nov 26 22:17:41 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 1703491906111602.0082468347991; Mon, 25 Dec 2023 00:11:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHg2s-0007on-9F; Mon, 25 Dec 2023 03:10:43 -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 1rHg2Z-0007iX-O9; Mon, 25 Dec 2023 03:10:25 -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 1rHg2W-0008Kb-2l; Mon, 25 Dec 2023 03:10:22 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 74C7D3E968; Mon, 25 Dec 2023 11:10: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 334FE5300F; Mon, 25 Dec 2023 11:10:08 +0300 (MSK) Received: (nullmailer pid 78183 invoked by uid 1000); Mon, 25 Dec 2023 08:10:07 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Samuel Tardieu , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 4/7] docs/tools/qemu-img.rst: fix typo (sumarizes) Date: Mon, 25 Dec 2023 11:10:04 +0300 Message-Id: <20231225081007.78141-5-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231225081007.78141-1-mjt@tls.msk.ru> References: <20231225081007.78141-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: 1703491906887100002 Content-Type: text/plain; charset="utf-8" From: Samuel Tardieu Signed-off-by: Samuel Tardieu Reviewed-by: Zhao Liu Signed-off-by: Michael Tokarev --- docs/tools/qemu-img.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst index 4459c065f1..3653adb963 100644 --- a/docs/tools/qemu-img.rst +++ b/docs/tools/qemu-img.rst @@ -406,7 +406,7 @@ Command description: Compare exits with ``0`` in case the images are equal and with ``1`` in case the images differ. Other exit codes mean an error occurred during execution and standard error output should contain an error message. - The following table sumarizes all exit codes of the compare subcommand: + The following table summarizes all exit codes of the compare subcommand: =20 0 Images are identical (or requested help was printed) --=20 2.39.2 From nobody Tue Nov 26 22:17:41 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 1703491921642188.96660619354304; Mon, 25 Dec 2023 00:12:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHg33-00081X-SR; Mon, 25 Dec 2023 03:10: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 1rHg2d-0007iu-J0; Mon, 25 Dec 2023 03:10:29 -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 1rHg2W-0008Kl-6y; Mon, 25 Dec 2023 03:10:27 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 853CB3E969; Mon, 25 Dec 2023 11:10: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 42BD953010; Mon, 25 Dec 2023 11:10:08 +0300 (MSK) Received: (nullmailer pid 78186 invoked by uid 1000); Mon, 25 Dec 2023 08:10:07 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Jai Arora , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 5/7] accel/kvm: Turn DPRINTF macro use into tracepoints Date: Mon, 25 Dec 2023 11:10:05 +0300 Message-Id: <20231225081007.78141-6-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231225081007.78141-1-mjt@tls.msk.ru> References: <20231225081007.78141-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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=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: 1703491923405100006 From: Jai Arora Patch removes DPRINTF macro and adds multiple tracepoints to capture different kvm events. We also drop the DPRINTFs that don't add any additional information than trace_kvm_run_exit already does. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1827 Signed-off-by: Jai Arora Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Michael Tokarev --- accel/kvm/kvm-all.c | 28 ++++++---------------------- accel/kvm/trace-events | 7 ++++++- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index f138e7fefe..eb17773f0b 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -69,16 +69,6 @@ #define KVM_GUESTDBG_BLOCKIRQ 0 #endif =20 -//#define DEBUG_KVM - -#ifdef DEBUG_KVM -#define DPRINTF(fmt, ...) \ - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) \ - do { } while (0) -#endif - struct KVMParkedVcpu { unsigned long vcpu_id; int kvm_fd; @@ -331,7 +321,7 @@ static int do_kvm_destroy_vcpu(CPUState *cpu) struct KVMParkedVcpu *vcpu =3D NULL; int ret =3D 0; =20 - DPRINTF("kvm_destroy_vcpu\n"); + trace_kvm_destroy_vcpu(); =20 ret =3D kvm_arch_destroy_vcpu(cpu); if (ret < 0) { @@ -341,7 +331,7 @@ static int do_kvm_destroy_vcpu(CPUState *cpu) mmap_size =3D kvm_ioctl(s, KVM_GET_VCPU_MMAP_SIZE, 0); if (mmap_size < 0) { ret =3D mmap_size; - DPRINTF("KVM_GET_VCPU_MMAP_SIZE failed\n"); + trace_kvm_failed_get_vcpu_mmap_size(); goto err; } =20 @@ -443,7 +433,6 @@ int kvm_init_vcpu(CPUState *cpu, Error **errp) PAGE_SIZE * KVM_DIRTY_LOG_PAGE_OFFSET); if (cpu->kvm_dirty_gfns =3D=3D MAP_FAILED) { ret =3D -errno; - DPRINTF("mmap'ing vcpu dirty gfns failed: %d\n", ret); goto err; } } @@ -2821,7 +2810,7 @@ int kvm_cpu_exec(CPUState *cpu) struct kvm_run *run =3D cpu->kvm_run; int ret, run_ret; =20 - DPRINTF("kvm_cpu_exec()\n"); + trace_kvm_cpu_exec(); =20 if (kvm_arch_process_async_events(cpu)) { qatomic_set(&cpu->exit_request, 0); @@ -2848,7 +2837,7 @@ int kvm_cpu_exec(CPUState *cpu) =20 kvm_arch_pre_run(cpu, run); if (qatomic_read(&cpu->exit_request)) { - DPRINTF("interrupt exit requested\n"); + trace_kvm_interrupt_exit_request(); /* * KVM requires us to reenter the kernel after IO exits to com= plete * instruction emulation. This self-signal will ensure that we @@ -2878,7 +2867,7 @@ int kvm_cpu_exec(CPUState *cpu) =20 if (run_ret < 0) { if (run_ret =3D=3D -EINTR || run_ret =3D=3D -EAGAIN) { - DPRINTF("io window exit\n"); + trace_kvm_io_window_exit(); kvm_eat_signals(cpu); ret =3D EXCP_INTERRUPT; break; @@ -2900,7 +2889,6 @@ int kvm_cpu_exec(CPUState *cpu) trace_kvm_run_exit(cpu->cpu_index, run->exit_reason); switch (run->exit_reason) { case KVM_EXIT_IO: - DPRINTF("handle_io\n"); /* Called outside BQL */ kvm_handle_io(run->io.port, attrs, (uint8_t *)run + run->io.data_offset, @@ -2910,7 +2898,6 @@ int kvm_cpu_exec(CPUState *cpu) ret =3D 0; break; case KVM_EXIT_MMIO: - DPRINTF("handle_mmio\n"); /* Called outside BQL */ address_space_rw(&address_space_memory, run->mmio.phys_addr, attrs, @@ -2920,11 +2907,9 @@ int kvm_cpu_exec(CPUState *cpu) ret =3D 0; break; case KVM_EXIT_IRQ_WINDOW_OPEN: - DPRINTF("irq_window_open\n"); ret =3D EXCP_INTERRUPT; break; case KVM_EXIT_SHUTDOWN: - DPRINTF("shutdown\n"); qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); ret =3D EXCP_INTERRUPT; break; @@ -2959,6 +2944,7 @@ int kvm_cpu_exec(CPUState *cpu) ret =3D 0; break; case KVM_EXIT_SYSTEM_EVENT: + trace_kvm_run_exit_system_event(cpu->cpu_index, run->system_ev= ent.type); switch (run->system_event.type) { case KVM_SYSTEM_EVENT_SHUTDOWN: qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN= ); @@ -2976,13 +2962,11 @@ int kvm_cpu_exec(CPUState *cpu) ret =3D 0; break; default: - DPRINTF("kvm_arch_handle_exit\n"); ret =3D kvm_arch_handle_exit(cpu, run); break; } break; default: - DPRINTF("kvm_arch_handle_exit\n"); ret =3D kvm_arch_handle_exit(cpu, run); break; } diff --git a/accel/kvm/trace-events b/accel/kvm/trace-events index 399aaeb0ec..a25902597b 100644 --- a/accel/kvm/trace-events +++ b/accel/kvm/trace-events @@ -25,4 +25,9 @@ kvm_dirty_ring_reaper(const char *s) "%s" kvm_dirty_ring_reap(uint64_t count, int64_t t) "reaped %"PRIu64" pages (to= ok %"PRIi64" us)" kvm_dirty_ring_reaper_kick(const char *reason) "%s" kvm_dirty_ring_flush(int finished) "%d" - +kvm_destroy_vcpu(void) "" +kvm_failed_get_vcpu_mmap_size(void) "" +kvm_cpu_exec(void) "" +kvm_interrupt_exit_request(void) "" +kvm_io_window_exit(void) "" +kvm_run_exit_system_event(int cpu_index, uint32_t event_type) "cpu_index %= d, system_even_type %"PRIu32 --=20 2.39.2 From nobody Tue Nov 26 22:17:41 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 17034918534632.398483141011752; Mon, 25 Dec 2023 00:10:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHg2n-0007l4-3D; Mon, 25 Dec 2023 03:10:38 -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 1rHg2c-0007ip-1R; Mon, 25 Dec 2023 03:10:27 -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 1rHg2a-0008L8-Ch; Mon, 25 Dec 2023 03:10:25 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 966893E96A; Mon, 25 Dec 2023 11:10: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 5329053011; Mon, 25 Dec 2023 11:10:08 +0300 (MSK) Received: (nullmailer pid 78189 invoked by uid 1000); Mon, 25 Dec 2023 08:10:07 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Elen Avan , qemu-trivial@nongnu.org, qemu-stable@nongnu.org, Michael Tokarev Subject: [PULL 6/7] include/ui/rect.h: fix qemu_rect_init() mis-assignment Date: Mon, 25 Dec 2023 11:10:06 +0300 Message-Id: <20231225081007.78141-7-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231225081007.78141-1-mjt@tls.msk.ru> References: <20231225081007.78141-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: 1703491855731100003 From: Elen Avan Signed-off-by: Elen Avan Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2051 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2050 Fixes: a200d53b1fde "virtio-gpu: replace PIXMAN for region/rect test" Cc: qemu-stable@nongnu.org Reviewed-by: Michael Tokarev Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Michael Tokarev --- include/ui/rect.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ui/rect.h b/include/ui/rect.h index 94898f92d0..68f05d78a8 100644 --- a/include/ui/rect.h +++ b/include/ui/rect.h @@ -19,7 +19,7 @@ static inline void qemu_rect_init(QemuRect *rect, uint16_t width, uint16_t height) { rect->x =3D x; - rect->y =3D x; + rect->y =3D y; rect->width =3D width; rect->height =3D height; } --=20 2.39.2 From nobody Tue Nov 26 22:17:41 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 1703491918532814.4125767321502; Mon, 25 Dec 2023 00:11:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHg38-00086t-PO; Mon, 25 Dec 2023 03:10:59 -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 1rHg2f-0007iz-69; Mon, 25 Dec 2023 03:10:29 -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 1rHg2d-0008Lf-KS; Mon, 25 Dec 2023 03:10:28 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A4EA43E96B; Mon, 25 Dec 2023 11:10: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 652B853012; Mon, 25 Dec 2023 11:10:08 +0300 (MSK) Received: (nullmailer pid 78192 invoked by uid 1000); Mon, 25 Dec 2023 08:10:07 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Stefan Weil via , Michael Tokarev Subject: [PULL 7/7] virtio-blk: Fix potential nullpointer read access in virtio_blk_data_plane_destroy Date: Mon, 25 Dec 2023 11:10:07 +0300 Message-Id: <20231225081007.78141-8-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231225081007.78141-1-mjt@tls.msk.ru> References: <20231225081007.78141-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: 1703491919268100001 Content-Type: text/plain; charset="utf-8" From: Stefan Weil via Fixes: CID 1532828 Fixes: b6948ab01d ("virtio-blk: add iothread-vq-mapping parameter") Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- hw/block/dataplane/virtio-blk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-bl= k.c index 6debd4401e..97a302cf49 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -152,7 +152,7 @@ bool virtio_blk_data_plane_create(VirtIODevice *vdev, V= irtIOBlkConf *conf, void virtio_blk_data_plane_destroy(VirtIOBlockDataPlane *s) { VirtIOBlock *vblk; - VirtIOBlkConf *conf =3D s->conf; + VirtIOBlkConf *conf; =20 if (!s) { return; @@ -160,6 +160,7 @@ void virtio_blk_data_plane_destroy(VirtIOBlockDataPlane= *s) =20 vblk =3D VIRTIO_BLK(s->vdev); assert(!vblk->dataplane_started); + conf =3D s->conf; =20 if (conf->iothread_vq_mapping_list) { IOThreadVirtQueueMappingList *node; --=20 2.39.2