From patchwork Thu Oct 31 04:04:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 2004508 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JzZOmVcl; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf9Q20m4jz1xwK for ; Thu, 31 Oct 2024 15:05:30 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6MQh-0003e4-QT; Thu, 31 Oct 2024 00:05:04 -0400 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 1t6MQe-0003bP-Tc for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:00 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6MQc-0004pY-UC for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:00 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2e2b549799eso388287a91.3 for ; Wed, 30 Oct 2024 21:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730347497; x=1730952297; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=njeHlPS1UvDHI0dHkOZk8rvt6i94v/W7laKq7UySnIM=; b=JzZOmVclvLooWgo5QSYOns/4x7NWLfWP9GnrYGq6tbRg/jmYpamxy9dVB74mmwY1t2 xgp6MtCeIxL6YyFPeFzQww+4LZDNP41oDmCp0XI4yYUOqFTVzKBJtNtj9qz0IxEmfWax zXvZyUuiPNDChNmdnJbDQlIB4Ny0avqiZWfnmE1viQuk03rPLOgTFMp0auZx5k33c/Wx cXyfd0wh7HJtxCRgrUVcs/dBQ0n8r3sDtwyz8XoVChFRxjl99kVE+76WNgHZgbjDL/rZ zn+gAyL6SIzZ3S8cEN/4njWV8LEYJnfkrRsDKVhtHSS1ZRWFApEfEWV3d1m3m+2W1f22 9WxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730347497; x=1730952297; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=njeHlPS1UvDHI0dHkOZk8rvt6i94v/W7laKq7UySnIM=; b=Qro7pbAbDBWv1qdrotRrarUZAdn8gqjsPQ2KMWz6tQscwEOcp5ED8OklLtkiGnH8df Rc0hYnDGU78lutiumJKvQyQ5iC0UUMPQ9gPpXbwrRl65o1TRuJf/IDCOqVckInpTQusP c5KtWJEejviKb2ZsoxmpCNsTGFwqwrN6oBiyoaRk3JKRMSVTXgFaPSDACOVWcnp5WCFV UwGORe+HBSQeyd1lwk/ucJvEwvDYCWLq/KJvyOHH6/aclquPZ+s57Tz4Vu3DU2TUdo0z adu8jL76xxSx52U/jrcRGlA485rjF19mHscU/pHmuem+jXbMEzfEtSI5BtdNSCSXmxUF 36Bg== X-Gm-Message-State: AOJu0YzPLK9k2uv3UgrLaUCKLF+0HpCUT2ypXnUCStTKi+Hlnca0ETHw 3Jp/XjZeDzNH6oZkXWIqhynDmhBh0t219wqcQp0AGIx45iFyI/Sf/1abUMCPyUYa8iR11KXrKIi 3XtVWOw== X-Google-Smtp-Source: AGHT+IGXvHOS0yU16i74618zHhJXoSd4NN9X2CvpmbDDMkWmfg/y7mI5sERLC29xPOX+IyUKKhQ/3A== X-Received: by 2002:a17:90a:df0b:b0:2e0:f896:9d6d with SMTP id 98e67ed59e1d1-2e8f106fd8cmr19013294a91.16.1730347497564; Wed, 30 Oct 2024 21:04:57 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e93db3a023sm428438a91.49.2024.10.30.21.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 21:04:57 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Cleber Rosa , John Snow , Michael Roth , Alexandre Iooss , Konstantin Kostiuk , Stefano Garzarella , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , "Michael S. Tsirkin" , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 01/12] scripts: remove erroneous file that breaks git clone on Windows Date: Wed, 30 Oct 2024 21:04:15 -0700 Message-Id: <20241031040426.772604-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031040426.772604-1-pierrick.bouvier@linaro.org> References: <20241031040426.772604-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This file was created by mistake in recent ed7667188 (9p: remove 'proxy' filesystem backend driver). When cloning the repository using native git for windows, we see this: Error: error: invalid path 'scripts/meson-buildoptions.' Error: The process 'C:\Program Files\Git\bin\git.exe' failed with exit code 128 Reviewed-by: Paolo Bonzini Signed-off-by: Pierrick Bouvier --- scripts/meson-buildoptions. | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 scripts/meson-buildoptions. diff --git a/scripts/meson-buildoptions. b/scripts/meson-buildoptions. deleted file mode 100644 index e69de29bb2d..00000000000 From patchwork Thu Oct 31 04:04:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 2004516 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=FM//VtgL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf9Sq0Xnmz1xxp for ; Thu, 31 Oct 2024 15:07:54 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6MQn-0003hR-9W; Thu, 31 Oct 2024 00:05:09 -0400 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 1t6MQg-0003dR-IB for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:03 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6MQe-0004ph-MB for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:02 -0400 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2e30116efc9so392169a91.2 for ; Wed, 30 Oct 2024 21:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730347498; x=1730952298; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WpgvBPyGx65kpjq48fx4MpdW5Aw7ymp2tboHQxxKolQ=; b=FM//VtgL48k9OtEeWPfmQ3f0wtXsDJ2O8rPQNzK6SxUhLgPzaV5TTlx3gLvBd8bvCO l0zzzKjUVw12e19SDEatsOuccsFVhu6JslcAZWTCXGuvlHTZ64EPnsEAq0Hzi0JpqJkk 36sKnzS1x0np1nsEw57InouMvDTZjSzbwvoMeMToaaH4MOWLLUzfxsByo6pWDG2CxWaH ZfD/X1h9wM47E1ILEXiQu+I1yUZosEe9Mt8lXeLlE56H28Ucksh1rjgsVk0oW863Xgir Vh/tT33ODlBgwbzvD+cmpom0z7nxA2aDgabvmNcg6ppCMdYk3u1ArX71ibi6VfpZhtim PNfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730347498; x=1730952298; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WpgvBPyGx65kpjq48fx4MpdW5Aw7ymp2tboHQxxKolQ=; b=cI7bDcW2MKaJPBJyR+uwMfeqhbYG9pJYU+dYNXgEnBctFDr6N4+DdpctUR06Iyngbf XXQBMfslcQRz5Sbo0U00I+Yl7tGaC9/20fqkhl05Mb8FGTMSb4gDGuo3YC7prtPBZAE+ YANbm277cLYfxJl6n1T6kEXfqydydxgJw5Rp+iPyEZwTlzDzcNzz89Po9xcImfo6T02T MPml1+KvtPFy2ZaVDyVSBczOk1R8aieylxy1ZQmYa9ytzjMZwew9ksA1PpxR51whNcqY swUf1oyHyQrkKNj9xQ+TL4AGUXQguchHmNyJeSe5iJheXQKMF+5UDAb/d26963QWZ/Y7 PDUA== X-Gm-Message-State: AOJu0YzYxISZRl7a68edi13MZ4kzJlq3MUZIjvq1vYDGi3dtTQqOECMr b7QuklIfezAT5M+dYeclDenq/XB76abcWaLeXAILr3RdivJsqcS5jven3a+OYhYeOU0vTpWipDt IdjBYgw== X-Google-Smtp-Source: AGHT+IGKeVwrQKTxPrVzUsznsDEhBcZ6belWBpoT0d+OrQfk+qtv6nOpV+TR2yOmlRGGGAYWdHteEg== X-Received: by 2002:a17:90a:e154:b0:2e2:e148:3d30 with SMTP id 98e67ed59e1d1-2e8f107354amr21150840a91.23.1730347498653; Wed, 30 Oct 2024 21:04:58 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e93db3a023sm428438a91.49.2024.10.30.21.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 21:04:58 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Cleber Rosa , John Snow , Michael Roth , Alexandre Iooss , Konstantin Kostiuk , Stefano Garzarella , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , "Michael S. Tsirkin" , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 02/12] contrib/plugins/cflow: fix warning Date: Wed, 30 Oct 2024 21:04:16 -0700 Message-Id: <20241031040426.772604-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031040426.772604-1-pierrick.bouvier@linaro.org> References: <20241031040426.772604-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1035.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org contrib/plugins/cflow.c: In function ‘plugin_exit’: contrib/plugins/cflow.c:167:19: error: declaration of ‘n’ shadows a previous local [-Werror=shadow=local] 167 | NodeData *n = l->data; | ^ contrib/plugins/cflow.c:139:9: note: shadowed declaration is here 139 | int n = 0; | ^ Reviewed-by: Alex Bennée Signed-off-by: Pierrick Bouvier --- contrib/plugins/cflow.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/plugins/cflow.c b/contrib/plugins/cflow.c index 6faa55d10d1..b39974d1cf3 100644 --- a/contrib/plugins/cflow.c +++ b/contrib/plugins/cflow.c @@ -136,7 +136,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) g_autoptr(GString) result = g_string_new("collected "); GList *data; GCompareFunc sort = &hottest; - int n = 0; + int i = 0; g_mutex_lock(&node_lock); g_string_append_printf(result, "%d control flow nodes in the hash table\n", @@ -162,8 +162,8 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) data = g_list_sort(data, sort); for (GList *l = data; - l != NULL && n < topn; - l = l->next, n++) { + l != NULL && i < topn; + l = l->next, i++) { NodeData *n = l->data; const char *type = n->mid_count ? "sync fault" : "branch"; g_string_append_printf(result, " addr: 0x%"PRIx64 " %s: %s (%s)\n", From patchwork Thu Oct 31 04:04:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 2004515 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=BJCL8X/l; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf9SS5JL7z1xwK for ; Thu, 31 Oct 2024 15:07:36 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6MQp-0003lK-RT; Thu, 31 Oct 2024 00:05:12 -0400 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 1t6MQg-0003dU-RU for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:03 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6MQf-0004q1-2s for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:02 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2e56750bb0dso381466a91.0 for ; Wed, 30 Oct 2024 21:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730347500; x=1730952300; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fv7fP7ICWyfxL2x/CP9SZRa4THtQuAFnXp8RQEnngd8=; b=BJCL8X/lA4a8SS5Y57Zp/+YXEwlvrqdmuWrdCnynK/ZZYsZlzh6AT46FZ0uqSuPW+G EyvItsTlhYQh+NVMLBQvhba8byYj2l4n+nPx68wshcVBiw0tCMoGwi0tQEo+jr+9bRux oncAjkv5yKI+kt02BosphueN8+chuYdH1yZC/jqRyTDYzCwsr3fqEZY/TYYukncktwPW XVMbouGinVUsuWx/Phs0s1YZGVzpy2iR/y51+ZakxH3WWDJhZEE/FI1e5W2QdoiSftcL gtqFLaDxi4HUYdyIZHryVzMTZ3H/E9TneUWNRGXZTUlrP+l1rdXgKMyAIQo/3YBZjFMy Dumg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730347500; x=1730952300; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fv7fP7ICWyfxL2x/CP9SZRa4THtQuAFnXp8RQEnngd8=; b=mbUkjh0zPXkzYmhfqPiamKEaqtxujvN0TQ6HDBay5CgSMW1O9s1wt5IoXWqwVcNMo2 mne7XdA8OPfvHZrssZ1/miDwGSsh/tNtVGnnRVl7qzBx8I7juhMC+y7UnXE/M7GxA6+A 6z8xEtwKiTxA3IHKySf8jHkg6jjbCh47pFiauGCkEdH3ErcBoLCaqIhvkZFVhp2nN7Pz lxWVdi5FGCubXwQRfIzNTl/AG8vDV4/MQ9440cw1kxN9Ee2KAN9WUTDLAd7AL677hSKF dRDKgYQ3bWmqn5d01FFQlO3tJaVtPx+RUgAteuABIjHvkfcLN/piTudtTePtUVM/rWyo /4XA== X-Gm-Message-State: AOJu0YwSzh0NVegB27GfedA01GE6+GGf758zIt72ctffIgOJY4gK2ZEj eN7xRowLM4v2hSSf4UQZtREJsIqPHzZgSnldHf0ms5uaFfYNukJ0A/rbhUaqIWW4yOofkIENfOS fwVSOLg== X-Google-Smtp-Source: AGHT+IFpQxDk8p2VP4nriXIupYuXJBOVQI3fMflZN8u0ftZ0x8kXb92WWWiHWfBfhK898FPlWB2tsw== X-Received: by 2002:a17:90b:2741:b0:2e2:b64e:f506 with SMTP id 98e67ed59e1d1-2e8f105b461mr21551918a91.13.1730347499654; Wed, 30 Oct 2024 21:04:59 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e93db3a023sm428438a91.49.2024.10.30.21.04.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 21:04:59 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Cleber Rosa , John Snow , Michael Roth , Alexandre Iooss , Konstantin Kostiuk , Stefano Garzarella , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , "Michael S. Tsirkin" , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 03/12] meson: build contrib/plugins with meson Date: Wed, 30 Oct 2024 21:04:17 -0700 Message-Id: <20241031040426.772604-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031040426.772604-1-pierrick.bouvier@linaro.org> References: <20241031040426.772604-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Tried to unify this meson.build with tests/tcg/plugins/meson.build but the resulting modules are not output in the right directory. Originally proposed by Anton Kochkov, thank you! Solves: https://gitlab.com/qemu-project/qemu/-/issues/1710 Reviewed-by: Alex Bennée Signed-off-by: Pierrick Bouvier --- meson.build | 4 ++++ contrib/plugins/meson.build | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 contrib/plugins/meson.build diff --git a/meson.build b/meson.build index f7d45175212..d8af08299e0 100644 --- a/meson.build +++ b/meson.build @@ -3684,6 +3684,10 @@ subdir('accel') subdir('plugins') subdir('ebpf') +if 'CONFIG_TCG' in config_all_accel + subdir('contrib/plugins') +endif + common_user_inc = [] subdir('common-user') diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build new file mode 100644 index 00000000000..63a32c2b4f0 --- /dev/null +++ b/contrib/plugins/meson.build @@ -0,0 +1,28 @@ +contrib_plugins = ['bbv', 'cache', 'cflow', 'drcov', 'execlog', 'hotblocks', + 'hotpages', 'howvec', 'hwprofile', 'ips', 'stoptrigger'] +if host_os != 'windows' + # lockstep uses socket.h + contrib_plugins += 'lockstep' +endif + +t = [] +if get_option('plugins') + foreach i : contrib_plugins + if host_os == 'windows' + t += shared_module(i, files(i + '.c') + 'win32_linker.c', + include_directories: '../../include/qemu', + link_depends: [win32_qemu_plugin_api_lib], + link_args: ['-Lplugins', '-lqemu_plugin_api'], + dependencies: glib) + else + t += shared_module(i, files(i + '.c'), + include_directories: '../../include/qemu', + dependencies: glib) + endif + endforeach +endif +if t.length() > 0 + alias_target('contrib-plugins', t) +else + run_target('contrib-plugins', command: find_program('true')) +endif From patchwork Thu Oct 31 04:04:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 2004514 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=M+u9yDEE; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf9SN0gMBz1xwK for ; Thu, 31 Oct 2024 15:07:32 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6MQn-0003iO-LW; Thu, 31 Oct 2024 00:05:09 -0400 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 1t6MQi-0003eU-Ba for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:04 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6MQg-0004qT-GI for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:04 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-20c8b557f91so5319605ad.2 for ; Wed, 30 Oct 2024 21:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730347501; x=1730952301; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s8/FoORAU+MbCzBkiE+YK/dNQraWToWCvs2DtBwW02Y=; b=M+u9yDEEMZfeVUY41bCuihIlEqXL3E744K4MGrk+PF7YhSNnXFx7cin8upM+xipYo2 HjqwMJ2LUkn0FAx4sg0KeA+TWW5LZ5ORhDvcIrbRpXxqk5vyOPrleDQfAgHWCoM1+nAb 87hJFpyt8Cuw1/ALbDu8KU8wbnrWc4iph+EXOSba4vaRgoChfngXnWPHw4OdDaAP6yS8 qdOaL2TgyzdCLz2KzYY54BYLi5ZMHy/f+gFasU2Az6a3TSpXTqCWT1o7Yn7DuawCDwzQ xdzJM8kGalI8GQLc2wAmsLWGVjLc9l3Jg+teWVg91gPyeAdL+qnpb1sgBqxtlWgEEVTE laCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730347501; x=1730952301; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s8/FoORAU+MbCzBkiE+YK/dNQraWToWCvs2DtBwW02Y=; b=SP0f8nKuw8Jgj9kmbPRcqblDhr2gTwyuK6iXoTn2l6tQUkmj685WZfQdfDEeWuwhgO e/Wg1LsfUCA5oJghGynUjpq5MYG6NKMVDe5TZmmvZO6Xdkxjd2sk9u+RQ1Zaj0ez5Adn aJydUtoN3OrJabZs1bKw/r7MScDWk6KvNoXmt7g/QYbcDCiSPAgS5dDFIR7hxL3z36Ci aoXtiDpl2UT9tgPZHMexaTJJkGaDn92PaTH1NeZE7E9ETnXt5FhH/tiPEotSO/YbTK95 f1Cj5J9YZ5uFH+yhDvO1COgmn4kyVjRMGxzQGwDqYO8NkhpaYfVDJb8nx8tUnJyU05dO 9ULQ== X-Gm-Message-State: AOJu0YxZH7Q0O9NQXvZGuhyJyIAynnCmgsBkJumG8X1VOKUGGOdv/2zd eSYZDnUXj4jwAxsmbMmCvfB605tmWwRHfPtVbRL1Ogl1YyeKBG8ZM+LxLEsy0FY1JCnBPrwSWqA wLHZePw== X-Google-Smtp-Source: AGHT+IG2rAYEErvzHSg3m0qkWXFcFOScpXKMPZL5dHjMebkKHgSGcvDogxFZVUhdAVzXSb4ClNN3sQ== X-Received: by 2002:a17:903:228d:b0:20b:9062:7b08 with SMTP id d9443c01a7336-210c6c6e7edmr287969295ad.45.1730347500835; Wed, 30 Oct 2024 21:05:00 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e93db3a023sm428438a91.49.2024.10.30.21.04.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 21:05:00 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Cleber Rosa , John Snow , Michael Roth , Alexandre Iooss , Konstantin Kostiuk , Stefano Garzarella , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , "Michael S. Tsirkin" , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 04/12] contrib/plugins: remove Makefile for contrib/plugins Date: Wed, 30 Oct 2024 21:04:18 -0700 Message-Id: <20241031040426.772604-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031040426.772604-1-pierrick.bouvier@linaro.org> References: <20241031040426.772604-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Now replaced by meson build. Reviewed-by: Alex Bennée Signed-off-by: Pierrick Bouvier --- configure | 18 --------- Makefile | 10 ----- contrib/plugins/Makefile | 87 ---------------------------------------- 3 files changed, 115 deletions(-) delete mode 100644 contrib/plugins/Makefile diff --git a/configure b/configure index 4a0159e1832..8f0ba505187 100755 --- a/configure +++ b/configure @@ -1073,7 +1073,6 @@ if test "$plugins" != "no" && test $host_bits -eq 64; then plugins="no" else plugins=yes - subdirs="$subdirs contrib/plugins" fi fi @@ -1704,7 +1703,6 @@ LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit LINKS="$LINKS tests/avocado tests/data" LINKS="$LINKS tests/qemu-iotests/check tests/qemu-iotests/Makefile" LINKS="$LINKS python" -LINKS="$LINKS contrib/plugins/Makefile " for f in $LINKS ; do if [ -e "$source_path/$f" ]; then symlink "$source_path/$f" "$f" @@ -1790,22 +1788,6 @@ if test "$default_targets" = "yes"; then echo "CONFIG_DEFAULT_TARGETS=y" >> $config_host_mak fi -# contrib/plugins configuration -echo "# Automatically generated by configure - do not modify" > contrib/plugins/$config_host_mak -echo "SRC_PATH=$source_path/contrib/plugins" >> contrib/plugins/$config_host_mak -echo "PKG_CONFIG=${pkg_config}" >> contrib/plugins/$config_host_mak -echo "CC=$cc $CPU_CFLAGS" >> contrib/plugins/$config_host_mak -echo "CFLAGS=${CFLAGS-$default_cflags} $EXTRA_CFLAGS" >> contrib/plugins/$config_host_mak -if test "$host_os" = windows; then - echo "DLLTOOL=$dlltool" >> contrib/plugins/$config_host_mak -fi -if test "$host_os" = darwin; then - echo "CONFIG_DARWIN=y" >> contrib/plugins/$config_host_mak -fi -if test "$host_os" = windows; then - echo "CONFIG_WIN32=y" >> contrib/plugins/$config_host_mak -fi - # tests/tcg configuration mkdir -p tests/tcg echo "# Automatically generated by configure - do not modify" > tests/tcg/$config_host_mak diff --git a/Makefile b/Makefile index 917c9a34d1c..b65b0bd41a8 100644 --- a/Makefile +++ b/Makefile @@ -187,11 +187,6 @@ SUBDIR_RULES=$(foreach t, all clean distclean, $(addsuffix /$(t), $(SUBDIRS))) $(SUBDIR_RULES): $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),) -ifneq ($(filter contrib/plugins, $(SUBDIRS)),) -.PHONY: plugins -plugins: contrib/plugins/all -endif - .PHONY: recurse-all recurse-clean recurse-all: $(addsuffix /all, $(SUBDIRS)) recurse-clean: $(addsuffix /clean, $(SUBDIRS)) @@ -307,11 +302,6 @@ help: $(call print-help,cscope,Generate cscope index) $(call print-help,sparse,Run sparse on the QEMU source) @echo '' -ifneq ($(filter contrib/plugins, $(SUBDIRS)),) - @echo 'Plugin targets:' - $(call print-help,plugins,Build the example TCG plugins) - @echo '' -endif @echo 'Cleaning targets:' $(call print-help,clean,Remove most generated files but keep the config) $(call print-help,distclean,Remove all generated files) diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile deleted file mode 100644 index bbddd4800ff..00000000000 --- a/contrib/plugins/Makefile +++ /dev/null @@ -1,87 +0,0 @@ -# -*- Mode: makefile -*- -# -# This Makefile example is fairly independent from the main makefile -# so users can take and adapt it for their build. We only really -# include config-host.mak so we don't have to repeat probing for -# programs that the main configure has already done for us. -# - -include config-host.mak - -TOP_SRC_PATH = $(SRC_PATH)/../.. - -VPATH += $(SRC_PATH) - -NAMES := -NAMES += bbv -NAMES += execlog -NAMES += hotblocks -NAMES += hotpages -NAMES += howvec - -# The lockstep example communicates using unix sockets, -# and can't be easily made to work on windows. -ifneq ($(CONFIG_WIN32),y) -NAMES += lockstep -endif - -NAMES += hwprofile -NAMES += cache -NAMES += drcov -NAMES += ips -NAMES += stoptrigger -NAMES += cflow - -ifeq ($(CONFIG_WIN32),y) -SO_SUFFIX := .dll -LDLIBS += $(shell $(PKG_CONFIG) --libs glib-2.0) -else -SO_SUFFIX := .so -endif - -SONAMES := $(addsuffix $(SO_SUFFIX),$(addprefix lib,$(NAMES))) - -# The main QEMU uses Glib extensively so it is perfectly fine to use it -# in plugins (which many example do). -PLUGIN_CFLAGS := $(shell $(PKG_CONFIG) --cflags glib-2.0) -PLUGIN_CFLAGS += -fPIC -Wall -PLUGIN_CFLAGS += -I$(TOP_SRC_PATH)/include/qemu - -# Helper that honours V=1 so we get some output when compiling -quiet-@ = $(if $(V),,@$(if $1,printf " %-7s %s\n" "$(strip $1)" "$(strip $2)" && )) -quiet-command = $(call quiet-@,$2,$3)$1 - -# for including , in command strings -COMMA := , - -all: $(SONAMES) - -%.o: %.c - $(call quiet-command, \ - $(CC) $(CFLAGS) $(PLUGIN_CFLAGS) -c -o $@ $<, \ - BUILD, plugin $@) - -ifeq ($(CONFIG_WIN32),y) -lib%$(SO_SUFFIX): %.o win32_linker.o ../../plugins/libqemu_plugin_api.a - $(call quiet-command, \ - $(CC) -shared -o $@ $^ $(LDLIBS), \ - LINK, plugin $@) -else ifeq ($(CONFIG_DARWIN),y) -lib%$(SO_SUFFIX): %.o - $(call quiet-command, \ - $(CC) -bundle -Wl$(COMMA)-undefined$(COMMA)dynamic_lookup -o $@ $^ $(LDLIBS), \ - LINK, plugin $@) -else -lib%$(SO_SUFFIX): %.o - $(call quiet-command, \ - $(CC) -shared -o $@ $^ $(LDLIBS), \ - LINK, plugin $@) -endif - - -clean distclean: - rm -f *.o *$(SO_SUFFIX) *.d - rm -Rf .libs - -.PHONY: all clean -.SECONDARY: From patchwork Thu Oct 31 04:04:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 2004520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=QJ3fHpt2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf9WN0Tsbz1xxw for ; Thu, 31 Oct 2024 15:10:08 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6MQv-0003po-Cy; Thu, 31 Oct 2024 00:05:17 -0400 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 1t6MQi-0003ef-RB for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:07 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6MQh-0004qs-4Z for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:04 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-20cbb1cf324so4545895ad.0 for ; Wed, 30 Oct 2024 21:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730347502; x=1730952302; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=stB6xsCXZvGGgXKJAPY9QdgEF+16xwQAb0j6tVuAwQI=; b=QJ3fHpt2h4XeDHUo0UbLB4hh7VNbO1TvqaAuymV3ZpFgjA7R1yVesL31n0Y7R7JDqX UcKymBK60J80KUcKtYH9SYgKhNPd3OOUwOEoLINp5C3HMXwqPWmOiHO5E4ww7Y9IPBt3 geIDUwuLz87JBx6ZvxyEPSCXliaJH48DNGHBJ7gt9go9KU5+GAdKu2Cb1uEQAATj1KqT phQ1OghgGaFT3BJeYd6u9Y5N/gtPdjzYeCFdYhnyy3RGnkyF+/wo3jWiwyBBr81I4+xq BoQSBv/EhXqqQHKEoSKvyc1RthM1ba8ADO0lFrWbP6kxJ9syFYkqxzOWuBXplGs2NMI1 5dMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730347502; x=1730952302; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=stB6xsCXZvGGgXKJAPY9QdgEF+16xwQAb0j6tVuAwQI=; b=w2rwUJf44AkCP7F+EaQV2YwL8IE4K32AECRQFtq5n2jQFdE/dDNN7+k6QPFKvmhdZC IiQTDS3ZjBMQBxAEXfIQriFsvQIxgf1j3YhhTIqFVFSuzV2jaxeKCqjli8dfSkNiwq5F LLhL/0LrsLNyym1x6KNisc0+hYkIRH+TmAnGGeHTnRgVRqCJDGYqvGrbPDSL2BPU1J8d DHNahCYI1CMMlP4/ef1DhxPPZcD00UxV44Cmbz3wE6MqMe1s2OOw/tVsXLQs0O1mvdRG Pzk1TGrJG4BOeJHv8Vj3beOXYWNVqxcw6k7VZ2rzet7mxsOPQeO3b8pE62f2PPgvqbqF FViQ== X-Gm-Message-State: AOJu0YwwCVt5/SFa1y9VVStO5wCErgN17yKza2Rc96AE7lSTYx4FV0Yk dydK7CCwnLcA7saGA0kfPIfxqac04FbwHRLZFeO2/w4IiWzTgEof+sUx0MOYVzPebJ02XxVbZpX LZZc2tg== X-Google-Smtp-Source: AGHT+IEyNjojfk3YLrfbuYwwa6l3GsRh8rmuKIQ9uchPrZ0E4gGV0nFH3OnCIuZG5z3c0+Wx+bkACw== X-Received: by 2002:a17:902:eccb:b0:20e:5792:32ed with SMTP id d9443c01a7336-210c6c6cf5bmr217904555ad.41.1730347501863; Wed, 30 Oct 2024 21:05:01 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e93db3a023sm428438a91.49.2024.10.30.21.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 21:05:01 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Cleber Rosa , John Snow , Michael Roth , Alexandre Iooss , Konstantin Kostiuk , Stefano Garzarella , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , "Michael S. Tsirkin" , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 05/12] qga: fix -Wsometimes-uninitialized windows warning Date: Wed, 30 Oct 2024 21:04:19 -0700 Message-Id: <20241031040426.772604-6-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031040426.772604-1-pierrick.bouvier@linaro.org> References: <20241031040426.772604-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reported by clang, but not gcc. [5123/5678] Compiling C object qga/qemu-ga.exe.p/commands-windows-ssh.c.obj FAILED: qga/qemu-ga.exe.p/commands-windows-ssh.c.obj "cc" "-Iqga/qemu-ga.exe.p" "-Iqga" "-I../qga" "-I." "-Iqapi" "-Itrace" "-Iui" "-Iui/shader" "-IC:/msys64/clangarm64/include/glib-2.0" "-IC:/msys64/clangarm64/lib/glib-2.0/include" "-fdiagnostics-color=auto" "-Wall" "-Winvalid-pch" "-Werror" "-std=gnu11" "-O2" "-g" "-fstack-protector-strong" "-Wempty-body" "-Wendif-labels" "-Wexpansion-to-defined" "-Wformat-security" "-Wformat-y2k" "-Wignored-qualifiers" "-Winit-self" "-Wmissing-format-attribute" "-Wmissing-prototypes" "-Wnested-externs" "-Wold-style-definition" "-Wredundant-decls" "-Wstrict-prototypes" "-Wtype-limits" "-Wundef" "-Wvla" "-Wwrite-strings" "-Wno-gnu-variable-sized-type-not-at-end" "-Wno-initializer-overrides" "-Wno-missing-include-dirs" "-Wno-psabi" "-Wno-shift-negative-value" "-Wno-string-plus-int" "-Wno-tautological-type-limit-compare" "-Wno-typedef-redefinition" "-Wthread-safety" "-iquote" "." "-iquote" "C:/w/qemu" "-iquote" "C:/w/qemu/include" "-iquote" "C:/w/qemu/host/include/aarch64" "-iquote" "C:/w/qemu/host/include/generic" "-iquote" "C:/w/qemu/tcg/aarch64" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-fno-pie" "-ftrivial-auto-var-init=zero" "-fzero-call-used-regs=used-gpr" -MD -MQ qga/qemu-ga.exe.p/commands-windows-ssh.c.obj -MF "qga/qemu-ga.exe.p/commands-windows-ssh.c.obj.d" -o qga/qemu-ga.exe.p/commands-windows-ssh.c.obj "-c" ../qga/commands-windows-ssh.c ../qga/commands-windows-ssh.c:383:9: error: variable 'userPSID' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] 383 | if (!create_acl(userInfo, &pACL, errp)) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../qga/commands-windows-ssh.c:415:15: note: uninitialized use occurs here 415 | LocalFree(userPSID); | ^~~~~~~~ ../qga/commands-windows-ssh.c:383:5: note: remove the 'if' if its condition is always false 383 | if (!create_acl(userInfo, &pACL, errp)) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 384 | goto error; | ~~~~~~~~~~~ 385 | } | ~ ../qga/commands-windows-ssh.c:380:18: note: initialize the variable 'userPSID' to silence this warning 380 | PSID userPSID; | ^ | = NULL 1 error generated. Signed-off-by: Pierrick Bouvier Reviewed-by: Konstantin Kostiuk --- qga/commands-windows-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/commands-windows-ssh.c b/qga/commands-windows-ssh.c index 6a642e3ba81..df45c17b757 100644 --- a/qga/commands-windows-ssh.c +++ b/qga/commands-windows-ssh.c @@ -377,7 +377,7 @@ error: static bool set_file_permissions(PWindowsUserInfo userInfo, Error **errp) { PACL pACL = NULL; - PSID userPSID; + PSID userPSID = NULL; /* Creates the access control structure */ if (!create_acl(userInfo, &pACL, errp)) { From patchwork Thu Oct 31 04:04:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 2004517 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=pH+r6WuB; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf9VW6kmyz1xwK for ; Thu, 31 Oct 2024 15:09:23 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6MQs-0003nb-C4; Thu, 31 Oct 2024 00:05:14 -0400 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 1t6MQk-0003et-87 for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:07 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6MQi-0004rb-Fu for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:06 -0400 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2e30116efc9so392197a91.2 for ; Wed, 30 Oct 2024 21:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730347503; x=1730952303; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sm6RxNg+VAWQBzeQTWA0D+UajI2IQKoU/Rfc9RmIGOo=; b=pH+r6WuB1/avRqOvfla8F/QlXyWZ9btRtaNenea9XTvpn3fFCEJSJgy64mQER8e2ba QjWphNg3beNj1vHzvxYlosBu+nBsuqvmVG2vt/TCpdQw1c5Ca0cAkorSZPhSHZpKz6jw HH+FWtPmWqdYg6+QA0nYyJgCkbzmiyZKBnDaLOXzk1RUnqNOhWOmyNXyiBKu3F+gfvxX sdKHMoKAoK0AAXaHRPSDFQDay+pWALkE9ztIfvarp6tjfzH4vx4QHghbvqFxA2QvmSxe juzYdgReBS5P5fsHhOkQdzXc29EAxfsO573A3W2Mh+ZVtyh3FxTz2/uvzPxBoyWe0dHm e6qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730347503; x=1730952303; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sm6RxNg+VAWQBzeQTWA0D+UajI2IQKoU/Rfc9RmIGOo=; b=TaI0yb1QXIFjTYSTdsql0KmJNn4BSxQwdqnKU9XPcak0kWIF0DUluMOEz+LaDvHptL 49DN5iz5kFdVOR46e45YSRZsPXEqwWj7W7YqtCNU1WJQFmHnquzjsOVCGv04dxtiDUvk LmAWXvNbENfK0rKp348ySjnpG52w8racO4lPyyh7qx8h5Fn73tTsLwmV9uwVKeJ55nQl 3w88UchIomeam16ZZIZM44t+vge/GEnNqtMWm3z6i3rShh/5WoVANlb9xI7R9GilWzcj lCJn6S09WbjUuLYyxUw6eM02gcYHVFv5i4vkp4tDy8YtkLJIvyVzN3jY8Kll/Gc83B/2 M6kQ== X-Gm-Message-State: AOJu0YxwwCV0aHzQoLcZwCTI4vDjvPq5CaNCfCZLLYoWAZjcpnJel8ZV s6Mc5RJXPfPMV0D9LZFdpN2iOPIMKQgE3ZWneHKwSH77Lrj5KrMLrcxjW+C+REjKVVwGgrP6ve0 n9Znd9A== X-Google-Smtp-Source: AGHT+IHwyu+hau5X04RX9j6EFsNSJrEUmxTeMe33/MNSYJBt0a7atlZ0f5/7jO3Ig2+f2jwmlyTBnQ== X-Received: by 2002:a17:90a:4e0a:b0:2e2:c6b9:fd4a with SMTP id 98e67ed59e1d1-2e8f1072087mr20872679a91.18.1730347502813; Wed, 30 Oct 2024 21:05:02 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e93db3a023sm428438a91.49.2024.10.30.21.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 21:05:02 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Cleber Rosa , John Snow , Michael Roth , Alexandre Iooss , Konstantin Kostiuk , Stefano Garzarella , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , "Michael S. Tsirkin" , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 06/12] qga: fix missing static and prototypes windows warnings Date: Wed, 30 Oct 2024 21:04:20 -0700 Message-Id: <20241031040426.772604-7-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031040426.772604-1-pierrick.bouvier@linaro.org> References: <20241031040426.772604-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1036.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reported by clang++, but not by g++. ../qga/vss-win32/provider.cpp:48:6: error: no previous prototype for function 'LockModule' [-Werror,-Wmissing-prototypes] 48 | void LockModule(BOOL lock) | ^ ../qga/vss-win32/provider.cpp:48:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 48 | void LockModule(BOOL lock) | ^ | static ../qga/vss-win32/provider.cpp:531:13: error: no previous prototype for function 'DllMain' [-Werror,-Wmissing-prototypes] 531 | BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD dwReason, LPVOID lpReserved) | ^ ../qga/vss-win32/provider.cpp:531:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 531 | BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD dwReason, LPVOID lpReserved) | ^ | static Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Konstantin Kostiuk --- qga/vss-win32/install.cpp | 6 +++++- qga/vss-win32/provider.cpp | 5 ++++- qga/vss-win32/requester.cpp | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp index 84944133f79..5cea5bcf747 100644 --- a/qga/vss-win32/install.cpp +++ b/qga/vss-win32/install.cpp @@ -39,7 +39,7 @@ const GUID CLSID_WbemLocator = { 0x4590f811, 0x1d3a, 0x11d0, const GUID IID_IWbemLocator = { 0xdc12a687, 0x737f, 0x11cf, {0x88, 0x4d, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24} }; -void errmsg(DWORD err, const char *text) +static void errmsg(DWORD err, const char *text) { /* * `text' contains function call statement when errmsg is called via chk(). @@ -242,6 +242,7 @@ out: } /* Unregister this module from COM+ Applications Catalog */ +STDAPI COMUnregister(void); STDAPI COMUnregister(void) { qga_debug_begin; @@ -256,6 +257,7 @@ out: } /* Register this module to COM+ Applications Catalog */ +STDAPI COMRegister(void); STDAPI COMRegister(void) { qga_debug_begin; @@ -380,11 +382,13 @@ out: return hr; } +STDAPI_(void) CALLBACK DLLCOMRegister(HWND, HINSTANCE, LPSTR, int); STDAPI_(void) CALLBACK DLLCOMRegister(HWND, HINSTANCE, LPSTR, int) { COMRegister(); } +STDAPI_(void) CALLBACK DLLCOMUnregister(HWND, HINSTANCE, LPSTR, int); STDAPI_(void) CALLBACK DLLCOMUnregister(HWND, HINSTANCE, LPSTR, int) { COMUnregister(); diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp index cc72e5ef1b9..a102a23fbf1 100644 --- a/qga/vss-win32/provider.cpp +++ b/qga/vss-win32/provider.cpp @@ -45,7 +45,7 @@ const IID IID_IVssEnumObject = { 0xAE1C7110, 0x2F60, 0x11d3, {0x8A, 0x39, 0x00, 0xC0, 0x4F, 0x72, 0xD8, 0xE3} }; -void LockModule(BOOL lock) +static void LockModule(BOOL lock) { if (lock) { InterlockedIncrement(&g_nComObjsInUse); @@ -527,6 +527,9 @@ STDAPI DllCanUnloadNow() return g_nComObjsInUse == 0 ? S_OK : S_FALSE; } +EXTERN_C +BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD dwReason, LPVOID lpReserved); + EXTERN_C BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD dwReason, LPVOID lpReserved) { diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp index 9884c65e707..4401d55e3a4 100644 --- a/qga/vss-win32/requester.cpp +++ b/qga/vss-win32/requester.cpp @@ -254,8 +254,8 @@ out: qga_debug_end; } -DWORD get_reg_dword_value(HKEY baseKey, LPCSTR subKey, LPCSTR valueName, - DWORD defaultData) +static DWORD get_reg_dword_value(HKEY baseKey, LPCSTR subKey, LPCSTR valueName, + DWORD defaultData) { qga_debug_begin; @@ -272,12 +272,12 @@ DWORD get_reg_dword_value(HKEY baseKey, LPCSTR subKey, LPCSTR valueName, return dwordData; } -bool is_valid_vss_backup_type(VSS_BACKUP_TYPE vssBT) +static bool is_valid_vss_backup_type(VSS_BACKUP_TYPE vssBT) { return (vssBT > VSS_BT_UNDEFINED && vssBT < VSS_BT_OTHER); } -VSS_BACKUP_TYPE get_vss_backup_type( +static VSS_BACKUP_TYPE get_vss_backup_type( VSS_BACKUP_TYPE defaultVssBT = DEFAULT_VSS_BACKUP_TYPE) { qga_debug_begin; From patchwork Thu Oct 31 04:04:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 2004519 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=AJje5q7A; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf9WL5QYhz1xwK for ; Thu, 31 Oct 2024 15:10:06 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6MQv-0003qp-T1; Thu, 31 Oct 2024 00:05:17 -0400 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 1t6MQl-0003f8-PV for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:07 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6MQj-00051r-QF for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:07 -0400 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2e2e050b1c3so1262011a91.0 for ; Wed, 30 Oct 2024 21:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730347504; x=1730952304; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hoWX44V0fGpE1g+o7be5wb7qyUlUtcMzAcPzXC+tmrQ=; b=AJje5q7AMb9ky9l+pbiX5Ssnqng4Qol4bftjvOb0F7xQa0hL+cG24V8NMe+nUam9QZ jE672JLpQBhjqAnDUIf0rfuu2VduD4BydNFsWrxNEWSqLQ5GXhKhTt5JHmRSZoO8G+G1 Asm1KoMgikqt0SAJamCw8j1M/O6+LYTLuGWIqyrWW2W63J+uFeVMpxv5c97vMTtNi8QZ cPnhfJ6DjRIP3sQH0fB99uGXU34VNeIBc2L7MY2YiqZP0To3XI9O03c7x7U8gnNL0nfg m1T3qwSzoHl2ONM4hQey3Gi0/SFgeUJFu7XHWJP2YF3fCmPucdUdt6JHmaPo1ZRNlYO/ s7bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730347504; x=1730952304; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hoWX44V0fGpE1g+o7be5wb7qyUlUtcMzAcPzXC+tmrQ=; b=dM3FTvnZfHhK3Glt91ODYCwSZ+toDaF1AW2Gsg2yw7EeTeU2uy8VIL83FXdbWiHKV0 W5EgYBcJHKvG2xf0S2wkugACcMIUNhAiuLWeQQVwtDObr2euSA9IKdndovgBAKLYAcW5 y1nNjoAqsSxoQCC7ShWnNPQ0YHNGVuIrZ8tNipDa4s6oQmkS30vCYk2Hvhd7xjoP6G39 etwktfmldGRcSaAWm5Hk4Fve3MDbJ2jz7c81H3OQSsk/LriKKGIaycwj94IWJ4qw+wjV vzn0Mav/OTBIPZAnHO4seTwbBAVCpRjJBoBZZzJsy7KanmoRBalxaUDmp13aF1GMr8cV w42Q== X-Gm-Message-State: AOJu0YwjEHgcY2Y0HbxfaOpktRQse9p1nMygwKr7iW7aPW/8MuTajWdM OT85raQdiDxdhLEH2fCW2IM9p+Wljmte3gp2sniO6beevdZsE8DZ3Qghda5ITvzCanqwQdEVzcs oxNurbw== X-Google-Smtp-Source: AGHT+IHE8BrDQ0Lf7lFYuWM7cfuT09fTZKXigQJc4Y6aGz7tpvHkrpIFJePpZfaeejeZGXKiO+LZjg== X-Received: by 2002:a17:90b:1844:b0:2da:6e46:ad48 with SMTP id 98e67ed59e1d1-2e93e058c03mr1631473a91.1.1730347503974; Wed, 30 Oct 2024 21:05:03 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e93db3a023sm428438a91.49.2024.10.30.21.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 21:05:03 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Cleber Rosa , John Snow , Michael Roth , Alexandre Iooss , Konstantin Kostiuk , Stefano Garzarella , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , "Michael S. Tsirkin" , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 07/12] win32: use compiler option instead of attribute gcc_struct Date: Wed, 30 Oct 2024 21:04:21 -0700 Message-Id: <20241031040426.772604-8-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031040426.772604-1-pierrick.bouvier@linaro.org> References: <20241031040426.772604-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This attribute is not recognized by clang, but the associated option is. Signed-off-by: Pierrick Bouvier --- meson.build | 8 ++++---- include/qemu/compiler.h | 7 +------ subprojects/libvhost-user/libvhost-user.h | 6 +----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index d8af08299e0..d0d5dbe1479 100644 --- a/meson.build +++ b/meson.build @@ -330,10 +330,10 @@ elif host_os == 'sunos' elif host_os == 'haiku' qemu_common_flags += ['-DB_USE_POSITIVE_POSIX_ERRORS', '-D_BSD_SOURCE', '-fPIC'] elif host_os == 'windows' - if not compiler.compiles('struct x { int y; } __attribute__((gcc_struct));', - args: '-Werror') - error('Your compiler does not support __attribute__((gcc_struct)) - please use GCC instead of Clang') - endif + # https://gcc.gnu.org/onlinedocs/gcc/x86-Type-Attributes.html + # We use this compilation option instead of relying on gcc_struct attribute + # because clang does not support it (but supports the option). + qemu_common_flags += ['-mno-ms-bitfields'] endif # Choose instruction set (currently x86-only) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index c06954ccb41..d904408e5ed 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -22,12 +22,7 @@ #define QEMU_EXTERN_C extern #endif -#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) -# define QEMU_PACKED __attribute__((gcc_struct, packed)) -#else -# define QEMU_PACKED __attribute__((packed)) -#endif - +#define QEMU_PACKED __attribute__((packed)) #define QEMU_ALIGNED(X) __attribute__((aligned(X))) #ifndef glue diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvhost-user/libvhost-user.h index deb40e77b3f..2ffc58c11b1 100644 --- a/subprojects/libvhost-user/libvhost-user.h +++ b/subprojects/libvhost-user/libvhost-user.h @@ -186,11 +186,7 @@ typedef struct VhostUserShared { unsigned char uuid[UUID_LEN]; } VhostUserShared; -#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) -# define VU_PACKED __attribute__((gcc_struct, packed)) -#else -# define VU_PACKED __attribute__((packed)) -#endif +#define VU_PACKED __attribute__((packed)) typedef struct VhostUserMsg { int request; From patchwork Thu Oct 31 04:04:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 2004509 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=MZtrlJvI; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf9QD316qz1xwK for ; Thu, 31 Oct 2024 15:05:40 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6MQr-0003mg-Gk; Thu, 31 Oct 2024 00:05:13 -0400 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 1t6MQn-0003iA-Dv for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:09 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6MQk-00052o-QF for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:08 -0400 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2e3fca72a41so458988a91.1 for ; Wed, 30 Oct 2024 21:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730347505; x=1730952305; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MazmFmRo30op9YnWOmViRpaEpFEJWTUfVA0x4drzOKE=; b=MZtrlJvIBG4cWcdTt8pd+KKsdh6m/7r0KO91JCsN8EEFlKH+9zUAJpJnRxug0TnLmR wJSMVhs5iv7STZIYrnzzQAvqsF4ilBGISjVVKH2HmRlNmFPdv2g9O+3IIX8DrWl85ovW Qmf6pBrZCzGL9cZ3Hj/1uabpZAWELD8G4IBVSRTqVS9N6Sh+k4Ih9/DDMDf8cxwombeT +hBCNSxed2p09d6bPXyYgKSqWawdcP8YS4WrZnodWA5U78Q8/caajgvtlOFMXj0a1xa1 53bLAMyZS9z9EvYCQMLtQ7hgQ7D++g1CPuKnMh4fJVW+DOZz6cT0JpgYYx3Dchu4NJZm t42A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730347505; x=1730952305; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MazmFmRo30op9YnWOmViRpaEpFEJWTUfVA0x4drzOKE=; b=ltXe29v7fgjdju4osMSJm7OgTplerGx2BxUeZoaXY4DPHVIi2eHmT1pJctlBQkaV4Z AKM3usGZPt7Wkyu5m4O3YKr/R/7F3CeZdx2BGWmjlINFkVXoeQ4FB7fse7huZXIpoQC9 3CmwCsTyY7Gg5NUNf919lYrOmJmmz7ieAwG2hyqZyK9DBM4jSCcAZmhykh6vNeCwCpgR vzb2bXnqiyUbxevG2rMAMbHAP11DeDjgcz2a5306M7vU8OGa9KEs4CXFMFDYLRdHlLej gH9bRrRr1TP7Pd6ooG0k+J2qrgcevDz5FezCD8UROtU8diF0G9K50fXhNH2aOhzBRim0 6KVA== X-Gm-Message-State: AOJu0YzD9tzHjz3OV7maVaktr0hRqinJs3FHWHoL3eHnH7h9hgJReu55 I3h2gKeSOFbX7/AtV4ftqJ8L6XL3jfs/wc8ocgzKhQNDKpjjB62pE74K7eoswwKag8wsa/pUoNN suJTTsA== X-Google-Smtp-Source: AGHT+IHdmSiRISRG5n+ZBrvve1XtDbfjxHdxnqVkOlXZXDyKbVyjzGTs5AJSO6xJnFkwQjww9CZpeg== X-Received: by 2002:a17:90b:1a8e:b0:2e5:e43a:1413 with SMTP id 98e67ed59e1d1-2e93c182879mr2408081a91.9.1730347505119; Wed, 30 Oct 2024 21:05:05 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e93db3a023sm428438a91.49.2024.10.30.21.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 21:05:04 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Cleber Rosa , John Snow , Michael Roth , Alexandre Iooss , Konstantin Kostiuk , Stefano Garzarella , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , "Michael S. Tsirkin" , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 08/12] plugins: enable linking with clang/lld Date: Wed, 30 Oct 2024 21:04:22 -0700 Message-Id: <20241031040426.772604-9-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031040426.772604-1-pierrick.bouvier@linaro.org> References: <20241031040426.772604-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Windows uses a special mechanism to enable plugins to work (DLL delay loading). Option for lld is different than ld. Signed-off-by: Pierrick Bouvier --- meson.build | 4 ++++ contrib/plugins/meson.build | 2 +- plugins/meson.build | 24 ++++++++++++++++++++---- tests/tcg/plugins/meson.build | 3 +-- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index d0d5dbe1479..fe11570b147 100644 --- a/meson.build +++ b/meson.build @@ -334,6 +334,10 @@ elif host_os == 'windows' # We use this compilation option instead of relying on gcc_struct attribute # because clang does not support it (but supports the option). qemu_common_flags += ['-mno-ms-bitfields'] + + if compiler.get_id() == 'clang' and compiler.get_linker_id() != 'ld.lld' + error('On windows, you need to use lld with clang - use msys2 clang64/clangarm64 env') + endif endif # Choose instruction set (currently x86-only) diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build index 63a32c2b4f0..484b9a808c8 100644 --- a/contrib/plugins/meson.build +++ b/contrib/plugins/meson.build @@ -12,7 +12,7 @@ if get_option('plugins') t += shared_module(i, files(i + '.c') + 'win32_linker.c', include_directories: '../../include/qemu', link_depends: [win32_qemu_plugin_api_lib], - link_args: ['-Lplugins', '-lqemu_plugin_api'], + link_args: win32_qemu_plugin_api_link_flags, dependencies: glib) else t += shared_module(i, files(i + '.c'), diff --git a/plugins/meson.build b/plugins/meson.build index 1cc039d29b2..51297582f93 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -11,14 +11,15 @@ if not enable_modules capture: true, command: ['sed', '-ne', 's/^[[:space:]]*\\(qemu_.*\\);/_\\1/p', '@INPUT@']) emulator_link_args += ['-Wl,-exported_symbols_list,plugins/qemu-plugins-ld64.symbols'] + elif host_os == 'windows' and meson.get_compiler('c').get_id() == 'clang' + # LLVM/lld does not support exporting specific symbols. However, it works + # out of the box with dllexport/dllimport attribute we set in the code. else emulator_link_args += ['-Xlinker', '--dynamic-list=' + (meson.project_source_root() / 'plugins/qemu-plugins.symbols')] endif endif if host_os == 'windows' - dlltool = find_program('dlltool', required: true) - # Generate a .lib file for plugins to link against. # First, create a .def file listing all the symbols a plugin should expect to have # available in qemu @@ -27,12 +28,27 @@ if host_os == 'windows' output: 'qemu_plugin_api.def', capture: true, command: ['sed', '-e', '0,/^/s//EXPORTS/; s/[{};]//g', '@INPUT@']) + # then use dlltool to assemble a delaylib. + # The delaylib will have an "imaginary" name (qemu.exe), that is used by the + # linker file we add with plugins (win32_linker.c) to identify that we want + # to find missing symbols in current program. + win32_qemu_plugin_api_link_flags = ['-Lplugins', '-lqemu_plugin_api'] + if meson.get_compiler('c').get_id() == 'clang' + # With LLVM/lld, delaylib is specified at link time (-delayload) + dlltool = find_program('llvm-dlltool', required: true) + dlltool_cmd = [dlltool, '-d', '@INPUT@', '-l', '@OUTPUT@', '-D', 'qemu.exe'] + win32_qemu_plugin_api_link_flags += ['-Wl,-delayload=qemu.exe'] + else + # With gcc/ld, delay lib is built with a specific delay parameter. + dlltool = find_program('dlltool', required: true) + dlltool_cmd = [dlltool, '--input-def', '@INPUT@', + '--output-delaylib', '@OUTPUT@', '--dllname', 'qemu.exe'] + endif win32_qemu_plugin_api_lib = configure_file( input: win32_plugin_def, output: 'libqemu_plugin_api.a', - command: [dlltool, '--input-def', '@INPUT@', - '--output-delaylib', '@OUTPUT@', '--dllname', 'qemu.exe'] + command: dlltool_cmd ) endif specific_ss.add(files( diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build index f847849b1b7..87a17d67bd4 100644 --- a/tests/tcg/plugins/meson.build +++ b/tests/tcg/plugins/meson.build @@ -5,9 +5,8 @@ if get_option('plugins') t += shared_module(i, files(i + '.c') + '../../../contrib/plugins/win32_linker.c', include_directories: '../../../include/qemu', link_depends: [win32_qemu_plugin_api_lib], - link_args: ['-Lplugins', '-lqemu_plugin_api'], + link_args: win32_qemu_plugin_api_link_flags, dependencies: glib) - else t += shared_module(i, files(i + '.c'), include_directories: '../../../include/qemu', From patchwork Thu Oct 31 04:04:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 2004510 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=FPLWlXsE; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf9QG5rxXz1xwK for ; Thu, 31 Oct 2024 15:05:42 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6MQw-0003r5-Fr; Thu, 31 Oct 2024 00:05:18 -0400 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 1t6MQn-0003i8-Dd for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:09 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6MQl-000539-Hq for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:09 -0400 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2e2ad9825a7so409644a91.0 for ; Wed, 30 Oct 2024 21:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730347506; x=1730952306; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5Etq9dXgBLnq7Fjrg4VPpsKmiULD2dA0vZBWi1xVOs4=; b=FPLWlXsEtBdOKQcSXQSIxaHfL6tGgMtdtCjgEDArrybaHV4zvkjTxIQvDd9yVfxLWE Y5PqpSqQ8d7D6Bmeyg8jyVkd/6S+/2lgy7OWM7nFuyQ+vWGUpOvEuKHBlDa9K4lqri4Q v+tmirX4f3hP/SX8XJc/RS0rSOIM/3Enb7kIR/diOy6ZFdaTRf/A2NTHxhNYL7m9OBb7 svSbmjlfh746cy0p0yZ0j1pqX1Yf33AvchfE7JY2nH4aUYhWgCRfIP3JixlWbeOrM6lM VKhtIk93wT6FYwQNc/DYxvQcaDmD8CQHfsUA9ub4Cmq45I6D+Z8d9wWIBDjoK9P6d86o 1gmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730347506; x=1730952306; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5Etq9dXgBLnq7Fjrg4VPpsKmiULD2dA0vZBWi1xVOs4=; b=OKo7a5tT/xpQ1bAmpky8V6+l9HlXlv0F1JpXdHOhyWtkRP8+cEGpiq7f7VQN4fgsKZ N13E5xu1apS5neW8QjgX0CHvHamfbGKgSgikTY9MhXynJet9CFpGmXfGuN2lyZMkMUj7 kjCqORIXAaDt2dbZeENAHCZBQB0DoZ+jGTBdc+ZcdJ5TQLCyw+cj9vY2xz4bxItZ4tbv ggGqd0SXDml4bt7+b1iFex9zhG15uDX4QxYfEqiyifuxJ+R6mlsAH5iHV/GVVO8f0Z7M +4q4j8t8Dr49Aym0Hk/exYhgsGOHzbkYYXPEO+nb1Ywesz0o9kUfvD1hHg3LWcO092UE srMw== X-Gm-Message-State: AOJu0YyBWySKJ+WxED/1D9IXdX5WrXHXJgqqV0NyFe4YoATk8R0gKeAS ksS1TMctLZ2qHrRvX9wfzrs3AxH5a+9iMZjOmByArvSis8C48DgkqKgdyw8rX3Co8fCE0aF9j7Y JNJydCQ== X-Google-Smtp-Source: AGHT+IFoQli6iUGkV26XRQDlHT2bJYFggKWojFg9urvSjvzTYD2+9EIDbSTsWGTEc/u6pjKnwG8pug== X-Received: by 2002:a17:90b:315:b0:2e2:ba35:356c with SMTP id 98e67ed59e1d1-2e8f11dceb8mr18783247a91.39.1730347506141; Wed, 30 Oct 2024 21:05:06 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e93db3a023sm428438a91.49.2024.10.30.21.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 21:05:05 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Cleber Rosa , John Snow , Michael Roth , Alexandre Iooss , Konstantin Kostiuk , Stefano Garzarella , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , "Michael S. Tsirkin" , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 09/12] plugins: add missing export for qemu_plugin_num_vcpus Date: Wed, 30 Oct 2024 21:04:23 -0700 Message-Id: <20241031040426.772604-10-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031040426.772604-1-pierrick.bouvier@linaro.org> References: <20241031040426.772604-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1030.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé --- include/qemu/qemu-plugin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 622c9a02327..0fba36ae028 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -803,6 +803,7 @@ void qemu_plugin_register_atexit_cb(qemu_plugin_id_t id, qemu_plugin_udata_cb_t cb, void *userdata); /* returns how many vcpus were started at this point */ +QEMU_PLUGIN_API int qemu_plugin_num_vcpus(void); /** From patchwork Thu Oct 31 04:04:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 2004513 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=eqhjkCZ5; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf9SG0cshz1xxp for ; Thu, 31 Oct 2024 15:07:26 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6MQy-0003sP-OX; Thu, 31 Oct 2024 00:05:20 -0400 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 1t6MQp-0003kW-43 for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:11 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6MQn-00053e-5A for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:10 -0400 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2e91403950dso392295a91.3 for ; Wed, 30 Oct 2024 21:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730347507; x=1730952307; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2sPdHdQJ35Fr/SOKKnyBguzQdXGmWsCiWtlEfDPVHMQ=; b=eqhjkCZ5x0rnw1R4BkY/zmAK2bN604e2aRg5MdiXurbRxcr/V0iKEsj56O8h+M+5Gb NcqiWa4m6fvfpcYDQG056R1Y1sMt/LPyw6z8TzXXbgsSxIhhA8LHEJjXdZ7WMtxsrkZu P1vkV9LuMwLrX0GA2AHVzUonzjJjFhlDx+a74PjTnJYcXG0hE/R7zsqiUmjTVNksfAIt +iuiCU5Bjmq0Ue7Rit8xVCatW0/IXsQAifXfxNQyuRc+GbKEydBvPL6mUOmLOX04x9d2 q0NiHHtSDexLuJHKILvCeh1rhdf9EZZPGW+yDHT/dwpZt/0hWxsY4QdRTQUIbGtuseh9 gTpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730347507; x=1730952307; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2sPdHdQJ35Fr/SOKKnyBguzQdXGmWsCiWtlEfDPVHMQ=; b=vLvZqAxXbgGW0kZG55O9bElB2tFUc4WpC85XOR0Q5lH8I8+agJ3MDnXN6Bda7czmSF 8ik3xlGkpCVsDcxFwF6WP9BfiyX3f7ny2tB/YH9ZkoPRvrMfnbNPLzeNhSic4fVeiehZ oIQjx9Syk3CEymSwSJXNBef1nRIPhfo9xpWHpV6+c4/tmq+7AksVOWqJZ0M6z413Ks3g VKz9WV20dYtaof9YfyRmRxCafriCNGtrK+kA+vZ0kIwB6oLOlhF9dcCDd17r0NwANLqj IpEZqnU1tGHIy9vol7Vp55VJx7fUygxiJ8Ng6KH2Q8LipGsMwHZpylt5scxHqY3gW4Er d/8g== X-Gm-Message-State: AOJu0YxhvEsAgkJNPkTQzCrYlMG2wiqWUmR2XiXrhcgA6evRGFNpVtZ/ PWG1EV3Czu6Qs8Av+pONai4krkuZnFkawYhMPf/+dcpG4Dq6iqef94m7Rd4ONjHI/9dQg4DLG62 A9+jozQ== X-Google-Smtp-Source: AGHT+IHuNs/tznTYNp/AUVQMJ6NqDV9uYOqGmX0xPvakJbIHYFI2CFPqQ3UO41+4oI0oxgBxhgTN2g== X-Received: by 2002:a17:90a:d481:b0:2e0:d957:1b9d with SMTP id 98e67ed59e1d1-2e8f1071c8dmr21944997a91.13.1730347507133; Wed, 30 Oct 2024 21:05:07 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e93db3a023sm428438a91.49.2024.10.30.21.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 21:05:06 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Cleber Rosa , John Snow , Michael Roth , Alexandre Iooss , Konstantin Kostiuk , Stefano Garzarella , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , "Michael S. Tsirkin" , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 10/12] plugins: detect qemu plugin API symbols from header Date: Wed, 30 Oct 2024 21:04:24 -0700 Message-Id: <20241031040426.772604-11-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031040426.772604-1-pierrick.bouvier@linaro.org> References: <20241031040426.772604-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Instead of using a static file (error prone and hard to keep in sync), we generate it using a script. Note: if a symbol is not exported, we'll now notice it when linking for Windows/MacOS platforms. Signed-off-by: Pierrick Bouvier --- MAINTAINERS | 1 + plugins/meson.build | 12 ++++++--- scripts/qemu-plugin-symbols.py | 45 ++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 3 deletions(-) create mode 100755 scripts/qemu-plugin-symbols.py diff --git a/MAINTAINERS b/MAINTAINERS index f48d9142b8a..d34b6606e95 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3719,6 +3719,7 @@ F: plugins/ F: tests/tcg/plugins/ F: tests/avocado/tcg_plugins.py F: contrib/plugins/ +F: scripts/qemu-plugin-symbols.py AArch64 TCG target M: Richard Henderson diff --git a/plugins/meson.build b/plugins/meson.build index 51297582f93..d60be2a4d6d 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -2,11 +2,17 @@ if not get_option('plugins') subdir_done() endif +qemu_plugin_symbols = configure_file( + input: files('../include/qemu/qemu-plugin.h'), + output: 'qemu-plugin.symbols', + capture: true, + command: [files('../scripts/qemu-plugin-symbols.py'), '@INPUT@']) + # Modules need more symbols than just those in plugins/qemu-plugins.symbols if not enable_modules if host_os == 'darwin' configure_file( - input: files('qemu-plugins.symbols'), + input: qemu_plugin_symbols, output: 'qemu-plugins-ld64.symbols', capture: true, command: ['sed', '-ne', 's/^[[:space:]]*\\(qemu_.*\\);/_\\1/p', '@INPUT@']) @@ -15,7 +21,7 @@ if not enable_modules # LLVM/lld does not support exporting specific symbols. However, it works # out of the box with dllexport/dllimport attribute we set in the code. else - emulator_link_args += ['-Xlinker', '--dynamic-list=' + (meson.project_source_root() / 'plugins/qemu-plugins.symbols')] + emulator_link_args += ['-Xlinker', '--dynamic-list=' + qemu_plugin_symbols.full_path()] endif endif @@ -24,7 +30,7 @@ if host_os == 'windows' # First, create a .def file listing all the symbols a plugin should expect to have # available in qemu win32_plugin_def = configure_file( - input: files('qemu-plugins.symbols'), + input: qemu_plugin_symbols, output: 'qemu_plugin_api.def', capture: true, command: ['sed', '-e', '0,/^/s//EXPORTS/; s/[{};]//g', '@INPUT@']) diff --git a/scripts/qemu-plugin-symbols.py b/scripts/qemu-plugin-symbols.py new file mode 100755 index 00000000000..e285ebb8f9e --- /dev/null +++ b/scripts/qemu-plugin-symbols.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Extract QEMU Plugin API symbols from a header file +# +# Copyright 2024 Linaro Ltd +# +# Author: Pierrick Bouvier +# +# This work is licensed under the terms of the GNU GPL, version 2 or later. +# See the COPYING file in the top-level directory. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import argparse +import re + +def extract_symbols(plugin_header): + with open(plugin_header) as file: + content = file.read() + # Remove QEMU_PLUGIN_API macro definition. + content = content.replace('#define QEMU_PLUGIN_API', '') + expected = content.count('QEMU_PLUGIN_API') + # Find last word between QEMU_PLUGIN_API and (, matching on several lines. + # We use *? non-greedy quantifier. + syms = re.findall(r'QEMU_PLUGIN_API.*?(\w+)\s*\(', content, re.DOTALL) + syms.sort() + # Ensure we found as many symbols as API markers. + assert len(syms) == expected + return syms + +def main() -> None: + parser = argparse.ArgumentParser(description='Extract QEMU plugin symbols') + parser.add_argument('plugin_header', help='Path to QEMU plugin header.') + args = parser.parse_args() + + syms = extract_symbols(args.plugin_header) + + print('{') + for s in syms: + print(" {};".format(s)) + print('};') + +if __name__ == '__main__': + main() From patchwork Thu Oct 31 04:04:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 2004518 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=AMpCfDAk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf9WN007cz1xxp for ; Thu, 31 Oct 2024 15:10:07 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6MQv-0003qy-VN; Thu, 31 Oct 2024 00:05:17 -0400 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 1t6MQp-0003lO-O5 for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:12 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6MQn-00053v-Oy for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:11 -0400 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2e2b549799eso388370a91.3 for ; Wed, 30 Oct 2024 21:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730347508; x=1730952308; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R6PRNouRIX8nn07oym8VUYNLwY1A8W1UJP1nr46hRjQ=; b=AMpCfDAkTEj6oJvuJxwzCViBuUmhDOC63RdXnyVNx/AW1Z2oUH8jJnwvYWyErbKbsp 5700OyiYx8D2UTLbA2HORLl84eIIrkAFvk7dM4BMITfXEGAIeSQAp5Q4guatFvlDCzBV 4V3ywzw0vuET1vibMVvcwmTssI3JjBb5RXXiQOlg4uTbARHYI850fl6EaQu4mvnUnAE4 jteVSWA74D+leYakZcYV6d7q7mxlLYyiioLgTyxycsx6ZW1gsV6xujwR1ZHImk6NIUXi wYffuAcBkWqRY7mU+OcBYpIzfCSrLp48hhdsz1q/CnYEBc/l3RVSv+ZQO1SeSuf7Hji4 evPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730347508; x=1730952308; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R6PRNouRIX8nn07oym8VUYNLwY1A8W1UJP1nr46hRjQ=; b=DZ+uEAVBAFUJqv5XudobKxkPmpHk15QGOtaf82Iy4TnxpaghRontVrYs+deuO7RkJC 0AqaDzPd7hal3rfdmhiBmHCMIScrXCV7d5ssUdQkr//QBcA4+hQip5KLkNWE39C0eJLv AnE/jqCJQXVWXyXddYznfFlfo0I9QmX/2v3XR3sZiiOFXgUm+By46JyQG+68qYOespqc eP8/KAyn60gGqXnalvOUVY0NEK4eJKrHYXP8NvIFWF9C31Ew9SMyNmocbieVeVAat9qs gYrQqeSIoPo3BwbnGPxzctAkk0sVV8U47XciSRMQkJ8UCLt9/fBaV5E+AupUA9OBTssi T8DA== X-Gm-Message-State: AOJu0Yy0EHanhX99ZSodPU4WcDoC6bGR8+hJiX5Yrip/SxEMn+8cAnZ0 sUxDLpSakPk8ISQnmWDfT5lMVEmqKmJIN/QVlf32JTgleE8q2fhB39jOfQxzDsYyrSeqouZTNo4 ZXFWBrg== X-Google-Smtp-Source: AGHT+IFNUlZ9ZCHcHNB3MpmcCxQnAmblYQ8TaSXTg8sk2Me5P+2Lv1cChtmuJHLo7ls8+N42mBewLw== X-Received: by 2002:a17:90b:4f81:b0:2e2:cf63:224c with SMTP id 98e67ed59e1d1-2e8f11d55b4mr17651623a91.35.1730347508125; Wed, 30 Oct 2024 21:05:08 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e93db3a023sm428438a91.49.2024.10.30.21.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 21:05:07 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Cleber Rosa , John Snow , Michael Roth , Alexandre Iooss , Konstantin Kostiuk , Stefano Garzarella , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , "Michael S. Tsirkin" , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 11/12] plugins: eradicate qemu-plugins.symbols static file Date: Wed, 30 Oct 2024 21:04:25 -0700 Message-Id: <20241031040426.772604-12-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031040426.772604-1-pierrick.bouvier@linaro.org> References: <20241031040426.772604-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Pierrick Bouvier --- plugins/qemu-plugins.symbols | 59 ------------------------------------ 1 file changed, 59 deletions(-) delete mode 100644 plugins/qemu-plugins.symbols diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols deleted file mode 100644 index 032661f9ea7..00000000000 --- a/plugins/qemu-plugins.symbols +++ /dev/null @@ -1,59 +0,0 @@ -{ - qemu_plugin_bool_parse; - qemu_plugin_end_code; - qemu_plugin_entry_code; - qemu_plugin_get_hwaddr; - qemu_plugin_get_registers; - qemu_plugin_hwaddr_device_name; - qemu_plugin_hwaddr_is_io; - qemu_plugin_hwaddr_phys_addr; - qemu_plugin_insn_data; - qemu_plugin_insn_disas; - qemu_plugin_insn_haddr; - qemu_plugin_insn_size; - qemu_plugin_insn_symbol; - qemu_plugin_insn_vaddr; - qemu_plugin_mem_get_value; - qemu_plugin_mem_is_big_endian; - qemu_plugin_mem_is_sign_extended; - qemu_plugin_mem_is_store; - qemu_plugin_mem_size_shift; - qemu_plugin_num_vcpus; - qemu_plugin_outs; - qemu_plugin_path_to_binary; - qemu_plugin_read_memory_vaddr; - qemu_plugin_read_register; - qemu_plugin_register_atexit_cb; - qemu_plugin_register_flush_cb; - qemu_plugin_register_vcpu_exit_cb; - qemu_plugin_register_vcpu_idle_cb; - qemu_plugin_register_vcpu_init_cb; - qemu_plugin_register_vcpu_insn_exec_cb; - qemu_plugin_register_vcpu_insn_exec_cond_cb; - qemu_plugin_register_vcpu_insn_exec_inline_per_vcpu; - qemu_plugin_register_vcpu_mem_cb; - qemu_plugin_register_vcpu_mem_inline_per_vcpu; - qemu_plugin_register_vcpu_resume_cb; - qemu_plugin_register_vcpu_syscall_cb; - qemu_plugin_register_vcpu_syscall_ret_cb; - qemu_plugin_register_vcpu_tb_exec_cb; - qemu_plugin_register_vcpu_tb_exec_cond_cb; - qemu_plugin_register_vcpu_tb_exec_inline_per_vcpu; - qemu_plugin_register_vcpu_tb_trans_cb; - qemu_plugin_request_time_control; - qemu_plugin_reset; - qemu_plugin_scoreboard_free; - qemu_plugin_scoreboard_find; - qemu_plugin_scoreboard_new; - qemu_plugin_start_code; - qemu_plugin_tb_get_insn; - qemu_plugin_tb_n_insns; - qemu_plugin_tb_vaddr; - qemu_plugin_u64_add; - qemu_plugin_u64_get; - qemu_plugin_u64_set; - qemu_plugin_u64_sum; - qemu_plugin_uninstall; - qemu_plugin_update_ns; - qemu_plugin_vcpu_for_each; -}; From patchwork Thu Oct 31 04:04:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 2004512 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=MzooNerj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xf9SC2FW8z1xwK for ; Thu, 31 Oct 2024 15:07:23 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6MR1-0003tp-13; Thu, 31 Oct 2024 00:05:23 -0400 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 1t6MQq-0003mk-Ue for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:13 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6MQo-00054S-Rk for qemu-devel@nongnu.org; Thu, 31 Oct 2024 00:05:12 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2e2e2d09decso1245881a91.1 for ; Wed, 30 Oct 2024 21:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730347509; x=1730952309; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GWEffwDMJmqQqCBLwXmQs/G5t8KhBeTNj8bmbTesV98=; b=MzooNerjm+E/rAukrg6fEbUq1DSZU+9dh/YsTMo2A22dnDCg/WtZ+mvAfoUB2m6v4k olz9MzGTlR6QxBGez5mMinalIjowCaWmj36INhSxBPS2VBuQPPAAsiB+0NE7rIo8JjCd h2ACLzzLW7EWRkbNhN0fF/D0Zox/tIOvAlwpXvW6O75Bip0KbmZMg5VMPhl2Vruhen3M ItrTdF+qDvfSkzWNbw+j31TMpfvtoJk7aiJIzEhlT1Vzdu+C9HGDDgzSWoD6dJaBoBed YBmI48nKnr7+KBkohRQVUpovWIcpkroVMNeeeEnVwc1NEhYj8xbM8hMkAmooMKRHQVNt DUgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730347509; x=1730952309; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GWEffwDMJmqQqCBLwXmQs/G5t8KhBeTNj8bmbTesV98=; b=gGfTKRSlxtBDNd/iUNuiM4fNS3T8AwdLfxBKmObce59UBPOmZxcForXRw6hpxXsfok 4MGOyXFhpBvOm2/VdPLt26gA0hZy/CMLXh5ozNSgPy5dDPfPeOAVDOL728UNUmGdXM4/ +SPKcVMkSfm/mU+31QYlnvy9XF6l5yzoVjrxeSncOvtYivPzeOSg9OgV5f6Ow7hS18OW rADB0IowN7QI6rTbf6Ud1+Lisdg+bZ0azAa3h4Ymyo4MWHqdFyjBmQPekLai6djbxSiH wiDxLlikGCgUzo/KBWx8ZLjy4xWTaW83y6khK4zfM838npsiS5QgTEx8LKG5EOX6HqOy KeSw== X-Gm-Message-State: AOJu0YzVi9+PORBv8d+Dmn6wEN5g97SpR3A+M2oLkTUrhnWHZfSO4hjT ijLnfPXieW8p0FL3VWNfL2wMUVFWt5NB96Mt/rXIrqnyiGXihNZFZFgTEtc5RgdWzrZGokiXNwZ I9e0Wxg== X-Google-Smtp-Source: AGHT+IHOoM3tEWzAnGhPN1UKbuZKTnRT34eQEk6fVTfJXxyEDAW6r8rADEtdNbbcSAHYBQSR/nCVhw== X-Received: by 2002:a17:90b:510b:b0:2e2:bb32:73e7 with SMTP id 98e67ed59e1d1-2e93e0df6d2mr1575949a91.15.1730347509245; Wed, 30 Oct 2024 21:05:09 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e93db3a023sm428438a91.49.2024.10.30.21.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 21:05:08 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Cleber Rosa , John Snow , Michael Roth , Alexandre Iooss , Konstantin Kostiuk , Stefano Garzarella , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , "Michael S. Tsirkin" , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 12/12] docs: add information on how to setup build environments Date: Wed, 30 Oct 2024 21:04:26 -0700 Message-Id: <20241031040426.772604-13-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031040426.772604-1-pierrick.bouvier@linaro.org> References: <20241031040426.772604-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102a.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org MacOS and Linux are straightforward, but Windows needs a bit more details. Signed-off-by: Pierrick Bouvier --- docs/about/build-platforms.rst | 4 +- docs/devel/build-system.rst | 100 +++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 1 deletion(-) diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst index 8fd7da140a3..fd1a8cabe36 100644 --- a/docs/about/build-platforms.rst +++ b/docs/about/build-platforms.rst @@ -29,6 +29,9 @@ The `Repology`_ site is a useful resource to identify currently shipped versions of software in various operating systems, though it does not cover all distros listed below. +You can find how to install build dependencies for different systems on the +:ref:`setup-build-env` page. + Supported host architectures ---------------------------- @@ -118,7 +121,6 @@ Optional build dependencies cross compilation using ``docker`` or ``podman``, or to use pre-built binaries distributed with QEMU. - Windows ------- diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst index d42045a2325..fa5601fed82 100644 --- a/docs/devel/build-system.rst +++ b/docs/devel/build-system.rst @@ -595,3 +595,103 @@ Built by Makefile: meson.build. The rules are produced from Meson's JSON description of tests (obtained with "meson introspect --tests") through the script scripts/mtest2make.py. + +.. _setup-build-env: + +Setup build environment +======================= + +Linux +----- + +Fedora +++++++ + +:: + + sudo dnf update && sudo dnf builddep qemu + +Debian/Ubuntu ++++++++++++++ + +You first need to enable `Sources List `_. +Then, use apt to install dependencies: + +:: + + sudo apt update && sudo apt build-dep qemu + +MacOS +----- + +You first need to install `Homebrew `_. Then, use it to +install dependencies: + +:: + + brew update && brew install $(brew deps --include-build qemu) + +Windows +------- + +You first need to install `MSYS2 `_. +MSYS2 offers `different environments `_. +x86_64 environments are based on GCC, while aarch64 is based on Clang. + +We recommend to use UCRT64 for windows-x86_64 and CLANGARM64 for windows-aarch64 +(only available on windows-aarch64 hosts). + +Then, you can open a windows shell, and enter msys2 env using: + +:: + + c:/msys64/msys2_shell.cmd -defterm -here -no-start -ucrt64 + # Replace -ucrt64 by -clangarm64 or -mingw64 for other environments. + +MSYS2 package manager does not offer a built-in way to install build +dependencies. You can start with this list of packages using pacman: + +Note: Dependencies need to be installed again if you use a different MSYS2 +environment. + +:: + + # update MSYS2 itself, you need to reopen your shell at the end. + pacman -Syu + pacman -S \ + base-devel binutils bison diffutils flex git grep make sed \ + ${MINGW_PACKAGE_PREFIX}-toolchain \ + ${MINGW_PACKAGE_PREFIX}-glib2 \ + ${MINGW_PACKAGE_PREFIX}-gtk3 \ + ${MINGW_PACKAGE_PREFIX}-libnfs \ + ${MINGW_PACKAGE_PREFIX}-libssh \ + ${MINGW_PACKAGE_PREFIX}-ninja \ + ${MINGW_PACKAGE_PREFIX}-pixman \ + ${MINGW_PACKAGE_PREFIX}-pkgconf \ + ${MINGW_PACKAGE_PREFIX}-python \ + ${MINGW_PACKAGE_PREFIX}-SDL2 \ + ${MINGW_PACKAGE_PREFIX}-zstd + +If you want to install all dependencies, it's possible to use recipe used to +build QEMU in MSYS2 itself. + +:: + + pacman -S wget + wget https://raw.githubusercontent.com/msys2/MINGW-packages/refs/heads/master/mingw-w64-qemu/PKGBUILD + # Some packages may be missing for your environment, installation will still + # be done though. + makepkg -s PKGBUILD || true + +Build on windows-aarch64 +++++++++++++++++++++++++ + +When trying to cross compile meson for x86_64 using UCRT64 or MINGW64 env, +configure will run into an error because the cpu detected is not correct. + +Meson detects x86_64 processes emulated, so you need to manually set the cpu, +and force a cross compilation (with empty prefix). + +:: + + ./configure --cpu=x86_64 --cross-prefix=