From nobody Mon Jun 8 09:51:26 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520068; cv=none; d=zohomail.com; s=zohoarc; b=i76Es6mkVy+s5YMrZ34gChHeAegvW6EJ0bu8ns/WYQNtbdO9cIE0o1UODBj2OoIz9rsSokNv5+RwJAKf291Q/fZSKRHEEOSAXfDk6npQFVIpGgQ2CbqjFoNhFtrx1GhEVoO0ssldTFKV7DQYEAtzBkCt0m1uBZQS40OxiaV8ND4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520068; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5tjvain+huF1mu/Cio1vuPKXHmlHFJ3xapE/A4m350M=; b=F6Vo6tbjiA0DsZUTOtdRJmgC+ESr08kQVomwcZJ4kAqY/eEMDBam5UNAtDwJQTvqvCj0x+hbbmWeDeBftv5+3fC08r2XnXcZ9CwMjafJ4WIPranI1PSR9r7EEp9fL2XHtW0Hq7aGyxAEoXU7C2lVGLsnU4x3FGb+Ttk2uJR3K0c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520068245743.3481812921096; Wed, 3 Jun 2026 13:54:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsae-0000XU-Rj; Wed, 03 Jun 2026 16:53:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZR-0007xi-Ao for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:13 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZL-0004Bq-Vm for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:10 -0400 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653K0Jtl1740892 for ; Wed, 3 Jun 2026 20:52:03 GMT Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejdq7uybb-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:03 +0000 (GMT) Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-304f23c55b2so5686023eec.0 for ; Wed, 03 Jun 2026 13:52:03 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=5tjvain+huF 1mu/Cio1vuPKXHmlHFJ3xapE/A4m350M=; b=H/dyXbKxQUtrVGDiKNLArZymR0H CDl/exX8aNhhAqM7P7kbll2tKdaxMS26xhoUQIC++UYPDfEFwJ8e/YZ6I7pYA9qS xoO9MWqAbfpUEpXGNffI/o2k08FNggJuxwYkGHcy3AIuIjuqdBIFJ1/Wm1oV8hm5 lh5tKhfBmZ80p+p/2KfpSKhhr4UqeEdoFoIwJq7nPEYKZzw1Tave3KP3YLh39aNO QfY2BKpjdg/40H9Ry/LVdaCt363iT7389DtgE/ItcMD2FofLkMHI2ueQPD0hblxf rt9Zlbi9XlmXnyOfGnkwcctcDWW5VJf0cqllIMpJIkFjMji84xyklsYLtIw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519923; x=1781124723; 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=5tjvain+huF1mu/Cio1vuPKXHmlHFJ3xapE/A4m350M=; b=KkcuGnrOG4mzjLqZJJiPiYmKOBr1UH25pY0onB3eB2tMwygK6MsurPJZrhTm+Bt4RC xSeb/j59OJsk7hDsjaG5kM4N235qeM8ZtxVkXU6yUvFv3Ch24s7G6m8dn5lFUlqOPMaW +9GVjXJPUj7LQDrpK2+5Aj+cQnCaOjqLA3wYhcvOrxnCy/Jad9Ff3UBSIAR3rzR7ib6w ZNZbyenpdqt6IKjromR3gp+BOv/PU6nW1qL+nW+Bzcxt8aJLi7Tqe3aw3ur/utTGTxYE 0k9AzLjkHn2AFWUPEVqIt79xjdAhif9RbSRO+K7M7h9OUixct0uEowwh8aLZmFJLKY8T 89Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519923; x=1781124723; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5tjvain+huF1mu/Cio1vuPKXHmlHFJ3xapE/A4m350M=; b=pNE02Iq1Ap5exTsxUiEYiLIoC4dyCSSUgKJ7TeV5KETdYrrcbvtXBe82pcldDg9uk7 TwVap+SKr1bzLhwg1VK2sP0rSYGswx2rCN2SyOC7hISLNO+UylTkNu/23ilcWgapsXM9 P8EYTieIDGJNfSLSsb0bgRWMeKyV2FByZzQ2/+iDEVFmIdpbGfa8R+n6CeuYJaLy1XGV gwUY/BUV7W/lKWFX1xg4BjDO/XNzxBfepJTkl2KYcARsEPmpv1hBgz/q8aB+BYuLy14m PAcSDMK4LqWGAvfDHaBL/3L3Aehp780Uq+NmF1/n88fi3VRIZ6RMtZeARnRLK9194gPB uU7g== X-Gm-Message-State: AOJu0YyUn5VHHQpfOStE29SVLKvGEE+fJDuKzLoskcrcgl0QegjpKP3G 92gBe/FrKb/PFE4SVC7Ji5oMwATBumfpHkaqtZqbT6/RyAOdNOqYZALgJGWx0WVTLv4K34UX4/l lzNGqgTIE+VhxCUFaHiGapfAncUv0C6bOvNgvUgwoxpAZif2wXt5h1OKbtH1RJq6LaFqF X-Gm-Gg: Acq92OFfQbuAF0nEBOwPgXX6uf02q8mpLQyvgnEunqjSJY5/sQJgeBJVbaipkHb5P4T vMntim3gzYhAS7lTTbo7JX/Aux+irt20VgUDPihqoYADWRms2Ucolxs8FILG+NE2jlknij+b0Ek mczUxElOK16BPIQwavpElbd37okgXC28zFYaemkM5m9mvf6nm5OUBAL/QCM0xn/rmZt/zGbT9rl RRR/rD1iwFMMNYnhwaPSduqTiqWyMhjkyXG1r3Z85KpGZWzWlYYHoGbgo2szXI46qJAH5mk9iuc l30mO9MaorhX5s4cgEGpGwnSBpmeDZupoqWJb/I+Hax09xJHv02T3YxzMJz+edTDZDXKPFghI2K 4JVsbq8/TpNvDT/oNADH/Ynaiirtcs7FLHUSEMmxo+KXU6U6dgzd+WvOjQWkCwyOfkeed6C9w0B YYNsfqG+VYD1lwpDSk X-Received: by 2002:a05:7301:7c0c:b0:304:8870:2ac5 with SMTP id 5a478bee46e88-3074fa3c1a4mr2545779eec.6.1780519923078; Wed, 03 Jun 2026 13:52:03 -0700 (PDT) X-Received: by 2002:a05:7301:7c0c:b0:304:8870:2ac5 with SMTP id 5a478bee46e88-3074fa3c1a4mr2545771eec.6.1780519922609; Wed, 03 Jun 2026 13:52:02 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 01/25] plugins: bump version Date: Wed, 3 Jun 2026 13:51:28 -0700 Message-ID: <20260603205152.1440291-2-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX0uymXAOEIeBN K+fH2exwphFw2iwrHTUuhAwcCm4eR0D8hvrYXcMW4Nmo2D5/lHQHn1nXImtHKKevImeha59Jel6 EstU13SlOH5JoMS31n4R1b0golNFJeIEtruNycE3aE/FeydzQeugS8ft3paz602tOt8ZwDFKQzW VxATju0yYKRJ/aWinYeZ4q7n/n+C70EmOJKN1nVN0CYQOTDZeSwnzwIeBzrnGf9TJHFOtkLloqC 74b+EEuoenAv1N9WI8j1H2UFvLoZUr8mqub+YbGX0nRFcFdGpKHcdGzzWopYS76DcOH2rnRCcdz VE4oz2VCnTcf6CNVGDvx1FhMUZPmU51FTWtzQ7hBIe2vjdfci4plHQbKHUjfGG73MrZDBaLPkQy btf2p3Zpzh4nsovu6A35b22p2kEftGVVrHA5rV1Z4QbX+JWx90IcmObwZ2lbQYlCOO4bX4qLl37 Sp6loQJs7KC4leqgpsg== X-Proofpoint-ORIG-GUID: PuaKPI77blYAIqtxWc8M79Q5YpDjmuqN X-Proofpoint-GUID: PuaKPI77blYAIqtxWc8M79Q5YpDjmuqN X-Authority-Analysis: v=2.4 cv=ccniaHDM c=1 sm=1 tr=0 ts=6a2093f3 cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=A7FZhrvmqJkW37y3txMA:9 a=bBxd6f-gb0O0v-kibOvt:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520069421154100 Content-Type: text/plain; charset="utf-8" Next commits will be breaking changes, so bump min version and version accordingly. Signed-off-by: Pierrick Bouvier Reviewed-by: Manos Pitsidianakis --- include/plugins/qemu-plugin.h | 6 +++++- plugins/plugin.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 4eb1d2cd85c..435a14f5a00 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -80,11 +80,15 @@ typedef uint64_t qemu_plugin_id_t; * - added disconinuity callback API (for interrupts, exceptions, host cal= ls) * - added syscall filter callback API, which allows skipping syscalls and * setting custom syscall return values + * + * version 7: + * - add userdata to all plugin callbacks, allowing maintenance of state + * externally, and easing interfacing with other languages. */ =20 extern QEMU_PLUGIN_EXPORT int qemu_plugin_version; =20 -#define QEMU_PLUGIN_VERSION 6 +#define QEMU_PLUGIN_VERSION 7 =20 /** * struct qemu_info_t - system information for plugins diff --git a/plugins/plugin.h b/plugins/plugin.h index 6fbc443b96c..9179da43851 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -16,7 +16,7 @@ #include "qemu/queue.h" #include "qemu/qht.h" =20 -#define QEMU_PLUGIN_MIN_VERSION 2 +#define QEMU_PLUGIN_MIN_VERSION 7 =20 /* global state */ struct qemu_plugin_state { --=20 2.43.0 From nobody Mon Jun 8 09:51:26 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520069; cv=none; d=zohomail.com; s=zohoarc; b=hASt6QwHuhiYbN3eYUX/yHRLHPIrRn+moHNWlPxnGerE8rLHim2PBpt68FnQ2ZA9cY3kmeG6pKPEkRYflcs0jl3XER3DMBBBQ5J5PjCKWt+nsF/tI6Rgul0o1Re/bjbp2M+FS9Xpy6QDihasWvwQS9hsBt9luaFuD96O3iI5clU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520069; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4vJKa5FfzO6wDkm27O18xdmld0GrhQ8bYsHnUHwAZVQ=; b=eeQPikVET9g5JXlJpOK8D8sw9Dp08WdyPyfRf0xlZcM0YPTmGa4HtOIxtNT8tkaXqNZwW/EKCwh522k4BfUyHr0rkxDVnwdEoIgUFmEembF0fXvwocpwXA3HJ/AsOpwhBiWGLSWUTb/73ASKfgE5apwH+i2kvtv2Hh5EGwfxiTU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520069608743.8136224429477; Wed, 3 Jun 2026 13:54:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsZf-00083I-He; Wed, 03 Jun 2026 16:52:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZP-0007x5-F1 for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:12 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZL-0004C0-OZ for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:09 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653HA3mf2651282 for ; Wed, 3 Jun 2026 20:52:05 GMT Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejre9gvfn-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:05 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-3074d4102a9so756467eec.0 for ; Wed, 03 Jun 2026 13:52:04 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=4vJKa5FfzO6 wDkm27O18xdmld0GrhQ8bYsHnUHwAZVQ=; b=WeUefxmFIjgH4EBsxCsbQUIpUuG KMM5z0AYkg5/87DyqXv8Hl9OtUjJEMJ4REdlJ8UPQLxSb4AxOvgPWKnMcr6/jBtn UocEghCXefI2Qq1ZpJ3cVRVvpDeOwfn4rY+NfypSfFfejPI13TY0fF0RabGtPG7A eV9gUmXoY03wtPep/24mA59pRTEsPYpZGttzY2c9vKRjIWLWyCeqF8AtV6s0ryQC YUJVojQJMUoI3IbqWy9x7iDQjCvhK010p+lBzLRka8kUZjlSpWIaBhpsvtsD5XNN gWYJdd4DUQUW4kCZZ23yqJtw01m0bSdJTzYfBALPNPKD8RlqAutVGFcSQFw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519924; x=1781124724; 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=4vJKa5FfzO6wDkm27O18xdmld0GrhQ8bYsHnUHwAZVQ=; b=Qei4fCt1MmR8f1gP74UOVX1Ah+SuNXnlkmNfixU7KjE9BqZBJhwiq+VutCfrPWK2PC cBXq/wLkjafvFQZAweZe+Z1vYZ7hD6D7JgVUHcHMAr+U0eua4AP/aWw+xEsML7gNi9ZT e34AkQfgP1RpFzy2GDzcCmkfIzS4Y60pC6+6cvrDdYyPpWJs2j9Q4/NQBt0cis86jiNp Sl0Zop2/07kDxNnDg0Dwh7tSWKpTTWklFDmb6sINV6UJcO/BuEHKLzB1GeaEB1VzPa9v AlAMkLJVe4OpxISq6vqamy2Ksa11TVlUj0b2uwSj0BiKk4ixzX56APcqMtm99/ynhA6i XIvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519924; x=1781124724; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4vJKa5FfzO6wDkm27O18xdmld0GrhQ8bYsHnUHwAZVQ=; b=BqN2RantS7LhcutBrfbteKCCme5SGFsiWnY43WgtI2F+UecXpzxLgXzQ2yojFBQ29C 3wiCkacIB+MBtiT6vwC8ZaJASfLnNSS7F2ajmbG0hNOQx+KkmE7ISxVjVVTVvCk4QEnC RKaOTASQ7feNOr6qhtxpxSG7Fp6zX1UsU4Vw20tlDKOjLnpiH6oFgoc4dJHhkQ4SBeAC RhTgf1Ha6jL0IEOUhPnTinZxRHLjnPZiL5M11wyTox6WyRBgOTD4Ce84vFdxyZ/O7ruh 8IJcll3qAGJ8TesONb7eDTOytwPJpE9N5li1MZav/6iqDGmrzpimuDgFG+CVhE78o+fG I1Tg== X-Gm-Message-State: AOJu0Yza39LurVO/wTRU1PBZGa2m1uFMhnU6GQb6kVdcl/OiAvqJuROo JLzOuyoVYMyaTB90IBMvQVK15YJmyszZjOd12O2RO4JeHLX7Erqr78+Ny4glbCuWdMg9Mq53rwe y66uSJ7NQe9a5HXn7L1kfyDSPSkmmt2Ljk+oHHCpWWpSbhm1evB2Ofl1MoP2C6REwNvHx X-Gm-Gg: Acq92OGnWbFEKfRLFOXFQygtRXf/NWnIxdnM54ssFOfIr+sawZ8x58tk1dwINV2LtG4 YYsF4cf3pCHgbf2HZ5sSiT3LjOs165eibr5+mw2rZGGgRQszCi3ubGMu6MlDWHWUMG4Q1s8ied8 mH98sC/JjGah0ziSnf9EY751u04xxt++wJNYvKOvFVC6zgXlCZuFwLXsCl0iAeGOUuGeo5PzHJO Nb831kj1lW0vONmmxUO9Js1vlqgbAkB0dlAy+5/j9+6C197kWy1dN2wpd2UztgY/AxJA4ND51TN u8rFa4XM7W9FCdECKXjpBevdAdQaZo039rGB94AyHvlzxyCU7MPYZZ0IKaMSguWW1kOKQd3Phs0 DqJnFUT7R4odeNU2GbPJ+hWgujCkWR3IcbXpR9ilb5ssQQXLyKG/A/W6W8OEmgmuKIzVll98AGZ kCtvrPTh3gwkqV6otW X-Received: by 2002:a05:7300:a498:b0:2f5:5dd3:1fd8 with SMTP id 5a478bee46e88-3074fa7ddcdmr2878859eec.8.1780519923978; Wed, 03 Jun 2026 13:52:03 -0700 (PDT) X-Received: by 2002:a05:7300:a498:b0:2f5:5dd3:1fd8 with SMTP id 5a478bee46e88-3074fa7ddcdmr2878837eec.8.1780519923334; Wed, 03 Jun 2026 13:52:03 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 02/25] plugins: add userdata for qemu_plugin_{uninstall, reset} Date: Wed, 3 Jun 2026 13:51:29 -0700 Message-ID: <20260603205152.1440291-3-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: 3BKg9wWvKB8bAQREkolwaqVbK3-iVaa_ X-Proofpoint-GUID: 3BKg9wWvKB8bAQREkolwaqVbK3-iVaa_ X-Authority-Analysis: v=2.4 cv=KoF9H2WN c=1 sm=1 tr=0 ts=6a2093f5 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=_u34yJfUH-Co13bc16MA:9 a=O8hF6Hzn-FEA:10 a=6Ab_bkdmUrQuMsNx7PHu:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfXzAOuHXU8NUPN ryOzV51esEPMJhu5YoDOPpKXO3AOW02M1lg1VYr8xQLI8PtcxYDuxC5kKHJOvD2dnhe4POPNYgK yLnR/aVHL0kbSTiLZCZYpv8OE3bOD0oL9xwhYB+mPIeX8Ol8AjsmRJtVx2KM6JALpUAtOVW8FIo gw8OtR1kcxKYS6KDlBzlJXPg0XLvj8nssK4yRb3tSHtxG+SKZJsamlLEsERF3iFH6zhF89sWjLp HIjVWkqPJbMJZNlhVYvzqZgeq+lL/j54+WFfaoQvQzZUfkv2bzxWYPgEXenFMXkzBCT3Q2POET/ vDRW3B+CNO+EVAffKzEKeEMZyzlwmrhmQwXZcabH0M55VE4PTesFwRFjRwKSMa/dcParf2V7F5l +VE9Er8E9Wggf9KGcl5+KUKss7j9fZQq7arRrA1F9yOImP/jpR0EjvD8u3if2nKXKipkj8FzzYQ N84qu/5mS3UUIPjOvSQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 suspectscore=0 priorityscore=1501 adultscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520071052158500 Content-Type: text/plain; charset="utf-8" We do both at the same time because they internally use the same implementation. Signed-off-by: Pierrick Bouvier Reviewed-by: Manos Pitsidianakis --- contrib/plugins/lockstep.c | 10 +++++----- include/plugins/qemu-plugin.h | 8 ++++++-- plugins/api.c | 10 ++++++---- plugins/loader.c | 13 ++++++++----- plugins/plugin.h | 3 ++- tests/tcg/plugins/reset.c | 8 ++++---- 6 files changed, 31 insertions(+), 21 deletions(-) diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index 62981d4e098..36b003ead2d 100644 --- a/contrib/plugins/lockstep.c +++ b/contrib/plugins/lockstep.c @@ -77,7 +77,7 @@ static char *path_to_unlink; =20 static bool verbose; =20 -static void plugin_cleanup(qemu_plugin_id_t id) +static void plugin_cleanup(qemu_plugin_id_t id, void *userdata) { /* Free our block data */ g_slist_free_full(blocks, &g_free); @@ -98,7 +98,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) g_string_append_printf(out, "Executed ~%ld instructions\n", insn_count= ); qemu_plugin_outs(out->str); =20 - plugin_cleanup(id); + plugin_cleanup(id, NULL); } =20 /* @@ -189,7 +189,7 @@ static void report_divergance(ExecState *us, ExecState = *them) } qemu_plugin_outs(out->str); qemu_plugin_outs("giving up\n"); - qemu_plugin_uninstall(our_id, plugin_cleanup); + qemu_plugin_uninstall(our_id, plugin_cleanup, NULL); } } =20 @@ -212,7 +212,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *= udata) qemu_plugin_outs(bytes < 0 ? "problem writing to socket" : "wrote less than expected to socket"); - qemu_plugin_uninstall(our_id, plugin_cleanup); + qemu_plugin_uninstall(our_id, plugin_cleanup, NULL); return; } =20 @@ -225,7 +225,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *= udata) qemu_plugin_outs(bytes < 0 ? "problem reading from socket" : "read less than expected"); - qemu_plugin_uninstall(our_id, plugin_cleanup); + qemu_plugin_uninstall(our_id, plugin_cleanup, NULL); return; } =20 diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 435a14f5a00..11213c2ca3f 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -221,6 +221,7 @@ typedef void (*qemu_plugin_vcpu_discon_cb_t)(qemu_plugi= n_id_t id, * qemu_plugin_uninstall() - Uninstall a plugin * @id: this plugin's opaque ID * @cb: callback to be called once the plugin has been removed + * @userdata: any plugin data to pass to the @cb * * Do NOT assume that the plugin has been uninstalled once this function * returns. Plugins are uninstalled asynchronously, and therefore the given @@ -229,12 +230,14 @@ typedef void (*qemu_plugin_vcpu_discon_cb_t)(qemu_plu= gin_id_t id, * Note: Calling this function from qemu_plugin_install() is a bug. */ QEMU_PLUGIN_API -void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb= ); +void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_plugin_udata_cb_t cb, + void *userdata); =20 /** * qemu_plugin_reset() - Reset a plugin * @id: this plugin's opaque ID * @cb: callback to be called once the plugin has been reset + * @userdata: any plugin data to pass to the @cb * * Unregisters all callbacks for the plugin given by @id. * @@ -243,7 +246,8 @@ void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_pl= ugin_simple_cb_t cb); * callbacks until @cb is called. */ QEMU_PLUGIN_API -void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb); +void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin_udata_cb_t cb, + void *userdata); =20 /** * qemu_plugin_register_vcpu_init_cb() - register a vCPU initialization ca= llback diff --git a/plugins/api.c b/plugins/api.c index 2d5fe9327f7..91c9a24a6b2 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -51,14 +51,16 @@ =20 /* Uninstall and Reset handlers */ =20 -void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb) +void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_plugin_udata_cb_t cb, + void *userdata) { - plugin_reset_uninstall(id, cb, false); + plugin_reset_uninstall(id, cb, userdata, false); } =20 -void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb) +void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin_udata_cb_t cb, + void *userdata) { - plugin_reset_uninstall(id, cb, true); + plugin_reset_uninstall(id, cb, userdata, true); } =20 /* diff --git a/plugins/loader.c b/plugins/loader.c index 0dbe7bea263..0d587c344c4 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -253,7 +253,7 @@ static int plugin_load(struct qemu_plugin_desc *desc, c= onst qemu_info_t *info, E * call a full uninstall if the plugin did not yet call it. */ if (!ctx->uninstalling) { - plugin_reset_uninstall(ctx->id, NULL, false); + plugin_reset_uninstall(ctx->id, NULL, NULL, false); } } =20 @@ -314,7 +314,8 @@ int qemu_plugin_load_list(QemuPluginList *head, Error *= *errp) =20 struct qemu_plugin_reset_data { struct qemu_plugin_ctx *ctx; - qemu_plugin_simple_cb_t cb; + qemu_plugin_udata_cb_t cb; + void *userdata; bool reset; }; =20 @@ -338,7 +339,7 @@ static void plugin_reset_destroy__locked(struct qemu_pl= ugin_reset_data *data) if (data->reset) { g_assert(ctx->resetting); if (data->cb) { - data->cb(ctx->id); + data->cb(ctx->id, data->userdata); } ctx->resetting =3D false; g_free(data); @@ -357,7 +358,7 @@ static void plugin_reset_destroy__locked(struct qemu_pl= ugin_reset_data *data) g_assert(success); QTAILQ_REMOVE(&plugin.ctxs, ctx, entry); if (data->cb) { - data->cb(ctx->id); + data->cb(ctx->id, data->userdata); } if (!g_module_close(ctx->handle)) { warn_report("%s: %s", __func__, g_module_error()); @@ -383,7 +384,8 @@ static void plugin_flush_destroy(CPUState *cpu, run_on_= cpu_data arg) } =20 void plugin_reset_uninstall(qemu_plugin_id_t id, - qemu_plugin_simple_cb_t cb, + qemu_plugin_udata_cb_t cb, + void *userdata, bool reset) { struct qemu_plugin_reset_data *data; @@ -401,6 +403,7 @@ void plugin_reset_uninstall(qemu_plugin_id_t id, data =3D g_new(struct qemu_plugin_reset_data, 1); data->ctx =3D ctx; data->cb =3D cb; + data->userdata =3D userdata; data->reset =3D reset; /* * Only flush the code cache if the vCPUs have been created. If so, diff --git a/plugins/plugin.h b/plugins/plugin.h index 9179da43851..c901016b8c1 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -76,7 +76,8 @@ void plugin_register_inline_op_on_entry(GArray **arr, uint64_t imm); =20 void plugin_reset_uninstall(qemu_plugin_id_t id, - qemu_plugin_simple_cb_t cb, + qemu_plugin_udata_cb_t cb, + void *userdata, bool reset); =20 void plugin_register_cb(qemu_plugin_id_t id, enum qemu_plugin_event ev, diff --git a/tests/tcg/plugins/reset.c b/tests/tcg/plugins/reset.c index 1be8be2a4b2..6ea675b8095 100644 --- a/tests/tcg/plugins/reset.c +++ b/tests/tcg/plugins/reset.c @@ -14,7 +14,7 @@ static qemu_plugin_id_t plugin_id; static bool was_reset; static bool was_uninstalled; =20 -static void after_uninstall(qemu_plugin_id_t id) +static void after_uninstall(qemu_plugin_id_t id, void *userdata) { g_assert(was_reset && !was_uninstalled); qemu_plugin_outs("uninstall done\n"); @@ -24,7 +24,7 @@ static void after_uninstall(qemu_plugin_id_t id) static void tb_exec_after_reset(unsigned int vcpu_index, void *userdata) { g_assert(was_reset && !was_uninstalled); - qemu_plugin_uninstall(plugin_id, after_uninstall); + qemu_plugin_uninstall(plugin_id, after_uninstall, NULL); } =20 static void tb_trans_after_reset(qemu_plugin_id_t id, struct qemu_plugin_t= b *tb) @@ -34,7 +34,7 @@ static void tb_trans_after_reset(qemu_plugin_id_t id, str= uct qemu_plugin_tb *tb) QEMU_PLUGIN_CB_NO_REGS, NULL); } =20 -static void after_reset(qemu_plugin_id_t id) +static void after_reset(qemu_plugin_id_t id, void *userdata) { g_assert(!was_reset && !was_uninstalled); qemu_plugin_outs("reset done\n"); @@ -45,7 +45,7 @@ static void after_reset(qemu_plugin_id_t id) static void tb_exec_before_reset(unsigned int vcpu_index, void *userdata) { g_assert(!was_reset && !was_uninstalled); - qemu_plugin_reset(plugin_id, after_reset); + qemu_plugin_reset(plugin_id, after_reset, NULL); } =20 static void tb_trans_before_reset(qemu_plugin_id_t id, struct qemu_plugin_= tb *tb) --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520047; cv=none; d=zohomail.com; s=zohoarc; b=MUiUBQ1J/NVQ/yr0Tq0Uf4J01tY8bWipiV6Gx+sV7AB2Q8GbzNj04VjEn/hITxLl1PX0NF7DBFIlFMQzMD8K8aAyilHtuELF3d7KOgx/gfxJSpqk1Tky2CTkNOruQKGejcthwpkwqffcM1AfiRGQCN3l9Rdal4nrawIlwVQ3Fds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520047; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BTwKFhN3UpBypCiBHtCHvMi3SUawT+1H4PhMWJeUahw=; b=b8W3tHEiqEJqMiiKuEw4mDrr6AGO75qE4vysZ++T3pLM+xIyT9kBD++7ARtdJn87rovMj9lR2/iYkAwGisTTwzEoRsFvnbvC7ffdMlnM0aUNgSrCFhlNMA3H3zITRVX/MeW9r/ahricIJWTAGX5iaLz2O56jOGuFNPRYLatu7vU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520047367612.0849029288645; Wed, 3 Jun 2026 13:54:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsZf-00082d-7T; Wed, 03 Jun 2026 16:52:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZR-0007xd-8Q for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:13 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZL-0004CO-W1 for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:10 -0400 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653Gj8gE2260648 for ; Wed, 3 Jun 2026 20:52:06 GMT Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejr2mh0tx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:06 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-3075fa5a407so1200065eec.1 for ; Wed, 03 Jun 2026 13:52:06 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=BTwKFhN3UpB ypCiBHtCHvMi3SUawT+1H4PhMWJeUahw=; b=kDtwznsPWoq4DExxYPhQ929o1E7 8qTnUjQQ2k468c22FJCtYYchCI+y8Nc/PesuZ2Ljza2S9My3KsSgzvHgZCmiR+jD 0lBsBzanbbF7PgZW69WYmEd82cMe+fzZj0j6HD6xii97u3TUApxhQVWoZjhHTfl0 WuZtcwzdUOQ/fqBmACUIxq2q63k8v0UzT1WDGP84GZ5ezdg8bM62Y5yTPcOYV4G+ /vKJpZnMDyHaP0He/q5mPVh6CFnJfeSR62OBts+MIvcNhCkmfeVXxQTaOkiwZBWP sP/jHTHbcJdGYpTsMxUReF59a3M0jArWaCxud4e4GHT6W0i1Cdrh0qf7GNA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519926; x=1781124726; 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=BTwKFhN3UpBypCiBHtCHvMi3SUawT+1H4PhMWJeUahw=; b=kmZ/SDwu4iBjVcSfcmdcHzjEG5lwt/rgcu39mSLbge/9nNAComWK7OJlfTmV7D8a6k HiKAGOqL38oNqJyPhDuQMi2DeK7y1qRUQ9lacX6aSrVxI1Hr/NqRYgICmjuOtbu/VTqc 1hYjaWdLHxB/EfXIL+Gd4fC7s+2aiA3kuLIXinpY6e1eMcu8voAeitwsldzu6kiLksz0 kTJcWCeH5bnOE+HQPyBOKFvC4tX8FTBQHPeiI5DOSijlm4VrXbUjyNSEEu/hWa+piI2s R5qvIz4u+oGG5AmD2Ax/GpZi2fREa0jL2IsFQ31K+O69QMvfFcqK03v/Nj8dh8VBwT3c P+6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519926; x=1781124726; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BTwKFhN3UpBypCiBHtCHvMi3SUawT+1H4PhMWJeUahw=; b=Kx1M9DmrdvO2z3coIE7Mb+hDSACKPdfrE0jDzExqaXpkaFGPB1Q3d3sJcbgTwiZoIi c8EIfrMcJFWwBabFnfD2Zf0g2W8Qksth8vZiw00veM260VAC1WsUCR7NTKUW2jkSawh9 kFsexEKk4waJGdwpuIjnXk5we2gGTPDpB52DgOz+RTnMWbC+MKgERKa5gbQs9anZaRzV V6pGc/r2xiXG1H6rLL7pJla5cjd+c8T13ma97wN48xY2ssa6LIFiEIKGd+ayy+AztlMG Z0PfqEebQo6u/wBP7Th8BzQLzxiGH//ce9Y5SNVMkkPjD577aybtuWolg0HhaTO7fx1y VKBQ== X-Gm-Message-State: AOJu0Yz8iWmuB+kh/qKAyLWIrFLR3i+RoV/WsIuPVPonOWtvl9+Tk6lV 7t2ktjh5F1p1EsSdMsTJuGsNNBMreyz9+aD1nsV7ursxgpW/mLojvm+T1gkHl1Mce1wEbXh8xSe R5+18wKfENAgRqXvnr1XYNxqkFwd24tIZUtE+cxr83dy8LJSWf4s8cd9qTxIpPaqxEvb5 X-Gm-Gg: Acq92OHXZYK5dzki8+dZsdWkWuzPrxbDXUrjtDW9xIYkB2Y2o7bugHg5q9VCp1Vb6ae 3paCVvAqFOoIV62skSSgsJVZQzYCVsZsyPhzskPgUUkH5qLepAYTRgFdoirKxYBVjSqT7LcNKB0 QZEmKTrBuWT+uZ4Tutt3kDu7QTHh2hEXY+jRaiqv97YACsGspaxaD1UNIXRdalqLfwfYZ43rbS0 VBes0YnBbfH+7oVBDUqpXcYdRGycugvVJbnWuLl4rRsCPLM0v0qZdpTjFzWu9ly84KkdM7BppkS /wh63YvK1CBtVBDk/KqSSnKpTa47KzVPv2z5SUkTFvOLoPNSrvCIxZ57zB06UaAQ62WJ5fPfMEZ 0/cvj48bQmEGQGC9QQLn5mG9NlS0o1ZLgYv4c5MzdX2GJHg8tqYoZ7IDuSMOHIUhk1yL1zLgLp7 9122mDDLpks97KeGYo X-Received: by 2002:a05:7300:3b05:b0:304:de8e:17b with SMTP id 5a478bee46e88-3074fa57336mr2662540eec.5.1780519925695; Wed, 03 Jun 2026 13:52:05 -0700 (PDT) X-Received: by 2002:a05:7300:3b05:b0:304:de8e:17b with SMTP id 5a478bee46e88-3074fa57336mr2662504eec.5.1780519924962; Wed, 03 Jun 2026 13:52:04 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 03/25] plugins: add userdata to qemu_plugin_register_flush_cb Date: Wed, 3 Jun 2026 13:51:30 -0700 Message-ID: <20260603205152.1440291-4-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: rtJ0d86M21rh5XK5d3AupqNi9pTjwRQq X-Proofpoint-ORIG-GUID: rtJ0d86M21rh5XK5d3AupqNi9pTjwRQq X-Authority-Analysis: v=2.4 cv=A91c+aWG c=1 sm=1 tr=0 ts=6a2093f6 cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=jbUUBHnpNWWeZ8W5LfIA:9 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX5KrtFgKMfUWe BJ07KBbsO/6WUtWjabKfATAX6yN8g1LsO3qZi30W09ULxn44TeCwWnBbpKEb1yGm9PksYKsX+sT HY8r59uzo+eNUdPj9LeQCOojI6txxhxIzCdGnKfLL4AwrODzTY1qsopVi+YM3jDE3O3XphqQEKF YoxA7SzlPlem0/OlzT2x0lP74tpQtfZ8axie8iiz2yc2n/WogXub7jL+Gl676KnevE/4j91bl9z sirjOcLiRQwpFiQDDXMHfrZYdE95iLLNVnYeDeiMoEEJ/BxNp/qWaeDaDFZwSsEn053nQSISMUA cNrTDVp35+aKuPi9Q+fx1p0p+q/QbUGGc0/dexqP8Fnf7G+CuAfUdce6qn1x4Q+9jtl11111yQm n8tN7s9fKRIx0u/cmUzGS8TwokiieZz+RrQ+F5m9h7XuYt3vPtp6ARq0YbADwIxLoCKD/wR1/SZ tpjqKJ7c1ljcByVrGmA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 spamscore=0 suspectscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520049014154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier Reviewed-by: Manos Pitsidianakis --- include/plugins/qemu-plugin.h | 4 +++- plugins/core.c | 31 +++++-------------------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 11213c2ca3f..499441bde23 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -973,6 +973,7 @@ void qemu_plugin_vcpu_for_each(qemu_plugin_id_t id, * qemu_plugin_register_flush_cb() - register code cache flush callback * @id: plugin ID * @cb: callback + * @userdata: user data for callback * * The @cb function is called every time the code cache is flushed. * The callback can be used to free resources associated with existing @@ -981,7 +982,8 @@ void qemu_plugin_vcpu_for_each(qemu_plugin_id_t id, */ QEMU_PLUGIN_API void qemu_plugin_register_flush_cb(qemu_plugin_id_t id, - qemu_plugin_simple_cb_t cb); + qemu_plugin_udata_cb_t cb, + void *userdata); =20 /** * qemu_plugin_register_atexit_cb() - register exit callback diff --git a/plugins/core.c b/plugins/core.c index 2324bbffa3d..21a3c5b15cf 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -131,29 +131,6 @@ static void plugin_vcpu_cb__discon(CPUState *cpu, qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); } =20 -/* - * Disable CFI checks. - * The callback function has been loaded from an external library so we do= not - * have type information - */ -QEMU_DISABLE_CFI -static void plugin_cb__simple(enum qemu_plugin_event ev) -{ - struct qemu_plugin_cb *cb, *next; - - switch (ev) { - case QEMU_PLUGIN_EV_FLUSH: - QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { - qemu_plugin_simple_cb_t func =3D cb->f.simple; - - func(cb->ctx->id); - } - break; - default: - g_assert_not_reached(); - } -} - /* * Disable CFI checks. * The callback function has been loaded from an external library so we do= not @@ -166,6 +143,7 @@ static void plugin_cb__udata(enum qemu_plugin_event ev) =20 switch (ev) { case QEMU_PLUGIN_EV_ATEXIT: + case QEMU_PLUGIN_EV_FLUSH: QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { qemu_plugin_udata_cb_t func =3D cb->f.udata; =20 @@ -690,9 +668,10 @@ void qemu_plugin_register_vcpu_discon_cb(qemu_plugin_i= d_t id, } =20 void qemu_plugin_register_flush_cb(qemu_plugin_id_t id, - qemu_plugin_simple_cb_t cb) + qemu_plugin_udata_cb_t cb, + void *userdata) { - plugin_register_cb(id, QEMU_PLUGIN_EV_FLUSH, cb); + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_FLUSH, cb, userdata); } =20 static bool free_dyn_cb_arr(void *p, uint32_t h, void *userp) @@ -706,7 +685,7 @@ void qemu_plugin_flush_cb(void) qht_iter_remove(&plugin.dyn_cb_arr_ht, free_dyn_cb_arr, NULL); qht_reset(&plugin.dyn_cb_arr_ht); =20 - plugin_cb__simple(QEMU_PLUGIN_EV_FLUSH); + plugin_cb__udata(QEMU_PLUGIN_EV_FLUSH); } =20 void exec_inline_op(enum plugin_dyn_cb_type type, --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520014; cv=none; d=zohomail.com; s=zohoarc; b=mFTvFOlJCDoR/+pMRYDz0+KYkX0W5Mn6pi0I1Lgsi9zaIwZaYT7gO1tgsCMASaCvzUBWId3mGGtNPk/qsrKVXBMiSv/stzG+aeJx034Zx/b6B0wG8uCeOuZbbUjeVHAJ9hMndH0LCEN7K5QB9QHtUBk3um1VTeRDZZL6O+XfbYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520014; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=t5D9fCZRFjaZo3dxmMgfect8txWU4hAoTsxjlMPqDAA=; b=UtS1UTg3aNp3dyc+Hd9PdX4iU/0S4o23JEqex7BpbP1dd7YJgS6fw5nhgrzuT7czlszLoyGIfJXcl+ngE2r3/+rvWC+VOhdR1xweIP5rsyGYVS57ZszBlqtHPbJl9Xhe4WpOQ9p3S3kZZowfUcwkkHoGNwhLd6aYWyByxyDIGpk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520014473614.6065250420971; Wed, 3 Jun 2026 13:53:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsZX-0007z3-3j; Wed, 03 Jun 2026 16:52:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZR-0007xh-Ak for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:13 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZM-0004CX-Jz for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:11 -0400 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653K6eVu2076419 for ; Wed, 3 Jun 2026 20:52:07 GMT Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejev1bmmr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:07 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-30761ab3483so1304736eec.0 for ; Wed, 03 Jun 2026 13:52:07 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=t5D9fCZRFja Zo3dxmMgfect8txWU4hAoTsxjlMPqDAA=; b=frOaEuFRH8TeiLlYu1I7DTRAcrW JwEZQD3G1zZGvT2M3x++cNSUZuPLdmiVM5USIdX3zwILGFH/s6wXl36V70AFCR+5 F6Eoc26T8hpjq5yh8hXN+10SVp05rPfLmZmjKRsSgBSAirSskFwcHLCOFQQPRL+y Jvk6dVfY6YNmh7UE4GP5IpnIVzgDCT1RIjHIaX+ClQu/S19HQ67c1HROirocTx/9 3eN/PqQ8/7VvP8vF5Eeh71O/ek0Ro/DJv+1YJNqWCoOkNv2HMawHd726yRJ1T95q 6m+B5WCbcYL1b3y2zP0aTA3Fx+OXjrfWEqRuCIub/E0JLI02BoXzphcviKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519926; x=1781124726; 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=t5D9fCZRFjaZo3dxmMgfect8txWU4hAoTsxjlMPqDAA=; b=IspPV1UaU1edFogbxWYMpTpoHsXxYAlOvdsaPaoQnkwDg7uc374EgXjCvgkbCbqf/b dz9JOUOpoC2kbFSMVz3tbFtphTzSQhQiAUW5iE16V0ckBgqc6BMlJrskEo6SNufH5gSp BofYGhUhaFqlKJqNQ4bU8V8CEmKVxgGk3wPU7+q6mLf+n6mts6DFakF0d9sTGEIsPoNe j+X0nb9G7+0mpEWMqE9Yq7blZfCDmjWHnkDX+w785du84icsksr5GvlF2TxJwpj8qgdS UN7DaeGlvYeCG3hs4HdsMdvVwHxY1EjMqTZno0sRThEZTym/21LEbTCxitaYwoIP6gFH c4QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519926; x=1781124726; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=t5D9fCZRFjaZo3dxmMgfect8txWU4hAoTsxjlMPqDAA=; b=BUk/8EjqGQOilBJb9H2+/Nzjcpyuzo3ZVG1uEN16aVYNDC0aCLiQneLzLkZtLWaSqA vhwVR+yhqDLFHLLv8+0OeWKmx1Bi1oNqYLd8fog++TNXHYsQUonvNXD9s18V0kspAZ28 AHq6I96fXbXPlsNqmnt5pHPXMO+R/boYt+p9R4nSnF6rb2gxlJ8QySzR1Dpt/kEJxGFv dj67pGHYhEnDzDLadCaTH346/PvHGnu7X6v7+44FVfhYfzxYkaeFjQ3T2e+CSo/A4nK3 TdpuQpgk8V9sYiuV8O5qB+Wgu6EVMmrdiiF2TL0C+vou+j/zxi12sYNCQD0V9PSZrlTI jtgg== X-Gm-Message-State: AOJu0YzYg+XTgbCdZwLrucjC+f07jQE1wLdN7Z6Tz3BWbSDg3/EdRTDj BNzOG1+ode1bt1kGgY5W6iOGPJCP3DN6IN4wJ/8LuNiBVEFKS8n7m/HL0LwpN+Kh+LcMsNlIHfI 4qqdcOOyN/q7fR8Mboc5euFAY8mKruv+PvWvMeeX+4sqMf65gTlJjXfnB36cqEIWekh/l X-Gm-Gg: Acq92OG4ITxMzTFMdHEtHFpQFK90d87wxAc5VXtGlCxsaHEYnFr7WPpRsm+TynSUFfL crhq7qkPL54rTTwNM13XYQ8VuktcEdOv0oKSHEpYSKuds6UfDOF6IkY2hMAPCYSDxoFxXaVERWS nkkaSpAPGFGd4P9kBeY4PigJUAWyIm6Ftg+ZUzlkdgea9gPr3RH4gBLYRF63AG/rHO5cultwu9z eZJi6tsFNlIQ5L0+O4xvDF+vD5uzboCRRkNLiH5rOqKAdzd7M41f4RBlxnQ9Z1Qn+CRVLLGFTWF OYJBphSb9EPtsM+CKykLPaKRIyf0d9C9LbkKigtqC7BLMw1dNONqfo42XQbG4k4pVHho2g2JE29 qRkKM1EMAIyK2LpR5l4VVXIy0QTNMbosgk4DlyFZ3lizAK46MQFdyeoIYe2vi2gnD8VnwrSOkAT vi8ToOs/hton+UP1xh X-Received: by 2002:a05:7301:128b:b0:2ea:b7a9:580d with SMTP id 5a478bee46e88-3074fa80739mr2651141eec.9.1780519926340; Wed, 03 Jun 2026 13:52:06 -0700 (PDT) X-Received: by 2002:a05:7301:128b:b0:2ea:b7a9:580d with SMTP id 5a478bee46e88-3074fa80739mr2651131eec.9.1780519925828; Wed, 03 Jun 2026 13:52:05 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 04/25] plugins: remove type qemu_plugin_simple_cb_t Date: Wed, 3 Jun 2026 13:51:31 -0700 Message-ID: <20260603205152.1440291-5-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: 8Bm-LBU-LiKWR59c1TvJTcwJHLyae0G- X-Authority-Analysis: v=2.4 cv=PNE/P/qC c=1 sm=1 tr=0 ts=6a2093f7 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=v0NQEDj6idUmN-g72lQA:9 a=6Ab_bkdmUrQuMsNx7PHu:22 X-Proofpoint-GUID: 8Bm-LBU-LiKWR59c1TvJTcwJHLyae0G- X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfXzaAMtw5qHU9A YfTIoqfnmkTfNIW1fejEQLzQQwmmd959w9LgF4I9DCgsrUgIgURWAg/cotyzlD4USCHqfM5SYRW u0E11DqBuUhzlx4LlL9p4axnil1vaOOMufuD9pdINLqEVVMyvXlpVSO3TfxwTyKxnPEc+Xjj5Q+ ZdDzOMIoPekwYwECpDxxccS07vxxELz+uX4YDJbtyhvZndAKX1DEho5DIqPSMic4smR12Ae1CgV ICuNvo4YlEtI85QDNOHphGVyCDEvsQxdxCi028LZijDOavXl99eckbAUBbL+fQHrik9gGM0kOBk RfKO4etrPVSvX1aVcz3cB9PIdXDOsnAXtFfjmH5kD0AlICyVgQUplDsbcpbwjiomxp6msyAYcHj +OtZM+JDjWj0yu5SI4NehkT6eybftU2mDUbxoJ66l1t5dYoRPgW/evm+s9q+yj1rFVhtKnumANP G1ryPtayIktQLe92b4w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 clxscore=1015 malwarescore=0 spamscore=0 adultscore=0 impostorscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520016571154100 Content-Type: text/plain; charset="utf-8" We removed all usage of this type, it can now be removed. Signed-off-by: Pierrick Bouvier Reviewed-by: Manos Pitsidianakis --- include/plugins/qemu-plugin.h | 8 -------- include/qemu/plugin.h | 1 - 2 files changed, 9 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 499441bde23..3c6f32bacfe 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -140,14 +140,6 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin= _id_t id, const qemu_info_t *info, int argc, char **argv); =20 -/** - * typedef qemu_plugin_simple_cb_t - simple callback - * @id: the unique qemu_plugin_id_t - * - * This callback passes no information aside from the unique @id. - */ -typedef void (*qemu_plugin_simple_cb_t)(qemu_plugin_id_t id); - /** * typedef qemu_plugin_udata_cb_t - callback with user data * @id: the unique qemu_plugin_id_t diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index ddd77bd82c9..dac08cdc60c 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -55,7 +55,6 @@ void qemu_plugin_opt_parse(const char *optstr, QemuPlugin= List *head); int qemu_plugin_load_list(QemuPluginList *head, Error **errp); =20 union qemu_plugin_cb_sig { - qemu_plugin_simple_cb_t simple; qemu_plugin_udata_cb_t udata; qemu_plugin_vcpu_simple_cb_t vcpu_simple; qemu_plugin_vcpu_udata_cb_t vcpu_udata; --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780519965; cv=none; d=zohomail.com; s=zohoarc; b=OsdeYLBVAOQjhBs9TO7De58FvbBf6H/5y8vZSu3RIIu0ugDXJSuA/zwV5u2tHNeU04TlfF6td6MtcgQP4z+zTHZdYKIHpQyledEuu0YOase3WaoIEmlzSxcyepu2RUPLVKOfF2/ZxcYmiJNDZDuFOvcL8s5wpAOUxXZF1CL2P/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780519965; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4xhvksk0W0YxR5uumxVJ5DEEy/bnK5v4+boSPNTts6U=; b=Mu9OjskdXelYowDYH51s8DIIuyjjeaSXlx/iAC5SOTCmzu2X43cdQhebQKwBNg04sOIXyuihtvwhgUd2oXVtg/Ygc1KFOoIez5hmAqQE0DgypmpqYRLkjl0GpeZ/kQkTMDtSt7Qy9nDw33UYh1YxXco0KhFPOEX6K5y46HTxaWw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780519964992664.0141943276952; Wed, 3 Jun 2026 13:52:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsZW-0007ys-Su; Wed, 03 Jun 2026 16:52:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZR-0007xg-Ab for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:13 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZN-0004Cr-P1 for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:12 -0400 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653I6fqh1993560 for ; Wed, 3 Jun 2026 20:52:08 GMT Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejs8prkng-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:08 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-304ea1eea05so17646257eec.0 for ; Wed, 03 Jun 2026 13:52:08 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=4xhvksk0W0Y xR5uumxVJ5DEEy/bnK5v4+boSPNTts6U=; b=AuFEFeSv/jm+5biF/stO94t+hIE OvF1D8JunXNLQHRdyL11K3KFaxTGhlVqk82BjIRmrCCM4fL+89gN7oeuf5XAOPS7 QA4OAmeTcTAzklodq0eiTfQPWkXbaqQPaipCKhNNfKvisAVAq98OSNUIWEPFOY+K WRMCS8u+dujo8KjEqVk0ZZfz7dLa33wFRxx73+7J7oOug+Qd3rq3PwvGxs3zFs+b McsLMjOKIn39mjQ7tOfgQNsR8K1as7YskkbGDioXftZ51nmKVNcZzXP/l+2AaiZ4 4rFn7C4miISA+9V0DM8cTeC4rVaUQfQ3pcMu1ZqIpSe70ffsOMixxpa4OsQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519927; x=1781124727; 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=4xhvksk0W0YxR5uumxVJ5DEEy/bnK5v4+boSPNTts6U=; b=RcVwHB8F2PRefGsMi62CeJcgu65YNDSFeo9trXXsNZmc8Z0vrEMEPpVz418T1MUDNs F81B8ShgDXajJVXZHx20wDuxdsda8out0fn45u683msY6PzDIZp7rpiRQXMaokkLgwso trcD5RIBqA0Cetk6xPbsvO+VOhV5Z9B0Unewx3eSUO2eHy0/ZmX1h3QhXcr87+1ANv4N cJRMcGA6iuK7Bh6F0qml2R1KHLoV+xXIm1/1SltcWwYsFEwaw2yLy9hFpL5j+CgNY6y4 C7yEgecoT9p6e0VBmP+ftDlwo+UWRVfG3LoIFdSPYxd0tyflNwWNIi23AhPI7A5LDgLf N3wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519927; x=1781124727; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4xhvksk0W0YxR5uumxVJ5DEEy/bnK5v4+boSPNTts6U=; b=jLfdeE1LcH9BRv1+kq/UIlNqjUiPM/Ay/a5nGLxE2DJTT6VBXhfxKvfYsQLXfyP43U ubfkSA0vfQLElC/qOUbupO7g+vgvzlJG6TpW0HBLpNpkRGpqpHJw5q5qfU3EaPL9fKoT bwSj28kaM9whGdBuHzcvc/fvxkFMObDsAY8tlZi9RTUS4RIqTlpNFqYfT77MxZ0dKYLx MF51Jygy2CD3L6bX9e/83fP1ljznGPrS4s4+7h2YQxKF1Zu7Qvur1JOkGumK8pRAt7oh GEPN5LNuOQXDc56AKG2l/v7NPE5oKfvdsvY2WOdc8Yz0PNhgS8o7ZsOeXFGDiLSc4IhA CpzQ== X-Gm-Message-State: AOJu0YxfggqZI7Q1szG39RJwRaEVwVCr6wpwVvY//TX/XYrKdfjtjlFr LVR3iCXeblska7YcmHaD+LmtruKIgitv+cTbWMz7B1WIi6pyz15FnMhszMVnWoSdcxNFAMkBRjn HWzCPjMmDNatKghWQUEWDNGCpW8qIPU6PsFhqKe4Zf0X4wkxgYDvt72+IRtN941nM2Ts4 X-Gm-Gg: Acq92OGQYRTq4qgyhMXRfdFg379+HwQe3F1XAaZve8+tJQLUyWZgxsrDzUTEVfmUAbr zD++XZioCzNimD/YMTNaJZhJeZhTVkfHLfer8xxQRK71EeCfbjMFfKESyFa8jXYQIVjLx7VWeiB pa5O7Xv1OyXjAPOlgeDKTkBO6+2ei4cKK8BKsZBWCkaptGf3ylz+z/wpobuhnVH66KbeGEr0Pbu REYTQxzkGcsE4Gk4cPQThcX3R9/ebBxQw8+M8CB+xsWpTyQpDRx2CxK5XcpldtL1zw09THmb7ng h/Xxd3Gya+B/5lddneklV5aE48w1TCS0pCqNEyOETMhWY90IZ3Em861CX/DR2PJEB6AIK3hfFMV CVw4Xb4kpdDwNlXiu8pspVz+OiYsz3RVwvyls6eiOzSdtIAdoTR09FYPSJURd8AiYP7TC4kWBa1 2pboCPapi1cxl8mwLZ X-Received: by 2002:a05:7300:2153:b0:304:819f:502b with SMTP id 5a478bee46e88-3074fa98bd8mr2858392eec.9.1780519927207; Wed, 03 Jun 2026 13:52:07 -0700 (PDT) X-Received: by 2002:a05:7300:2153:b0:304:819f:502b with SMTP id 5a478bee46e88-3074fa98bd8mr2858366eec.9.1780519926583; Wed, 03 Jun 2026 13:52:06 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 05/25] plugins: remove qemu_plugin_id_t from qemu_plugin_udata_cb_t Date: Wed, 3 Jun 2026 13:51:32 -0700 Message-ID: <20260603205152.1440291-6-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: DcPg2Wq1q_K9gTVF2Iq21t8tvPTw_yaZ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX1TEmThNQ6xmW Wk8Uxj1SMXk5OMtNbSZvTb5pCJM96V+eTZXo8OFqi9lwDV9180ds5nKmpEDuJ8aOe06bmb2Ruay uZWRlvkbURj4NpUpTvEN6mnNQ1nuq3is5k9PlYEJ+AeY9ZY1r32elFSVGC60XTCTApNeTDi8usA R6/xnbV8QocVvR628ht4FDN5I8SMrHPcEW/ChjKlwLs0Mp2qt9QxHvShNiTeO/CVBOtzYGfo0wX jrU78K8tlDL3kFK6wLOzjma2xhsd8kjjRr18uy7hZY2BhNg1zq3kaLuYKBOjnetxT4x9IV7kREi IUtqp/yEFGuGLS7ZPlefKt159gHd3mW9+ZKNsaK6SeuDR81nARUaOj7WC0e1txrvcrnAxcgQkhh FgK8kPToKKEzBZbuXNifLRoKkMJ72uJQbHHFZugQubCrwyawSynXsIFIhbEyUpEE3xq7t/g7tAq /frb9HclCxnCEeNY+dg== X-Authority-Analysis: v=2.4 cv=E779Y6dl c=1 sm=1 tr=0 ts=6a2093f8 cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=fy20bCZK_bgFVnb4qsoA:9 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-GUID: DcPg2Wq1q_K9gTVF2Iq21t8tvPTw_yaZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 adultscore=0 impostorscore=0 malwarescore=0 spamscore=0 phishscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780519966427158500 Content-Type: text/plain; charset="utf-8" We can now rely on userdata being always available to pass down this id if needed. In our plugins, only tests/tcg/plugins/reset.c was using it. Signed-off-by: Pierrick Bouvier --- contrib/plugins/bbv.c | 2 +- contrib/plugins/cache.c | 2 +- contrib/plugins/cflow.c | 2 +- contrib/plugins/drcov.c | 2 +- contrib/plugins/execlog.c | 2 +- contrib/plugins/hotblocks.c | 2 +- contrib/plugins/hotpages.c | 2 +- contrib/plugins/howvec.c | 2 +- contrib/plugins/hwprofile.c | 2 +- contrib/plugins/ips.c | 2 +- contrib/plugins/lockstep.c | 8 ++++---- contrib/plugins/stoptrigger.c | 2 +- contrib/plugins/traps.c | 2 +- contrib/plugins/uftrace.c | 2 +- include/plugins/qemu-plugin.h | 3 +-- plugins/core.c | 2 +- plugins/loader.c | 4 ++-- tests/tcg/plugins/bb.c | 2 +- tests/tcg/plugins/inline.c | 2 +- tests/tcg/plugins/insn.c | 2 +- tests/tcg/plugins/mem.c | 2 +- tests/tcg/plugins/reset.c | 7 ++++--- tests/tcg/plugins/syscall.c | 2 +- 23 files changed, 30 insertions(+), 30 deletions(-) diff --git a/contrib/plugins/bbv.c b/contrib/plugins/bbv.c index 5913cc6c637..f2b1b258a90 100644 --- a/contrib/plugins/bbv.c +++ b/contrib/plugins/bbv.c @@ -28,7 +28,7 @@ static char *filename; static struct qemu_plugin_scoreboard *vcpus; static uint64_t interval =3D 100000000; =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { Vcpu *vcpu; =20 diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index 56508587d3a..f41ddb0aa43 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -694,7 +694,7 @@ finish: g_list_free(miss_insns); } =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { log_stats(); log_top_insns(); diff --git a/contrib/plugins/cflow.c b/contrib/plugins/cflow.c index b5e33f25f9b..4d00879ccad 100644 --- a/contrib/plugins/cflow.c +++ b/contrib/plugins/cflow.c @@ -134,7 +134,7 @@ static gboolean filter_non_branches(gpointer key, gpoin= ter value, return node->dest_count =3D=3D 0; } =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { g_autoptr(GString) result =3D g_string_new("collected "); GList *data; diff --git a/contrib/plugins/drcov.c b/contrib/plugins/drcov.c index 5edc94dcaf6..458c0d2084d 100644 --- a/contrib/plugins/drcov.c +++ b/contrib/plugins/drcov.c @@ -86,7 +86,7 @@ static void count_block(gpointer data, gpointer user_data) } } =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { unsigned long count =3D 0; g_mutex_lock(&lock); diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index d00d9c4ff39..d347ac25b6f 100644 --- a/contrib/plugins/execlog.c +++ b/contrib/plugins/execlog.c @@ -400,7 +400,7 @@ static void vcpu_init(qemu_plugin_id_t id, unsigned int= vcpu_index) /** * On plugin exit, print last instruction in cache */ -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { guint i; g_rw_lock_reader_lock(&expand_array_lock); diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 8ecf0339974..92859872ac9 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -70,7 +70,7 @@ static void exec_count_free(gpointer key, gpointer value,= gpointer user_data) qemu_plugin_scoreboard_free(cnt->exec_count); } =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { g_autoptr(GString) report =3D g_string_new("collected "); GList *counts, *sorted_counts, *it; diff --git a/contrib/plugins/hotpages.c b/contrib/plugins/hotpages.c index 9d48ac969eb..a6d83b06c75 100644 --- a/contrib/plugins/hotpages.c +++ b/contrib/plugins/hotpages.c @@ -73,7 +73,7 @@ static gint cmp_access_count(gconstpointer a, gconstpoint= er b, gpointer d) } =20 =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { g_autoptr(GString) report =3D g_string_new("Addr, RCPUs, Reads, WCPUs,= Writes\n"); int i; diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index 42bddb6566d..75728896198 100644 --- a/contrib/plugins/howvec.c +++ b/contrib/plugins/howvec.c @@ -172,7 +172,7 @@ static void free_record(gpointer data) g_free(rec); } =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { g_autoptr(GString) report =3D g_string_new("Instruction Classes:\n"); int i; diff --git a/contrib/plugins/hwprofile.c b/contrib/plugins/hwprofile.c index a9838ccc879..b7f96117e94 100644 --- a/contrib/plugins/hwprofile.c +++ b/contrib/plugins/hwprofile.c @@ -106,7 +106,7 @@ static void fmt_dev_record(GString *s, DeviceCounts *re= c) g_string_append_c(s, '\n'); } =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { g_autoptr(GString) report =3D g_string_new(""); GList *counts; diff --git a/contrib/plugins/ips.c b/contrib/plugins/ips.c index f110c565bc4..7614ae1eafd 100644 --- a/contrib/plugins/ips.c +++ b/contrib/plugins/ips.c @@ -124,7 +124,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct q= emu_plugin_tb *tb) quantum_insn, max_insn_per_quantum, NULL); } =20 -static void plugin_exit(qemu_plugin_id_t id, void *udata) +static void plugin_exit(void *udata) { qemu_plugin_scoreboard_free(vcpus); } diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index 36b003ead2d..c1c2b0aca8e 100644 --- a/contrib/plugins/lockstep.c +++ b/contrib/plugins/lockstep.c @@ -77,7 +77,7 @@ static char *path_to_unlink; =20 static bool verbose; =20 -static void plugin_cleanup(qemu_plugin_id_t id, void *userdata) +static void plugin_cleanup(void *userdata) { /* Free our block data */ g_slist_free_full(blocks, &g_free); @@ -90,7 +90,7 @@ static void plugin_cleanup(qemu_plugin_id_t id, void *use= rdata) } } =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { g_autoptr(GString) out =3D g_string_new("No divergence :-)\n"); g_string_append_printf(out, "Executed %ld/%d blocks\n", @@ -98,7 +98,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) g_string_append_printf(out, "Executed ~%ld instructions\n", insn_count= ); qemu_plugin_outs(out->str); =20 - plugin_cleanup(id, NULL); + plugin_cleanup(NULL); } =20 /* @@ -393,6 +393,6 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, our_id =3D id; =20 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); - qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); + qemu_plugin_register_atexit_cb(id, plugin_exit, (void *)id); return 0; } diff --git a/contrib/plugins/stoptrigger.c b/contrib/plugins/stoptrigger.c index b3a6ed66a7b..40f8fd313d7 100644 --- a/contrib/plugins/stoptrigger.c +++ b/contrib/plugins/stoptrigger.c @@ -93,7 +93,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qem= u_plugin_tb *tb) } } =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { g_hash_table_destroy(addrs_ht); qemu_plugin_scoreboard_free(insn_count_sb); diff --git a/contrib/plugins/traps.c b/contrib/plugins/traps.c index a741580fbf8..4b879a8212a 100644 --- a/contrib/plugins/traps.c +++ b/contrib/plugins/traps.c @@ -44,7 +44,7 @@ static void vcpu_discon(qemu_plugin_id_t id, unsigned int= vcpu_index, } } =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { g_autoptr(GString) report; report =3D g_string_new("VCPU, interrupts, exceptions, hostcalls\n"); diff --git a/contrib/plugins/uftrace.c b/contrib/plugins/uftrace.c index f974090e23e..a071a34ea75 100644 --- a/contrib/plugins/uftrace.c +++ b/contrib/plugins/uftrace.c @@ -928,7 +928,7 @@ static void vcpu_end(unsigned int vcpu_index) memset(cpu, 0, sizeof(Cpu)); } =20 -static void at_exit(qemu_plugin_id_t id, void *data) +static void at_exit(void *data) { bool system_emulation =3D (bool) data; g_autoptr(GArray) traces =3D g_array_new(0, 0, sizeof(Trace *)); diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 3c6f32bacfe..d7d972103cb 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -142,11 +142,10 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugi= n_id_t id, =20 /** * typedef qemu_plugin_udata_cb_t - callback with user data - * @id: the unique qemu_plugin_id_t * @userdata: a pointer to some user data supplied when the callback * was registered. */ -typedef void (*qemu_plugin_udata_cb_t)(qemu_plugin_id_t id, void *userdata= ); +typedef void (*qemu_plugin_udata_cb_t)(void *userdata); =20 /** * typedef qemu_plugin_vcpu_simple_cb_t - vcpu callback diff --git a/plugins/core.c b/plugins/core.c index 21a3c5b15cf..b0532e8d0de 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -147,7 +147,7 @@ static void plugin_cb__udata(enum qemu_plugin_event ev) QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { qemu_plugin_udata_cb_t func =3D cb->f.udata; =20 - func(cb->ctx->id, cb->udata); + func(cb->udata); } break; default: diff --git a/plugins/loader.c b/plugins/loader.c index 0d587c344c4..b10ebe8cc05 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -339,7 +339,7 @@ static void plugin_reset_destroy__locked(struct qemu_pl= ugin_reset_data *data) if (data->reset) { g_assert(ctx->resetting); if (data->cb) { - data->cb(ctx->id, data->userdata); + data->cb(data->userdata); } ctx->resetting =3D false; g_free(data); @@ -358,7 +358,7 @@ static void plugin_reset_destroy__locked(struct qemu_pl= ugin_reset_data *data) g_assert(success); QTAILQ_REMOVE(&plugin.ctxs, ctx, entry); if (data->cb) { - data->cb(ctx->id, data->userdata); + data->cb(data->userdata); } if (!g_module_close(ctx->handle)) { warn_report("%s: %s", __func__, g_module_error()); diff --git a/tests/tcg/plugins/bb.c b/tests/tcg/plugins/bb.c index 36776dee1e1..8a854408aaa 100644 --- a/tests/tcg/plugins/bb.c +++ b/tests/tcg/plugins/bb.c @@ -40,7 +40,7 @@ static void gen_one_cpu_report(CPUCount *count, GString *= report, } } =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { g_autoptr(GString) report =3D g_string_new(""); =20 diff --git a/tests/tcg/plugins/inline.c b/tests/tcg/plugins/inline.c index 73dde995781..1d17884b40b 100644 --- a/tests/tcg/plugins/inline.c +++ b/tests/tcg/plugins/inline.c @@ -121,7 +121,7 @@ static void stats_mem(void) g_assert(inl_per_vcpu =3D=3D expected); } =20 -static void plugin_exit(qemu_plugin_id_t id, void *udata) +static void plugin_exit(void *udata) { const unsigned int num_cpus =3D qemu_plugin_num_vcpus(); g_autoptr(GString) stats =3D g_string_new(""); diff --git a/tests/tcg/plugins/insn.c b/tests/tcg/plugins/insn.c index e6c5207cd69..12421054f67 100644 --- a/tests/tcg/plugins/insn.c +++ b/tests/tcg/plugins/insn.c @@ -190,7 +190,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct q= emu_plugin_tb *tb) } } =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { g_autoptr(GString) out =3D g_string_new(NULL); int i; diff --git a/tests/tcg/plugins/mem.c b/tests/tcg/plugins/mem.c index 6b0732dc0fd..5cdf71c7e49 100644 --- a/tests/tcg/plugins/mem.c +++ b/tests/tcg/plugins/mem.c @@ -68,7 +68,7 @@ static gint addr_order(gconstpointer a, gconstpointer b, = gpointer d) } =20 =20 -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { g_autoptr(GString) out =3D g_string_new(""); =20 diff --git a/tests/tcg/plugins/reset.c b/tests/tcg/plugins/reset.c index 6ea675b8095..ef5a32781b2 100644 --- a/tests/tcg/plugins/reset.c +++ b/tests/tcg/plugins/reset.c @@ -14,7 +14,7 @@ static qemu_plugin_id_t plugin_id; static bool was_reset; static bool was_uninstalled; =20 -static void after_uninstall(qemu_plugin_id_t id, void *userdata) +static void after_uninstall(void *userdata) { g_assert(was_reset && !was_uninstalled); qemu_plugin_outs("uninstall done\n"); @@ -34,8 +34,9 @@ static void tb_trans_after_reset(qemu_plugin_id_t id, str= uct qemu_plugin_tb *tb) QEMU_PLUGIN_CB_NO_REGS, NULL); } =20 -static void after_reset(qemu_plugin_id_t id, void *userdata) +static void after_reset(void *userdata) { + qemu_plugin_id_t id =3D (qemu_plugin_id_t) userdata; g_assert(!was_reset && !was_uninstalled); qemu_plugin_outs("reset done\n"); was_reset =3D true; @@ -45,7 +46,7 @@ static void after_reset(qemu_plugin_id_t id, void *userda= ta) static void tb_exec_before_reset(unsigned int vcpu_index, void *userdata) { g_assert(!was_reset && !was_uninstalled); - qemu_plugin_reset(plugin_id, after_reset, NULL); + qemu_plugin_reset(plugin_id, after_reset, (void *) plugin_id); } =20 static void tb_trans_before_reset(qemu_plugin_id_t id, struct qemu_plugin_= tb *tb) diff --git a/tests/tcg/plugins/syscall.c b/tests/tcg/plugins/syscall.c index 5658f830879..938646f9359 100644 --- a/tests/tcg/plugins/syscall.c +++ b/tests/tcg/plugins/syscall.c @@ -207,7 +207,7 @@ static gint comp_func(gconstpointer ea, gconstpointer e= b, gpointer d) } =20 /* ***********************************************************************= ** */ -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_exit(void *p) { if (!statistics) { return; --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780519949; cv=none; d=zohomail.com; s=zohoarc; b=N3ktDqdCg3w+j+R0+LhsbmInAwPl08HrAI6YqLThFxqJjus36KvEYCbHPdobA+36s/xeASBGInLzcBGeLqfXG5WtAG7PUC0o6bz/m2+DqGUq6LhaIRPD1xjJKKWaQ7UMojgFOcxDFFf+FsY9Jaz4HSrO3qzdAiBVUk7bo6EDpWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780519949; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XhSPAuZ4gft1csafaJeDbNyucEwqasToONotZJGr0Eg=; b=QMgJ9WcEw5LLNhaYOAMCc5YSUhQ3ipEhYW0MZ6i9bLVWmu5k4aCEdzTwMoIBlQp7mSF5+RboK0djuz0c/kzvH/NQfhbFoQu4gxVOjg+J7lPOm5fnBEJpIb+O8M9Zdni4Ct5hXn433dL/Lice2aJLiOggXRk1U6w8U9E7IZePWyQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780519949521742.9067521581; Wed, 3 Jun 2026 13:52:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsZa-00080X-Qc; Wed, 03 Jun 2026 16:52:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZR-0007xf-9d for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:13 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZO-0004Cy-1i for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:12 -0400 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653I6rwC1994324 for ; Wed, 3 Jun 2026 20:52:09 GMT Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejs8prknk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:08 +0000 (GMT) Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-307625ee07fso1179639eec.1 for ; Wed, 03 Jun 2026 13:52:08 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=XhSPAuZ4gft 1csafaJeDbNyucEwqasToONotZJGr0Eg=; b=XgnS6m69STaOWqFksq5GFMhJbGC VZiGr3GyZ6ScvYHlq69gdggu4PHCBcGMWZ16uOGfkMl0LS1m4zBdXrdNfgUy4fIK V9ijmZ0TGdRbKKKGMl/bXNB+JWOa/50KR4MQS6pa8ZfZoCl6sPn2/gjXW9dKhAFb qNlNxs93tYKHBGWv/nPvjz5LKItjytR0SYGIsoD1R+Pk8Tt9E9vUrWdswOViCb1f ftf5FidYoif/6ULxzEbCVPC1YxGs7fgsCxx2tC7NbHeTe+X3M0aOh0T17pjH3y3d C3wsybleZoZcmEZmvLod1AdC+y6x5DnFVkLKjzuCK11BWiaCtz9icFLRQ0g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519928; x=1781124728; 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=XhSPAuZ4gft1csafaJeDbNyucEwqasToONotZJGr0Eg=; b=A0gJH4ca2i25VSMbKkxXPBGnOMFG+Hlj2JLOA/bksejVU9exDVBhwhvsoafB61t80G ebVPYKlYTZo0dyf0kBJAD9p89nYf7gXR8xpdp8vksFwQI3+ZRPUFhayWk4Cc/duYCX0O Ql+XXgwE15VkoM/vqrxGe+inpVtTPOplfJwG7UwpkzUgFw44bGeJiMgLKQdEAkdisY/a 6Q64oEPffA3hVkoaaM78V2lovX+zNnmJqdcnKQlAeNRYDcX8h/TbtI0JYWWwEvkVPfuD 0DQI3WrRrPWO2xjtRgisphstUQGWLBC5ONldGHHija8vF9GiCNMe1wgwBYps2MAtwRwp s2Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519928; x=1781124728; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XhSPAuZ4gft1csafaJeDbNyucEwqasToONotZJGr0Eg=; b=p5BU+pfsDHlrZJsivMTQihnJKO5U4WhqzcZQdII1bbra/DqC2bvEQpBEZcu4x0bLUW ZqUnp9zmTJat5muvsAqVnI8VZBKjZ860v3s7h5nbKP4/llVMlbcqk1/HA/G6veHOkBH7 WqA4gD3NxuujWy6VET523rA2NhLLt0CH/vZKYNW4ZChZfXYfFQWdT+FV/DFDoznfzg+w Kdn/8pMM0vajLI2ld4exhMM3Wp/mq/O15h3AE6HutbGRfR1vZNOYxOn+8T7pY/i1k6nE BjIpIBuhduD5wNSP/AeR9gddETE2la0OaEW88DID2GHwTcWGvgtp0yB4ku5J/c2e1vlk EGug== X-Gm-Message-State: AOJu0YxqgW3tN42NpedfEMEBWLBXRNDt/3nQ9UCnHdhVX3UAPmlVIVzb NHgrTR/22VIjbRFLSUBCIYlt24NZPZO+fwygBCsvhnGLli7OmsFVzNU3I2GMCFXuOVj9ThVSMx/ 7UHUn2a+aaeccj783VbLmYVlJtwwuKBK30oucj/W8Wud070T43CQ/IJrIY7XYFdNLYwdq X-Gm-Gg: Acq92OH9LnBB1fq5NCKQ4r2Qa/fmDZMniVWw9YO0W7/XddcJh4azYcjxxPi4cD9wDUA 4BqKqJysvMjTcMWceA6dyvVh+aNjSeTT9tGddjDkZLRf6V9XXLQ4dmZ8ZdruRCsXzoTuMaUCDTD PBgYyrteO1mXuYZ30YC1mVlDLNqoxTGS9rJSH3Qtvu8BjSmS6WKEPMkwPJ/5iPcCFALFCCEIcKP ISkxmDTer6jZgEvkUD+yJkQ1HierziHT3IZUGQ5NNX5YSsK3wB9BgrM6enE+bK4FZgGK/lrxQbR dPviOj2PtAjXsKjk26iupzWRkso/lEw+SnlakllZ7MQdrhArwEQagu9u6/VxKB9qgbZoYD1Fhs9 eqjxfSnpz8LLy/CXn0tUoPvuOIFec+Do0H5hr8Y0AG1uF/WJ4HrtPSohXSkk2V5zEsJypz9OpFL +HFKAlra4HTi7UQ6pS X-Received: by 2002:a05:7300:3208:b0:2f2:32bc:787d with SMTP id 5a478bee46e88-3074fbc704amr2807409eec.23.1780519927911; Wed, 03 Jun 2026 13:52:07 -0700 (PDT) X-Received: by 2002:a05:7300:3208:b0:2f2:32bc:787d with SMTP id 5a478bee46e88-3074fbc704amr2807389eec.23.1780519927403; Wed, 03 Jun 2026 13:52:07 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 06/25] plugins: remove qemu_plugin_id_t from qemu_plugin_vcpu_simple_cb_t Date: Wed, 3 Jun 2026 13:51:33 -0700 Message-ID: <20260603205152.1440291-7-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: zqorllA3ZpnYSePgN7ufXYM6QYoo9qWa X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX0be3MlOAZr6k IBdMlcpOzkXHrnVAkBogxNdGrJCpTRQ3RpCWFPsDyQfaSfkvI8bdFZRCEsp2vMzKNcE3RZnYtOh 54v3AZajhVEijWGnTE1q5wvmXtmBXNwCTW8KENsLiOqi4XvDpP4vykg3jagtnSNts3VlGVSFu7o PCGlrVIIiunlMmenXdjPETT3KZ4gyGCTt4wf0tdAwp5gOGb7tHtd0uWtJntJ0FFZv8hb+3zqeeo IM2o3oY4/BAhPTf3apGehFMEt+GYum5TaNK1b6QGNxoFlXlCzLaaIoTTIPHxWkKHtRxMJHnj1Nb prgjJTfiZYkzm9BKwYHYw6JmyDD9y/+6b/4QV2FIcZ7jKqMPHhUSwENs/WT1ZwNZmSfHaDGDS5O ISzMuVeog1iENuDHXodUYlJJTbj5HwoC9sO9HuTOCbAfNU8xzVhWD3T/SKEaaYSu4E/6aUrQ4+e P/2/JXlfa41t6gGjUpw== X-Authority-Analysis: v=2.4 cv=E779Y6dl c=1 sm=1 tr=0 ts=6a2093f8 cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=mDV3o1hIAAAA:8 a=EUspDBNiAAAA:8 a=rXe6YV4CopgQa2I4tT4A:9 a=bBxd6f-gb0O0v-kibOvt:22 X-Proofpoint-GUID: zqorllA3ZpnYSePgN7ufXYM6QYoo9qWa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 adultscore=0 impostorscore=0 malwarescore=0 spamscore=0 phishscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780519950534158500 Content-Type: text/plain; charset="utf-8" Not used in all our plugins. Future commits will remove qemu_plugin_vcpu_simple_cb_t completely, and replace it with qemu_plugin_vcpu_udata_cb_t, so id information can be passed using userdata if needed. Signed-off-by: Pierrick Bouvier --- contrib/plugins/bbv.c | 2 +- contrib/plugins/execlog.c | 2 +- contrib/plugins/ips.c | 4 ++-- contrib/plugins/uftrace.c | 2 +- include/plugins/qemu-plugin.h | 4 +--- plugins/core.c | 6 ++---- tests/tcg/plugins/bb.c | 2 +- tests/tcg/plugins/insn.c | 2 +- tests/tcg/plugins/registers.c | 2 +- 9 files changed, 11 insertions(+), 15 deletions(-) diff --git a/contrib/plugins/bbv.c b/contrib/plugins/bbv.c index f2b1b258a90..72cc896a0a6 100644 --- a/contrib/plugins/bbv.c +++ b/contrib/plugins/bbv.c @@ -60,7 +60,7 @@ static qemu_plugin_u64 bb_count_u64(Bb *bb) return qemu_plugin_scoreboard_u64(bb->count); } =20 -static void vcpu_init(qemu_plugin_id_t id, unsigned int vcpu_index) +static void vcpu_init(unsigned int vcpu_index) { g_autofree gchar *vcpu_filename =3D NULL; Vcpu *vcpu =3D qemu_plugin_scoreboard_find(vcpus, vcpu_index); diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index d347ac25b6f..398aa4a1f3f 100644 --- a/contrib/plugins/execlog.c +++ b/contrib/plugins/execlog.c @@ -382,7 +382,7 @@ static GPtrArray *registers_init(int vcpu_index) * As we could have multiple threads trying to do this we need to * serialise the expansion under a lock. */ -static void vcpu_init(qemu_plugin_id_t id, unsigned int vcpu_index) +static void vcpu_init(unsigned int vcpu_index) { CPU *c; =20 diff --git a/contrib/plugins/ips.c b/contrib/plugins/ips.c index 7614ae1eafd..32fd86c87ac 100644 --- a/contrib/plugins/ips.c +++ b/contrib/plugins/ips.c @@ -89,7 +89,7 @@ static void update_system_time(vCPUTime *vcpu) g_mutex_unlock(&global_state_lock); } =20 -static void vcpu_init(qemu_plugin_id_t id, unsigned int cpu_index) +static void vcpu_init(unsigned int cpu_index) { vCPUTime *vcpu =3D qemu_plugin_scoreboard_find(vcpus, cpu_index); vcpu->total_insn =3D 0; @@ -97,7 +97,7 @@ static void vcpu_init(qemu_plugin_id_t id, unsigned int c= pu_index) vcpu->last_quantum_time =3D now_ns(); } =20 -static void vcpu_exit(qemu_plugin_id_t id, unsigned int cpu_index) +static void vcpu_exit(unsigned int cpu_index) { vCPUTime *vcpu =3D qemu_plugin_scoreboard_find(vcpus, cpu_index); update_system_time(vcpu); diff --git a/contrib/plugins/uftrace.c b/contrib/plugins/uftrace.c index a071a34ea75..438cebf2831 100644 --- a/contrib/plugins/uftrace.c +++ b/contrib/plugins/uftrace.c @@ -874,7 +874,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct q= emu_plugin_tb *tb) } } =20 -static void vcpu_init(qemu_plugin_id_t id, unsigned int vcpu_index) +static void vcpu_init(unsigned int vcpu_index) { Cpu *cpu =3D qemu_plugin_scoreboard_find(score, vcpu_index); cpu->ops =3D arch_ops; diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index d7d972103cb..8aaf404504b 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -149,11 +149,9 @@ typedef void (*qemu_plugin_udata_cb_t)(void *userdata); =20 /** * typedef qemu_plugin_vcpu_simple_cb_t - vcpu callback - * @id: the unique qemu_plugin_id_t * @vcpu_index: the current vcpu context */ -typedef void (*qemu_plugin_vcpu_simple_cb_t)(qemu_plugin_id_t id, - unsigned int vcpu_index); +typedef void (*qemu_plugin_vcpu_simple_cb_t)(unsigned int vcpu_index); =20 /** * typedef qemu_plugin_vcpu_udata_cb_t - vcpu callback diff --git a/plugins/core.c b/plugins/core.c index b0532e8d0de..217d6608c1d 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -96,8 +96,7 @@ static void plugin_vcpu_cb__simple(CPUState *cpu, enum qe= mu_plugin_event ev) /* iterate safely; plugins might uninstall themselves at any time = */ QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { qemu_plugin_vcpu_simple_cb_t func =3D cb->f.vcpu_simple; - - func(cb->ctx->id, cpu->cpu_index); + func(cpu->cpu_index); } break; default: @@ -306,8 +305,7 @@ static void plugin_vcpu_for_each(gpointer k, gpointer v= , gpointer udata) { struct plugin_for_each_args *args =3D udata; int cpu_index =3D *(int *)k; - - args->cb(args->ctx->id, cpu_index); + args->cb(cpu_index); } =20 void qemu_plugin_vcpu_for_each(qemu_plugin_id_t id, diff --git a/tests/tcg/plugins/bb.c b/tests/tcg/plugins/bb.c index 8a854408aaa..f29b466dab2 100644 --- a/tests/tcg/plugins/bb.c +++ b/tests/tcg/plugins/bb.c @@ -56,7 +56,7 @@ static void plugin_exit(void *p) qemu_plugin_scoreboard_free(counts); } =20 -static void vcpu_idle(qemu_plugin_id_t id, unsigned int cpu_index) +static void vcpu_idle(unsigned int cpu_index) { CPUCount *count =3D qemu_plugin_scoreboard_find(counts, cpu_index); g_autoptr(GString) report =3D g_string_new(""); diff --git a/tests/tcg/plugins/insn.c b/tests/tcg/plugins/insn.c index 12421054f67..80f7cbb2967 100644 --- a/tests/tcg/plugins/insn.c +++ b/tests/tcg/plugins/insn.c @@ -84,7 +84,7 @@ static Instruction * get_insn_record(const char *disas, u= int64_t vaddr, Match *m /* * Initialise a new vcpu with reading the register list */ -static void vcpu_init(qemu_plugin_id_t id, unsigned int vcpu_index) +static void vcpu_init(unsigned int vcpu_index) { g_autoptr(GArray) reg_list =3D qemu_plugin_get_registers(); g_autoptr(GByteArray) reg_value =3D g_byte_array_new(); diff --git a/tests/tcg/plugins/registers.c b/tests/tcg/plugins/registers.c index 6d627c70371..94776d887fe 100644 --- a/tests/tcg/plugins/registers.c +++ b/tests/tcg/plugins/registers.c @@ -21,7 +21,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGI= N_VERSION; * registers that cannot be written to, which would fail the test. * See: https://lists.gnu.org/archive/html/qemu-devel/2026-02/msg07025.html */ -static void vcpu_init_cb(qemu_plugin_id_t id, unsigned int vcpu_index) +static void vcpu_init_cb(unsigned int vcpu_index) { g_autoptr(GArray) regs =3D qemu_plugin_get_registers(); g_assert(regs !=3D NULL); --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520013; cv=none; d=zohomail.com; s=zohoarc; b=JDCCsJy8LSCeEY0SoYzWDUD9nGyof9PhIpNGQlAplMMEsEwrNirVTblcSec3UoEeMmK18J22nvzChDCd19I0Lfoq6GB3esNCuntkC3lQN+fHDvK+poreaP6zO7ktjPJxViPFjP/oTY3Ng5R+ocSuhhsplPQaCYt45zr5KrhYnqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520013; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=epPLegPgQTuV2yJ21CDLla7A2wgulQVaoXgygT+ANhc=; b=nO6Gor7GPcJpCSVhyES7WKNjyFoOZppsVIK30LQk9IIGBIGQ7S7qnFqktEJTtzOGQ1Ix0xadm6n6tStK1xiehYOJ7A1XtKF7lVUQU/qNFR0Ww/bEk5jkH9yej8mN9sZwBjWRJwhsa2RoDwF8y2rJ/I6+EDnro5MDegXfVz1bm94= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520013781841.9302977620071; Wed, 3 Jun 2026 13:53:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsZf-00083H-Sl; Wed, 03 Jun 2026 16:52:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZU-0007z4-Nd for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:19 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZQ-0004DU-Sj for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:14 -0400 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653GdpBO2368043 for ; Wed, 3 Jun 2026 20:52:10 GMT Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejj3gjnd6-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:10 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-304ec73b015so815547eec.1 for ; Wed, 03 Jun 2026 13:52:10 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=epPLegPgQTu V2yJ21CDLla7A2wgulQVaoXgygT+ANhc=; b=b83XWYF6i73XV22h/6EdpguASgo RZH26doiu/MnPIBA3hGgLjVcaTDF9vzhsL8ww157XDtSC9ISy5CQbfFAIpwa+udo ZfhjJkoOT/7oScN5AfnBbc6REnPoELCtPJWRWnBAv+R3yHHFisGgJ+Nfmzv7A3IJ fVKoHMpRzv8t/BYvcS7/tN2+g6TjeOWS9BgoaAeHTARPa3PvRoYEGiRPoLUvGDSB NbGySqpSWzEM/flhypl65I/FvZe7isAtZW3ivIzLQa1Up62hJg2Su0Os68fHJmzi O1kAyD2/uqv52V1OaJ+okCkq6TuBg1cJ2ylBdk6O1Y8/BxDSXGpliRoejJw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519929; x=1781124729; 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=epPLegPgQTuV2yJ21CDLla7A2wgulQVaoXgygT+ANhc=; b=S889ZuIgjwi4Kz5PYobsJBTKdIhJaB/3p2r2MjnECfSDzdavVIQ0fUQPCLArhXRh7U O1a9nwyuCIhNa2Fp8xkoaaodUS6glf1v2CQgaVMleSqFmPxc0yuUhomIUrrIU0sN1uMp P6Kat933p1RTdhXC5IANUcotIxaO84jx/CyRJSek7r/WNWLcYxwVPKbhy77eN+OzlIEC +sG6j1+jF2QHo4DpJ2w2PZupnp2jBCR/cnw9xve0QIoBZ55JcNIOU0oBdJ22SR8CsAe7 a7jqPsoGSP2dzXwSQ/r66DK/fFgBrh0DLrivBbsd0FPJaJJajnStjW+0yaXLWZUs9lBr /ygQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519929; x=1781124729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=epPLegPgQTuV2yJ21CDLla7A2wgulQVaoXgygT+ANhc=; b=mH5pVVm+iPsaTyIGFSjzI+XBC7buPa8lE+dJAsK4gj9o2hIsZlvIiXvCjDIyCt+NOR ci7m67BGy//cNRFF62u45SBrDvIrjxZ00PjyX/JYoCoBcJtuuUtbj9ryRDlVvKYL/Bxu AWwVo6jyV8557OrjXE64FWtwf2Th58KZrgewof4v5M6S2IHci6pxKQc9Yevz+xzSd1K8 T6BBPhuRMYrZCaCKLU+229S1xED1xqnIGuQRacd31YcJ7QDJV2NHkagGxKsg1sixeRp0 taJvlfnNwC3nxfiegMX9PP/DpcRsOJwN+9hkDCIec99jJ+uhbRPqssH1nRBuEzKz+yW7 9ODw== X-Gm-Message-State: AOJu0YyTHyOWb7pH5V6zJD5w+14o1+qoaXdcZEnn7D0p6jpaeD4NpwgX Zl34gZeAaKfU3an5MMiJllvi4aealPZ3COKUMBa/fVNsq+eV85kYDLzwDtGOgcoXTIxSi1u7KkY RgjrJWP7rxdIoUCqZzQSbmHcUXpYupUPTJfwCKeXloEcYdLZx1aL/Q/4jGy2zPnmAHvbA X-Gm-Gg: Acq92OEwOPM9nmPyw77M2QBMDdYpE4U2hEfNHS1LbddgoAurfrZUbZYCtf48Q7SB6d3 ekE57kiS1mxT5HE9n/et0BTs8P+CHnrT2tB0r65uMC57x40aZHYmOyvP2RLAU5ExSw53ELNY5xt nY+fIRPCoMNxNr5oQgSEI1ZW6zyueS0XLZvhdCMl2WayIu6/oMe/6UkF6y3AgfK/GfIfz65LAsI tngTUBEHpYwn7DuvRNAZawE1PYQvlxD8XB5riAxwhk6+KPYkH18Xr7vvcwu/6NJcIzImmo1QQRA npmrC3BGp4ZTzPKEy8dyyvWLl6XKNOhVDA8kFC16t7snbmQgo8MexLrZ4/c/NoXGRp8bhR6lWGw 9e34E7p93L8kk5qvIHmaLRcIz1R16Mss088Ga3mPu7FOoaFcKu1OoFUsN/IEvwC5sX3riYgJhRl R32MLtxOxSy8i6s9av X-Received: by 2002:a05:7300:fd09:b0:304:d32e:65e5 with SMTP id 5a478bee46e88-3074fa7fc9dmr3005479eec.8.1780519929148; Wed, 03 Jun 2026 13:52:09 -0700 (PDT) X-Received: by 2002:a05:7300:fd09:b0:304:d32e:65e5 with SMTP id 5a478bee46e88-3074fa7fc9dmr3005457eec.8.1780519928628; Wed, 03 Jun 2026 13:52:08 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 07/25] plugins: add userdata to qemu_plugin_register_vcpu_init_cb Date: Wed, 3 Jun 2026 13:51:34 -0700 Message-ID: <20260603205152.1440291-8-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfXy+fnpJ7L5tuc iXu8AQbe08Exv0b8QZXhWoXp2GHKThoheJsz+lyKl0iAwp6cPZYd8aelHC1IKrKZGlUTQ8C6IVo tvqOIW2mCyjtzcDb94i5oOAjYib3bg7zMceAxZoFmdXLGADcyQCieKVxZboDDA+MgVLMhbeQV0g +K6rHhAdHeO4leDHY116A2Y4Jn7f0vRRNmCuU0Witex26U+i3YRTlydwsNY9zb4uqCbA/m/Yzze SgRzI+qheBnfaERZJ08E7HsGYNKYkB6QJiJkL/eW/Bi/CkOSowwNnLVscssBubwy8OU1PN63aSP ozuLJ/fykS4Qcxfht9o5bueE4NASciFOGP85di5yLWIERsZcadrQqJq0XYOBY4BHhTFfEpKXekP 5mTdvjCLkFm9BRetn8iCveai5sA4hp/irt32e4OFUMutLiJBhnzXzwQgcBT0wyo/8GYZkAYf4Ov KVt0y9ok6iS1ziS0qDQ== X-Proofpoint-GUID: 1wtHugtqMnHfnI68zM1pP6qLcJRrn-6C X-Proofpoint-ORIG-GUID: 1wtHugtqMnHfnI68zM1pP6qLcJRrn-6C X-Authority-Analysis: v=2.4 cv=UvhT8ewB c=1 sm=1 tr=0 ts=6a2093fa cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=mDV3o1hIAAAA:8 a=EUspDBNiAAAA:8 a=YM_NDQi6F0E_l5RYA_wA:9 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0 spamscore=0 impostorscore=0 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520014822158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- contrib/plugins/bbv.c | 4 ++-- contrib/plugins/execlog.c | 4 ++-- contrib/plugins/ips.c | 4 ++-- contrib/plugins/uftrace.c | 4 ++-- include/plugins/qemu-plugin.h | 4 +++- plugins/api.c | 5 +++-- plugins/core.c | 26 +++++++++++++++++++++++--- tests/tcg/plugins/insn.c | 4 ++-- tests/tcg/plugins/registers.c | 4 ++-- 9 files changed, 41 insertions(+), 18 deletions(-) diff --git a/contrib/plugins/bbv.c b/contrib/plugins/bbv.c index 72cc896a0a6..0ad1301a1de 100644 --- a/contrib/plugins/bbv.c +++ b/contrib/plugins/bbv.c @@ -60,7 +60,7 @@ static qemu_plugin_u64 bb_count_u64(Bb *bb) return qemu_plugin_scoreboard_u64(bb->count); } =20 -static void vcpu_init(unsigned int vcpu_index) +static void vcpu_init(unsigned int vcpu_index, void *userdata) { g_autofree gchar *vcpu_filename =3D NULL; Vcpu *vcpu =3D qemu_plugin_scoreboard_find(vcpus, vcpu_index); @@ -156,7 +156,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, bbs =3D g_hash_table_new_full(g_int64_hash, g_int64_equal, NULL, free_= bb); vcpus =3D qemu_plugin_scoreboard_new(sizeof(Vcpu)); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); - qemu_plugin_register_vcpu_init_cb(id, vcpu_init); + qemu_plugin_register_vcpu_init_cb(id, vcpu_init, NULL); qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); =20 return 0; diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index 398aa4a1f3f..2d02816a184 100644 --- a/contrib/plugins/execlog.c +++ b/contrib/plugins/execlog.c @@ -382,7 +382,7 @@ static GPtrArray *registers_init(int vcpu_index) * As we could have multiple threads trying to do this we need to * serialise the expansion under a lock. */ -static void vcpu_init(unsigned int vcpu_index) +static void vcpu_init(unsigned int vcpu_index, void *userdata) { CPU *c; =20 @@ -481,7 +481,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, } =20 /* Register init, translation block and exit callbacks */ - qemu_plugin_register_vcpu_init_cb(id, vcpu_init); + qemu_plugin_register_vcpu_init_cb(id, vcpu_init, NULL); qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); =20 diff --git a/contrib/plugins/ips.c b/contrib/plugins/ips.c index 32fd86c87ac..1290a624489 100644 --- a/contrib/plugins/ips.c +++ b/contrib/plugins/ips.c @@ -89,7 +89,7 @@ static void update_system_time(vCPUTime *vcpu) g_mutex_unlock(&global_state_lock); } =20 -static void vcpu_init(unsigned int cpu_index) +static void vcpu_init(unsigned int cpu_index, void *userdata) { vCPUTime *vcpu =3D qemu_plugin_scoreboard_find(vcpus, cpu_index); vcpu->total_insn =3D 0; @@ -207,7 +207,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, g_assert(time_handle); =20 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); - qemu_plugin_register_vcpu_init_cb(id, vcpu_init); + qemu_plugin_register_vcpu_init_cb(id, vcpu_init, NULL); qemu_plugin_register_vcpu_exit_cb(id, vcpu_exit); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); =20 diff --git a/contrib/plugins/uftrace.c b/contrib/plugins/uftrace.c index 438cebf2831..8be8409dce2 100644 --- a/contrib/plugins/uftrace.c +++ b/contrib/plugins/uftrace.c @@ -874,7 +874,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct q= emu_plugin_tb *tb) } } =20 -static void vcpu_init(unsigned int vcpu_index) +static void vcpu_init(unsigned int vcpu_index, void *userdata) { Cpu *cpu =3D qemu_plugin_scoreboard_find(score, vcpu_index); cpu->ops =3D arch_ops; @@ -985,7 +985,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, } =20 score =3D qemu_plugin_scoreboard_new(sizeof(Cpu)); - qemu_plugin_register_vcpu_init_cb(id, vcpu_init); + qemu_plugin_register_vcpu_init_cb(id, vcpu_init, NULL); qemu_plugin_register_atexit_cb(id, at_exit, (void *) info->system_emul= ation); qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); =20 diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 8aaf404504b..bb4569a2291 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -242,6 +242,7 @@ void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin= _udata_cb_t cb, * qemu_plugin_register_vcpu_init_cb() - register a vCPU initialization ca= llback * @id: plugin ID * @cb: callback function + * @userdata: any plugin data to pass to the @cb * * The @cb function is called every time a vCPU is initialized. * @@ -249,7 +250,8 @@ void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin= _udata_cb_t cb, */ QEMU_PLUGIN_API void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_simple_cb_t cb); + qemu_plugin_vcpu_udata_cb_t cb, + void *userdata); =20 /** * qemu_plugin_register_vcpu_exit_cb() - register a vCPU exit callback diff --git a/plugins/api.c b/plugins/api.c index 91c9a24a6b2..68b564bb9c2 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -71,9 +71,10 @@ void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin_= udata_cb_t cb, */ =20 void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_simple_cb_t cb) + qemu_plugin_vcpu_udata_cb_t cb, + void *userdata) { - plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_INIT, cb); + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_VCPU_INIT, cb, userdata); } =20 void qemu_plugin_register_vcpu_exit_cb(qemu_plugin_id_t id, diff --git a/plugins/core.c b/plugins/core.c index 217d6608c1d..1d5692b3f41 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -89,7 +89,6 @@ static void plugin_vcpu_cb__simple(CPUState *cpu, enum qe= mu_plugin_event ev) struct qemu_plugin_cb *cb, *next; =20 switch (ev) { - case QEMU_PLUGIN_EV_VCPU_INIT: case QEMU_PLUGIN_EV_VCPU_EXIT: case QEMU_PLUGIN_EV_VCPU_IDLE: case QEMU_PLUGIN_EV_VCPU_RESUME: @@ -104,6 +103,28 @@ static void plugin_vcpu_cb__simple(CPUState *cpu, enum= qemu_plugin_event ev) } } =20 +/* + * Disable CFI checks. + * The callback function has been loaded from an external library so we do= not + * have type information + */ +QEMU_DISABLE_CFI +static void plugin_vcpu_cb__udata(CPUState *cpu, enum qemu_plugin_event ev) +{ + struct qemu_plugin_cb *cb, *next; + + switch (ev) { + case QEMU_PLUGIN_EV_VCPU_INIT: + QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { + qemu_plugin_vcpu_udata_cb_t func =3D cb->f.vcpu_udata; + func(cpu->cpu_index, cb->udata); + } + break; + default: + g_assert_not_reached(); + } +} + /* * Disable CFI checks. * The callback function has been loaded from an external library so we do= not @@ -145,7 +166,6 @@ static void plugin_cb__udata(enum qemu_plugin_event ev) case QEMU_PLUGIN_EV_FLUSH: QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { qemu_plugin_udata_cb_t func =3D cb->f.udata; - func(cb->udata); } break; @@ -271,7 +291,7 @@ static void qemu_plugin_vcpu_init__async(CPUState *cpu,= run_on_cpu_data unused) qemu_rec_mutex_unlock(&plugin.lock); =20 qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_RW_REGS); - plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_INIT); + plugin_vcpu_cb__udata(cpu, QEMU_PLUGIN_EV_VCPU_INIT); qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); } =20 diff --git a/tests/tcg/plugins/insn.c b/tests/tcg/plugins/insn.c index 80f7cbb2967..d9f94888d6f 100644 --- a/tests/tcg/plugins/insn.c +++ b/tests/tcg/plugins/insn.c @@ -84,7 +84,7 @@ static Instruction * get_insn_record(const char *disas, u= int64_t vaddr, Match *m /* * Initialise a new vcpu with reading the register list */ -static void vcpu_init(unsigned int vcpu_index) +static void vcpu_init(unsigned int vcpu_index, void *userdata) { g_autoptr(GArray) reg_list =3D qemu_plugin_get_registers(); g_autoptr(GByteArray) reg_value =3D g_byte_array_new(); @@ -296,7 +296,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, qemu_plugin_scoreboard_new(sizeof(uint64_t))); =20 /* Register init, translation block and exit callbacks */ - qemu_plugin_register_vcpu_init_cb(id, vcpu_init); + qemu_plugin_register_vcpu_init_cb(id, vcpu_init, NULL); qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; diff --git a/tests/tcg/plugins/registers.c b/tests/tcg/plugins/registers.c index 94776d887fe..0e41734435f 100644 --- a/tests/tcg/plugins/registers.c +++ b/tests/tcg/plugins/registers.c @@ -21,7 +21,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGI= N_VERSION; * registers that cannot be written to, which would fail the test. * See: https://lists.gnu.org/archive/html/qemu-devel/2026-02/msg07025.html */ -static void vcpu_init_cb(unsigned int vcpu_index) +static void vcpu_init_cb(unsigned int vcpu_index, void *userdata) { g_autoptr(GArray) regs =3D qemu_plugin_get_registers(); g_assert(regs !=3D NULL); @@ -74,6 +74,6 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id= _t id, const qemu_info_t *info, int argc, char **argv) { - qemu_plugin_register_vcpu_init_cb(id, vcpu_init_cb); + qemu_plugin_register_vcpu_init_cb(id, vcpu_init_cb, NULL); return 0; } --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780519953; cv=none; d=zohomail.com; s=zohoarc; b=C9zU+ZCSvihG5o4uMfdxW2WcoX+TBvJfqcwdrL0kA0p7LtbxpuMy2BzyWUC3HJ60XgW9/rUrShXgvBWz5OqPGMRaM2KhkoqxZ3IAXl3CRZA5KWsfjl8Rtwd8N0Y0/ysRbRhSKGMOsOTeeZF1hONZFVBuyvzSUG0rEAygRH0G5d0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780519953; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=30eTlKxb9NXKc28gPXWE2gtFrzPIYn61U61CqJr61Bo=; b=Z9YPD6WP3q9OfVrwltRpCMtJnPVNSBN9gF1Bl6e8LchSlzmF2WGdlBfrUlVDWWxuP0R37zAIDpAP2ZeFH/cjD9M8b4EEDcjiNoQ5/TB0i70/2Zqo9eKO5BSWtw16xILWbrLViyOLdT0sYrQ44Ok/dJsQ9ZKlbuZp9n5JoRlS9CM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178051995345595.7230563714993; Wed, 3 Jun 2026 13:52:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsZa-00080Y-Q8; Wed, 03 Jun 2026 16:52:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZU-0007z2-0w for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:18 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZQ-0004Dm-TF for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:14 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653HA0xP2650440 for ; Wed, 3 Jun 2026 20:52:11 GMT Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejre9gvgb-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:11 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-3075fa5a407so1200302eec.1 for ; Wed, 03 Jun 2026 13:52:11 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=30eTlKxb9NX Kc28gPXWE2gtFrzPIYn61U61CqJr61Bo=; b=dTO9+VQfx0yBBy3UBm7JtJsMGqA f/kkdCIakGBZvgBDIGz5bkXZdzj0cUSNnX/yZKHeODWqBgF2mumN3w6u2BQvlNiy nSMgBFOomkVKb0ZHIwtc4C2TfN26vNx0TtrZpTBkRrMzdNBA9L0TiE2UET3mx95l AN/VB6oa7VnUQDE+X2HhzC1Dhllx0ja86unEFzV/PgnxqXHnl55iCG4zj6bs7eGe bjP8W/SqMPkApzFQWC2rf7pURtWUmAgtIQoMPYEK9yU9UaEbp2vWavR2uYDh66qW ZQtkPmwnLYp9Kzt+GWxpSrY/+Obu08fXo+Ut7uyrYttLjb4zPlKJ3kVJzkA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519931; x=1781124731; 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=30eTlKxb9NXKc28gPXWE2gtFrzPIYn61U61CqJr61Bo=; b=AfUjGvq9zglDp2qJ/6j9UvF4m4TDZ/PcFtGOyW9xEyjvpEuaSwz0fRsr83qFhxKRWa /Jzlr43GUR4SMF3UyfZU56XBSq2dFug9/xuHm7NpbkzpC8QPW860PPIPb33x1NzGnGuc sfX2c7m26tQ/YrOs0b7NDT+ut/QuHf8HlcKv4/u038J0VKcjyvbmrYzn4emybea7B5pU 4gx7H+lIelVeX0rvBXnLPD2M9Jb5t3w0ob38/+47ANoBF3OXsUEza75bdN9HVz1QTxip ASsgTjbtBYDNWtPpDA98Gmt1BR2AEByr3QHxWdwMA1vgM0AFN2y8Qr5Y2tGnJvri2ZBG Mdyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519931; x=1781124731; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=30eTlKxb9NXKc28gPXWE2gtFrzPIYn61U61CqJr61Bo=; b=mtyvWwxjyweZzFUNL/2bM4q1B1oe9MSKbIJV48X1gbga9lok8xK1/8F4G0ciBHBgwg BwgxVv+DS/R2dOHzOqs6xUp809x6Bh9ha55TEzpTjL2tcixmymP1glPXiZ9gaZRETGcF LSNG53Xq+8D073eWk7CYSFiahuPFHclGSvQfhvhOXFNQ6BttjQjCr+s5oyAjPinnmieD T8mkgVUzBou7K4WVSoVjj0EVBGnO0zosuu5GueVzPSg4ibAiQbmi1DK55s+pMOs8hv7r S4FUlNv0T+1bD40r0N0rtSYUdlblfAYhNDGFqkhpG6iIgyHNL4JinajCbXnGOC14AxE2 eedw== X-Gm-Message-State: AOJu0Yz6MlInvV2LALWVionVFA7DrCzkk5I2p5WQViQldYUAA+UmaqqG xNQw1Eonj88zzr5b3YhELpMuS9fuzcS2ZTIcZM1kG1YJtL212tXwp3YttgfoZ3s6OhcHRRILFV/ z3zkQ5PO2gkiet1gIOVBFGNSHc9lY732/rg0pkvHeABl8ATMQ6XPgkTBWE3HfywGNBtiV X-Gm-Gg: Acq92OGDXDoKAyoGfn/ljYfKciSseixaNKx/I8KlNaIkYeKYiIpLu8Y8D1B2SOlslfg ZgFgVtHvSnU2AoIX4vT8SSTqF2HhdCE4wLBfA5WyYkRBIS8d1munU/Ou7xlxxHYiQ9nyi4Xjd18 V6kRp2t6eWeX+J5SEjIEy6lpMP8AL3dp94DtADcvVfr+u5y0Voff9oCOuZV1Y/oF+P3Eiry6n5R mt/mAOb9IpfXPGTZWj5EKSe9GXTdeNxLyGbwE8xD81Qf6jV8xLwaO8iZsFHexpErdLtK607X3xu 9Rqg3wqFTLtpJpn5lxM4QJgKX49LMzXj3Hr6HaWy2O6tFRCdp9xjTQgZ7/PxqqqP1AuGjcE6LB/ 7Vm00piThcBUZkexoJWfAqcAN8JEcj6JJmhoL34CiHy3razRptmLKemeg8s4k6cqx9xkpEc+21E YOvqlY+SDT1cAF3HQm X-Received: by 2002:a05:7300:b58a:b0:304:ab8:f899 with SMTP id 5a478bee46e88-3074fa825camr2564290eec.8.1780519930526; Wed, 03 Jun 2026 13:52:10 -0700 (PDT) X-Received: by 2002:a05:7300:b58a:b0:304:ab8:f899 with SMTP id 5a478bee46e88-3074fa825camr2564273eec.8.1780519929932; Wed, 03 Jun 2026 13:52:09 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 08/25] plugins: add userdata to qemu_plugin_register_vcpu_exit_cb Date: Wed, 3 Jun 2026 13:51:35 -0700 Message-ID: <20260603205152.1440291-9-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: fpkFUTR6egp-3dVEyXwhUlxdgMwu_LfR X-Proofpoint-GUID: fpkFUTR6egp-3dVEyXwhUlxdgMwu_LfR X-Authority-Analysis: v=2.4 cv=KoF9H2WN c=1 sm=1 tr=0 ts=6a2093fb cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=O7a2TYNjfv3XMJ15LU8A:9 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX3e2YzZ2ilBjN ZpOI4orEoKwYC2b5oTzo1B46z3RfuzoRRt9j+g9y+eO5JOfJpgvlIdJHGInE+S+/dVy3bvuYoiM PZ5tDRYoAxGB/d0JMtc8OcdZayq4uWB1fybfhJaQRo0tMTR3qTcfMxeHJQ1Erj/ytqXZYdqc8Gg KBWLUjiubxHC7L86SOTYj/m2nuVvCK4MggbghwVh/PSxbckLRH14rCqmVmfucxE8miS9jhYEL7n ck6ZnheBstT0CitQFe41U1aRLrJx/3vuhPSe6zo/Vy9aPsxStMvMZCx2gbCVffEqWAaamhuP1xE TjhUuUrioSVke5Kd616t2tPxPXELyqMW2wQOfgXWUNu85bldPppF1Tsdt6zPiYU301QgZi3ZNhK t9R/NUZCNTtZPgxwkl93SXaOwz06DoG7XZcOUCcuaj14GRxAEOGmP/Aw6yUPPEPVNU6NQq0VwJi w0WOI2ISm0byuIkEcWQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 suspectscore=0 priorityscore=1501 adultscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780519956099154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- contrib/plugins/ips.c | 4 ++-- include/plugins/qemu-plugin.h | 4 +++- plugins/api.c | 5 +++-- plugins/core.c | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/contrib/plugins/ips.c b/contrib/plugins/ips.c index 1290a624489..2c110906731 100644 --- a/contrib/plugins/ips.c +++ b/contrib/plugins/ips.c @@ -97,7 +97,7 @@ static void vcpu_init(unsigned int cpu_index, void *userd= ata) vcpu->last_quantum_time =3D now_ns(); } =20 -static void vcpu_exit(unsigned int cpu_index) +static void vcpu_exit(unsigned int cpu_index, void *userdata) { vCPUTime *vcpu =3D qemu_plugin_scoreboard_find(vcpus, cpu_index); update_system_time(vcpu); @@ -208,7 +208,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, =20 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); qemu_plugin_register_vcpu_init_cb(id, vcpu_init, NULL); - qemu_plugin_register_vcpu_exit_cb(id, vcpu_exit); + qemu_plugin_register_vcpu_exit_cb(id, vcpu_exit, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); =20 return 0; diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index bb4569a2291..d4f8a99027e 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -257,6 +257,7 @@ void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t= id, * qemu_plugin_register_vcpu_exit_cb() - register a vCPU exit callback * @id: plugin ID * @cb: callback function + * @userdata: any plugin data to pass to the @cb * * The @cb function is called every time a vCPU exits. * @@ -264,7 +265,8 @@ void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t= id, */ QEMU_PLUGIN_API void qemu_plugin_register_vcpu_exit_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_simple_cb_t cb); + qemu_plugin_vcpu_udata_cb_t cb, + void *userdata); =20 /** * qemu_plugin_register_vcpu_idle_cb() - register a vCPU idle callback diff --git a/plugins/api.c b/plugins/api.c index 68b564bb9c2..849790fe13b 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -78,9 +78,10 @@ void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t = id, } =20 void qemu_plugin_register_vcpu_exit_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_simple_cb_t cb) + qemu_plugin_vcpu_udata_cb_t cb, + void *userdata) { - plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_EXIT, cb); + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_VCPU_EXIT, cb, userdata); } =20 static bool tb_is_mem_only(void) diff --git a/plugins/core.c b/plugins/core.c index 1d5692b3f41..15fb548f68c 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -89,7 +89,6 @@ static void plugin_vcpu_cb__simple(CPUState *cpu, enum qe= mu_plugin_event ev) struct qemu_plugin_cb *cb, *next; =20 switch (ev) { - case QEMU_PLUGIN_EV_VCPU_EXIT: case QEMU_PLUGIN_EV_VCPU_IDLE: case QEMU_PLUGIN_EV_VCPU_RESUME: /* iterate safely; plugins might uninstall themselves at any time = */ @@ -115,6 +114,7 @@ static void plugin_vcpu_cb__udata(CPUState *cpu, enum q= emu_plugin_event ev) =20 switch (ev) { case QEMU_PLUGIN_EV_VCPU_INIT: + case QEMU_PLUGIN_EV_VCPU_EXIT: QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { qemu_plugin_vcpu_udata_cb_t func =3D cb->f.vcpu_udata; func(cpu->cpu_index, cb->udata); @@ -306,7 +306,7 @@ void qemu_plugin_vcpu_exit_hook(CPUState *cpu) bool success; =20 qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_RW_REGS); - plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_EXIT); + plugin_vcpu_cb__udata(cpu, QEMU_PLUGIN_EV_VCPU_EXIT); qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); =20 assert(cpu->cpu_index !=3D UNASSIGNED_CPU_INDEX); --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520018; cv=none; d=zohomail.com; s=zohoarc; b=THq2yAFY3oabUS94HVsKJme6eujw0Fh8xFEImPoSkwY+0iDOxZU/FtmFUUSwHnsuNaDWlDrosCVc5e+bNLChY9sPdioGR5SnXUPotI4AQ/Qr2k6E754wg+6D4GI6xP3h/8+LDyZoYvYOSJxPIj2VotYu4BrBBIEFKEHDwtKAjEI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520018; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bNzpG63Yigt97XcfKyuqNMGgW8/n53Gf74/534GXLd0=; b=ad7IIJDKzgELBwLMoIW1anm5Z8SIYYjs1qtPAllXRVSTyjbx9jnZ6nMRPA6qB6nqezOMb4jz3pVB75P+G3ePcYPgwj7B4Li9HvV98kK0htxGB/rNpzhFhGrtuhHotVKpo8fdoM2XOtvM+Ag0ZyKvEgZpNCOktdhguSMKzDs8vkI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520018391661.5537377878134; Wed, 3 Jun 2026 13:53:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsZy-0008Bz-Pi; Wed, 03 Jun 2026 16:52:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZY-000804-IU for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:20 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZS-0004Ep-QL for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:17 -0400 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653HvwOe3233934 for ; Wed, 3 Jun 2026 20:52:13 GMT Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejs4s0nbu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:12 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-307625ee07fso1179922eec.1 for ; Wed, 03 Jun 2026 13:52:12 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=bNzpG63Yigt 97XcfKyuqNMGgW8/n53Gf74/534GXLd0=; b=nprlaFcWQ44mxif7Nz3LWb57CNX 1w79DqpZ0RLfBVT3EQlm0/lYU7vyRtKtimezVMJJngSMD+33W/LLoMMahQk46g4d wW1Yen4bt9QiWsr4vk8kgdNt+tZE5/08/0hejPJGMu01Zy5WXWP9LM3YXQNHTAxT Xcz/jFGJjSrTOtNyphdb8MoXRTRS39lUXBQiC5owIUbsM/UgMQ6En8vqo1kiDcsC hJjV0mIZWXkMdKIXucuFvli/ocSpjb5AtMng+Qf03D8BPdUxq/B2p2TBscRRxKUv 3kLmSTcIIOHbXX9HTrlvuFAP+MT843zGg5DBfCRkTp7z2SHy24WPeUc7TQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519932; x=1781124732; 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=bNzpG63Yigt97XcfKyuqNMGgW8/n53Gf74/534GXLd0=; b=cTNGchQg0sybTsVilELzCYQCDQon15ePS18efYzm2M8JJQUc+fz7ype9Jy1LVvAmMT CK6tlgM8pHgTYm6z6t2PYGfedfcQoJwzf/6gGI6by97vQofq4d8qkPl3pEbG3BFgGhnH OzprusssUXxaqV9pT55BvIZ9MUtDwj3OczfU0ujhyXH2JVzuq2OSI54+w6kUevibfsFK GyNnxiTfOVrpbBqnCikTIhTQKclEQ/gaGRqWqHsbyf3I6WfpXVonYmN3NVmmKUGaJvgc eHE7g/iquZ17XQBhHEN7lVWU2e7n4Sx4Qy7Yy2pftHbkX2JyXWpo7BSKVLWzQVFz/JYl 2vAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519932; x=1781124732; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bNzpG63Yigt97XcfKyuqNMGgW8/n53Gf74/534GXLd0=; b=WjtaV4qX06a5J0IM5jGBE0aB+ddLotuUhrHgASnK7bjoOW1m9/SLhOBwdyMmrI10sH M/DEGUdgIhAyxTR5zo7M+Ootx+T7L0LncCVN3fkvR8QK/CLpwh3+AcCu4BP5yDvr/G+/ D5ma1s/q/Y7pxiCzGeGJae4a5F/n9T4AyuV/PodHInnFHKNWEici8+DzbrtMHxXTro0z s0orRkdrzBn0sx2ZZXxErTk7GZnQLDMQv0ra7twyCxLbTBzdzs7wGooiP9mbY6OcTy5g wGvvdWx9RBTu7WGAq9Qc9ZlN35+bwNYjRAsGCLgais4/u/oCR9iDa9Rb4IWoHACg7R1X biGw== X-Gm-Message-State: AOJu0YxZVvypThTf1YIkK2dEpjN1CdOq8m5kEiMpr2KhB+XJ+mX3v/u3 FX9IiWr8oF3IXDLXxn3DtPrI/VyP7X4WTfPZ+tzIIK8/6oEyTeKFKjVgG7Q0WGHd9oEiBqv3ept H2fnvVQ7zexa38Y5B+DGvpcDu8MN/gOh+EDvv2Q2B5kkEw8+wKQ8yAOf6ijSHpMGlcuCq X-Gm-Gg: Acq92OG+16iX63M3dZPPhcCo6y22FvqcEBCo8iEzMSWliZD2ShydmVQNWUmvn/P5M5X QsVXl7Np25inG7GbUtpsPzfutH93i81cPGweQuG5LZwOip2W/oVoWAhHF0ZTCyv3yZcwSB8kH2b jxFvu9AI20erzdMDeZoVWkzHIcH8Rop6mpBy/90TpvX1/Fb8ARIoc5iCsopWnKuzimnwcKT9FgL 8mo2/mAGeDzrYBmGLJy9epm/HySX3UeJ30FibuKL1blv0zfsEs6yo8Laz8SVHaNMV4y8Gra6EYs 3OJTX4Gqu65axYbMWUhPJ5+jdlHmge7yUhCIk59T31FGO5fHyldc3NgpvLmLrA+lJaAqrB4Uj2c cg80zJKP2+wOGQfBkqGjHtAWuUDE9r5Nlouli9PVCLVtMzECqGuv8IFBjeI/GS4OOxlmnmJadX9 8D/6IgS/2gTRDa0mEl X-Received: by 2002:a05:7300:4347:b0:2d1:d434:cfe3 with SMTP id 5a478bee46e88-3074f840d0amr2872226eec.0.1780519931960; Wed, 03 Jun 2026 13:52:11 -0700 (PDT) X-Received: by 2002:a05:7300:4347:b0:2d1:d434:cfe3 with SMTP id 5a478bee46e88-3074f840d0amr2872210eec.0.1780519931431; Wed, 03 Jun 2026 13:52:11 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 09/25] plugins: add userdata to qemu_plugin_register_vcpu_idle_cb Date: Wed, 3 Jun 2026 13:51:36 -0700 Message-ID: <20260603205152.1440291-10-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: dQPv5LdN95TVuT2CUjw6YsfXosfcGsO1 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX2hIyqIfRilxU cP7EpRk72T7XE9REMjJcaHTovMB35aJ0dVWAw4kfl3WJEYIKTSMhDXhkbC4Qbd9JST9R0rpxadZ SJLMthk6r2NBRGF4283JxJ3Qz2Qz5PCGE+MsE/eL56A0bomApLr55aLFI5UUnsddgouOgYDr5DL 0P8QeDQFqLkS8xDvpJIEMMAsGv1b+ZCWK0SkXxJ5AqS776Rzvu2pMcMTU7G6CMp28Z5ZA+0rfBl Dm3lMHKNULSNXT+TCdSgtONXNGSFmNrFBiwFupilfGnPtVReiKMVKh4PM86sPS4bzZz21Xj7EYY ylOux5HsCkOh19BXwjtoYLaLtrmh6b50eqnLF/zAm4L9ARn12r+TnCoeIxj6WdRvYWmaz+1sM2y L6hS9EEiLVbzWgjV+bGVWUWoahz11dPPpz9f6PsLMzD2ywNlwsYppZ0jw6efel9lF1kqV01Ndli X29G1t4gtP/duJ4sLcw== X-Authority-Analysis: v=2.4 cv=afRRWxot c=1 sm=1 tr=0 ts=6a2093fc cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=1QjUMDCEHWFJ5QTWXisA:9 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-GUID: dQPv5LdN95TVuT2CUjw6YsfXosfcGsO1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 bulkscore=0 phishscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520018692158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- include/plugins/qemu-plugin.h | 4 +++- plugins/core.c | 9 +++++---- tests/tcg/plugins/bb.c | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index d4f8a99027e..75d2a69a3bd 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -272,12 +272,14 @@ void qemu_plugin_register_vcpu_exit_cb(qemu_plugin_id= _t id, * qemu_plugin_register_vcpu_idle_cb() - register a vCPU idle callback * @id: plugin ID * @cb: callback function + * @userdata: any plugin data to pass to the @cb * * The @cb function is called every time a vCPU idles. */ QEMU_PLUGIN_API void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_simple_cb_t cb); + qemu_plugin_vcpu_udata_cb_t cb, + void *userdata); =20 /** * qemu_plugin_register_vcpu_resume_cb() - register a vCPU resume callback diff --git a/plugins/core.c b/plugins/core.c index 15fb548f68c..111ceeea285 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -89,7 +89,6 @@ static void plugin_vcpu_cb__simple(CPUState *cpu, enum qe= mu_plugin_event ev) struct qemu_plugin_cb *cb, *next; =20 switch (ev) { - case QEMU_PLUGIN_EV_VCPU_IDLE: case QEMU_PLUGIN_EV_VCPU_RESUME: /* iterate safely; plugins might uninstall themselves at any time = */ QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { @@ -114,6 +113,7 @@ static void plugin_vcpu_cb__udata(CPUState *cpu, enum q= emu_plugin_event ev) =20 switch (ev) { case QEMU_PLUGIN_EV_VCPU_INIT: + case QEMU_PLUGIN_EV_VCPU_IDLE: case QEMU_PLUGIN_EV_VCPU_EXIT: QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { qemu_plugin_vcpu_udata_cb_t func =3D cb->f.vcpu_udata; @@ -626,7 +626,7 @@ void qemu_plugin_vcpu_idle_cb(CPUState *cpu) /* idle and resume cb may be called before init, ignore in this case */ if (cpu->cpu_index < plugin.num_vcpus) { qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_RW_REGS_PC); - plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_IDLE); + plugin_vcpu_cb__udata(cpu, QEMU_PLUGIN_EV_VCPU_IDLE); qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); } } @@ -659,9 +659,10 @@ void qemu_plugin_vcpu_hostcall_cb(CPUState *cpu, uint6= 4_t from) } =20 void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_simple_cb_t cb) + qemu_plugin_vcpu_udata_cb_t cb, + void *userdata) { - plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_IDLE, cb); + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_VCPU_IDLE, cb, userdata); } =20 void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id, diff --git a/tests/tcg/plugins/bb.c b/tests/tcg/plugins/bb.c index f29b466dab2..ba605246eb0 100644 --- a/tests/tcg/plugins/bb.c +++ b/tests/tcg/plugins/bb.c @@ -56,7 +56,7 @@ static void plugin_exit(void *p) qemu_plugin_scoreboard_free(counts); } =20 -static void vcpu_idle(unsigned int cpu_index) +static void vcpu_idle(unsigned int cpu_index, void *userdata) { CPUCount *count =3D qemu_plugin_scoreboard_find(counts, cpu_index); g_autoptr(GString) report =3D g_string_new(""); @@ -124,7 +124,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, counts, CPUCount, insn_count); =20 if (idle_report) { - qemu_plugin_register_vcpu_idle_cb(id, vcpu_idle); + qemu_plugin_register_vcpu_idle_cb(id, vcpu_idle, NULL); } =20 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520042; cv=none; d=zohomail.com; s=zohoarc; b=m9Sw2fq3QDP/WhlWTu6YGnMZFpyxnO8A3lIOXvxgB8vwdDlpev7WlfCxWBtljJpDTt3/Kio6VYngn9LVQRVcawR9Rdt4pPhzHPIBJsSQU/WMyiGwVdUPtimKLWxlghoOdI70RTd/P5TyF5ag/ptoep6HM32i3rRYDyr7GsWqsLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520042; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=93IDN7wiimWZkhMH0DM+l8cxRFMawbmqsxL86VRHJUs=; b=WMYuD+OCtsYS7rDhJIbXqoT0MUFzGwEgBAmDRUMgBUCaGKVEiBKJe5oogGyMILbtTKy2bFEwuR0BsltFEF1BPV+9DjpMDjVh0LJKcJm7c598bmw7HValtDSmGo5QbjWOi7cVoxJwOHV1OtnVykdeaQMNT/Mreq6VIVUbnxo9sCs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520042883147.4388028255422; Wed, 3 Jun 2026 13:54:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsZy-0008By-Q1; Wed, 03 Jun 2026 16:52:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZY-000807-JN for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:20 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZU-0004F5-9V for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:18 -0400 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653JUgks2076092 for ; Wed, 3 Jun 2026 20:52:14 GMT Received: from mail-dl1-f69.google.com (mail-dl1-f69.google.com [74.125.82.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejev1bmnj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:14 +0000 (GMT) Received: by mail-dl1-f69.google.com with SMTP id a92af1059eb24-137e49e896aso720054c88.0 for ; Wed, 03 Jun 2026 13:52:14 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=93IDN7wiimW ZkhMH0DM+l8cxRFMawbmqsxL86VRHJUs=; b=Vvv4/8FlZI5e7jUnXqfvH2WrtBl bMRFxt1cMZHLsZAcG/cWf1R2Jm0eq08gnNm9Oq61r2oPNtJOeEX9CcEEFhlQ8xvS gKSpPgZzVB6ZQ5Ei7jlGCJSo5tUhGCDCaTeBncPORzlJT6Vu/AJ26iMvou5JqniC U1RS8AYquazl3tvULT2m3R6NXrmprT6bw6L/AvoAUV7/HlwLSO9UsUa0LyNBHCby zSFjCyURhJAt2JOySNeqa9HzjDZw8WG5AewuO+3t5eksxlO7Mk1VyrWeAw8KOW4s T4jNxt9/wufIbdmpiO9FilbotoPNnyVyet4yckMGgwXSf/FzXsNCfd7vTKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519933; x=1781124733; 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=93IDN7wiimWZkhMH0DM+l8cxRFMawbmqsxL86VRHJUs=; b=WIg6P07gHD/EP2/jfZ0h5T2HMEvHD8Hv622byT0gRgh8PHr1sc+G9gzp57rJWKzspF y7BUyS76/dfu227vnQhc3mEV1ubi9GKkSq4X2/HJtFMyFBPh1maVUDDfQrMLtbaLQdzj OfZfB3Hwf1KClGmqdnFqJhfVNaZxOn8Su1BAkYZ0L10XHkuqPFQmLEI8DGLg6rlKBzUA UQa4eZdA65s3d9C5S9Yl0yarYUyx2nA0J7JIYXL8exE6dsmluwHsWGuxPYuKjl3hRXKQ SjF7baLbdUAZpxP/f8QwVq4tgSNKgOjq0NJaCDwDIzZY9zfBPRk/K0q9fV3krozsL12R 80AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519933; x=1781124733; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=93IDN7wiimWZkhMH0DM+l8cxRFMawbmqsxL86VRHJUs=; b=LRoseREouNWqlU2LCuR5LtWBSJICTne1sAtyVbmZwhVu4BoEEI8iImQoJzeRbyTjmu p11765Ce0vfqfPJDfmsst41GmOdC1SQGlcZfd8I8LkDJN56P02KwWeo4sFXugh5EoVWg G/T6GwUGknz1nOlQkr+LcBSjtDuUGYsJ5DBtwaqUgFOrpYZlsSaiyiiKZBHT/rjxchXN JUOEjQ37m7XwvE+7ZpZERMa4z03FfCkZiFfQnYpWs1yFbnDZORhqy1dwtwL+S1OuOM5P kxjNwuKY6HWaoU83ysZv+GjbXBAh7eoRdCH5rBVD8K8mAqevLjrd+FsS62jyDf3DD0yn VEpA== X-Gm-Message-State: AOJu0YzgSdahghiSKhJ+j3abTuspx6CzyaQXPW1f6CS/NMRmAa8DCoyP 64GKV2whLzmIrgfHJSOgsHTtB0HBI5sPYT5j13l3djLitrSPFiJhYu5+N9QNTqzfXW+oVyqcb7n ckJXrTID7E7cx+ci4Tk0T0ZkFMF3C4cvMCL6dX4QQ2DxboY7sdtOO0LSJrv4sRVdTTMiA X-Gm-Gg: Acq92OGW8NK+vewFZbpZEpQgnlcQBk3q/Tywu/BRjZ/zbDTd8J1dTGpoPmBHke4VBtc 96ippsU35i7swFahKLeR9lhFjd7HqkVyhBXBtmOZbxcYMXjnwlHp0ejerTExAu1IIBvLzqRZHm+ Swby34CtIByxggp+NZVg/haxd0m+I7lFVVUKCG7xKepIHpJcj9if0DuH4mYvOGoJKs9p1AlHJjM 3JL3Uc7uK0vcu3dZeTZRkvfNTpG+nnBIH42a2rD/pSeJu/3opYb+MNc5PbwFynu7+GHEG/QEJbZ ZMcz0ol2bvnHSaGCW6n0PQZCCkfSCqU4hUAOnN/+U8Yv9MC5OnTk5Wsnzxx3ka2pLvZsnbmORX5 IJ2tCwISvoiHHYicKQ6PkYwGfKTThPLPbrpF7WaTXrMgPPpBm01n1gWWjne0BywZ2DwGrKUccpF 4JjYRqO2wM0kQdQC3B X-Received: by 2002:a05:7022:62a1:b0:137:fac1:c052 with SMTP id a92af1059eb24-137fdf4c45fmr471169c88.16.1780519933307; Wed, 03 Jun 2026 13:52:13 -0700 (PDT) X-Received: by 2002:a05:7022:62a1:b0:137:fac1:c052 with SMTP id a92af1059eb24-137fdf4c45fmr471153c88.16.1780519932687; Wed, 03 Jun 2026 13:52:12 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 10/25] plugins: add userdata to qemu_plugin_register_vcpu_resume_cb Date: Wed, 3 Jun 2026 13:51:37 -0700 Message-ID: <20260603205152.1440291-11-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: VT8HgvCFZcou5PSXVIstERAEuD0jMXbI X-Authority-Analysis: v=2.4 cv=PNE/P/qC c=1 sm=1 tr=0 ts=6a2093fe cx=c_pps a=kVLUcbK0zfr7ocalXnG1qA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=jbUUBHnpNWWeZ8W5LfIA:9 a=vr4QvYf-bLy2KjpDp97w:22 X-Proofpoint-GUID: VT8HgvCFZcou5PSXVIstERAEuD0jMXbI X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfXzpwmwzgKSB9l X6P2dWOpi/0QCaM1Kv1CPPvAvlKa7xtgb2P8Obl+kmVV+8k/hryos+7KW7KKhNxc1EM5/XdZj7g aRelAXraXzXW1kpNzCduAUI6aqJAyGil9JNoXGxZDPFJ+6PVf2tbRJuFVH0PbPwwNFZa7iADVe4 0Tci5VnunUmGfxFTRui7ec57evyEE2pCSIsT/87AZ2IAnN9egLzh54sBELRTvOVALdTEoxBU+U6 Grmdlcymn2p8DIYB/GWpFt25HvRdX98rsQWbZs9vC0bEwoE7fCsvXxBVVZaPk/tkeKUrIkbtluj HIe6p7qogpbs1fwIR7HF0zfTUMvdMCbcbc/3pxMnJ1PNdpEJndKjUQkf+Mr7OsP8Xk/GICWyDN1 7m9H0KaEgnU45ipVhvhXIZM6HhehiFNoAG1IyHaxM1qCu4vnnTDeLTni5gM0JQAgm90QNEJA0f2 EHV1DyXIS1++VzWqLFw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 clxscore=1015 malwarescore=0 spamscore=0 adultscore=0 impostorscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520044944154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- include/plugins/qemu-plugin.h | 4 +++- plugins/core.c | 31 +++++-------------------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 75d2a69a3bd..8c146ea49c2 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -285,12 +285,14 @@ void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id= _t id, * qemu_plugin_register_vcpu_resume_cb() - register a vCPU resume callback * @id: plugin ID * @cb: callback function + * @userdata: any plugin data to pass to the @cb * * The @cb function is called every time a vCPU resumes execution. */ QEMU_PLUGIN_API void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_simple_cb_t cb); + qemu_plugin_vcpu_udata_cb_t cb, + void *userdata); =20 /** * qemu_plugin_register_vcpu_discon_cb() - register a discontinuity callba= ck diff --git a/plugins/core.c b/plugins/core.c index 111ceeea285..aa9240fe21a 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -78,29 +78,6 @@ void plugin_unregister_cb__locked(struct qemu_plugin_ctx= *ctx, } } =20 -/* - * Disable CFI checks. - * The callback function has been loaded from an external library so we do= not - * have type information - */ -QEMU_DISABLE_CFI -static void plugin_vcpu_cb__simple(CPUState *cpu, enum qemu_plugin_event e= v) -{ - struct qemu_plugin_cb *cb, *next; - - switch (ev) { - case QEMU_PLUGIN_EV_VCPU_RESUME: - /* iterate safely; plugins might uninstall themselves at any time = */ - QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { - qemu_plugin_vcpu_simple_cb_t func =3D cb->f.vcpu_simple; - func(cpu->cpu_index); - } - break; - default: - g_assert_not_reached(); - } -} - /* * Disable CFI checks. * The callback function has been loaded from an external library so we do= not @@ -114,6 +91,7 @@ static void plugin_vcpu_cb__udata(CPUState *cpu, enum qe= mu_plugin_event ev) switch (ev) { case QEMU_PLUGIN_EV_VCPU_INIT: case QEMU_PLUGIN_EV_VCPU_IDLE: + case QEMU_PLUGIN_EV_VCPU_RESUME: case QEMU_PLUGIN_EV_VCPU_EXIT: QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { qemu_plugin_vcpu_udata_cb_t func =3D cb->f.vcpu_udata; @@ -635,7 +613,7 @@ void qemu_plugin_vcpu_resume_cb(CPUState *cpu) { if (cpu->cpu_index < plugin.num_vcpus) { qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_RW_REGS_PC); - plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_RESUME); + plugin_vcpu_cb__udata(cpu, QEMU_PLUGIN_EV_VCPU_RESUME); qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); } } @@ -666,9 +644,10 @@ void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_= t id, } =20 void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_simple_cb_t cb) + qemu_plugin_vcpu_udata_cb_t cb, + void *userdata) { - plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_RESUME, cb); + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_VCPU_RESUME, cb, userdata); } =20 void qemu_plugin_register_vcpu_discon_cb(qemu_plugin_id_t id, --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520105; cv=none; d=zohomail.com; s=zohoarc; b=RuCT550chikJNiYiVWXqo+WqiCYCMrvQG6SEVFTaEg2IjZp7+UHY22Ry3NlOqS5RKm09+vi36Bw/e0tHe1Hbs7wP+NUHrU4tiBfLxMszLKKbWI3A/0KA3+GoUtIM/oEBPiAlJVimpClAi/1qqI82nDy5VvwQa+wuP1qTY6SWGik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520105; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Io4yuv4tevIOYY189QmremHgeYn53Ys8ay1vkrP1kNI=; b=npsTm+VCSS6kMdbnEvdnWjZbID+V2wwhKq9JANSQUks27uJaiCWSy7jdF/cSIQtnZ/prguNP61E64G0uwk4VM0xt5lgBQGVXvxtWFD1CJZ+uBoB5ss2ibwiFBiDxDcLsVRZSrRQTcGHSO7WcE4330s75hTzz88ahkogf4Jsbi6I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520105037103.0123883841926; Wed, 3 Jun 2026 13:55:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsb1-0001wz-Br; Wed, 03 Jun 2026 16:53:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZd-00082K-82 for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:25 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZU-0004FT-TG for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:21 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653HA02L2650441 for ; Wed, 3 Jun 2026 20:52:15 GMT Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejre9gvgn-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:15 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-304d0d0b28eso867101eec.0 for ; Wed, 03 Jun 2026 13:52:14 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=Io4yuv4tevI OYY189QmremHgeYn53Ys8ay1vkrP1kNI=; b=Y1DajhaTEW+KTbEhstKLTFhIAV+ +fLtiqOPYtHAdzzkVTdqxjHjZrU98ELYSRdXZN+ek0gAaXh1F1UJjnojUjYbBGjf +niso9abW5S+SYhoWuyTujkOGBQIEs6tfjFhdYWi5scVfHqkEVYtW+km3YScAPvr 9FSEsZAoKZd60opK2W5bivTuRxu1uGF2vlbbU5dPFpwd+ZG6J6Nx/0bsqVQV4X2B e8oG/DakcrKr6t4tm9JJFWKMHR449ZCakdhCWjONHqrDwUSmJW0j5/mNFqF5EV/5 FsrTlUwCcPrkrOA2LJLk2UlAG7pkqRs1L/4N8b1WfgoETrGAQyq3Wvp5lQA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519934; x=1781124734; 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=Io4yuv4tevIOYY189QmremHgeYn53Ys8ay1vkrP1kNI=; b=FjbhmEMKsAwP+5qOLVh5t2uwiSXTCUKleA0UwHfWAJEmRER2NpRpGhm8sfLwa9G0wN BAz1IT3RSf6LeYb6EpB0IbRjw6DmILysCFDnzzzhu/jaNsCFWagjBpCmX6+cl/0B4m3b UnYGUbHZiXiyRvrdcU0omJeByj2oDKdri+hl/4GzmbVGxQ1zZOP+aH3ADeWMoS5LdRJy 005Sjtut5vznQfYFhoRKtzJbEvQ3ZPOT+dZfNqER6X1iVW24fDL/ZFKzYZUtsMP0Myb1 dC9+nBEygS0wI0F3BpFBy0xXUlfJXFaOmHD8NdEMivlkHovuzCq+jKZ8+8QkWBAspK0Q a/+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519934; x=1781124734; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Io4yuv4tevIOYY189QmremHgeYn53Ys8ay1vkrP1kNI=; b=OHsd6OXaggnFM/bsB0EKpbbYjwuBjFMukmvK81FslU6rRPVd0b6JoeNNB/bhZIKerb fPc+sX4SshVCJGicccqA0JvQP+aUYWvXVXEpbT7DUM9c2blnG1JIF9Ir++82bhx+IPb8 hYpyu4c4Ua9LD33GX+wf2xBh6lscSUjuEZDUvobXWiUhRo9fSa8klOELzpSmGJxXJ8iv hHucq2+ZHssfTgGX6cJF+Chew79RkIR0znXYGjsQXN1iAfaUAfnZqn1Vv706vo0qYt09 y0How80o3La6nDJgPmnSwp3oSJX4djmsLApyFDPvi7aMmlHZozCeervN7zjqRrb/3PoG Cc3w== X-Gm-Message-State: AOJu0YyV/FrePgWGEkfJGo9HTsbtEAhHAHHPhUlrJWMgVwb5RTG/rjHu OxF+QWCF4nwggvySDSfW8NtPYiLQAbwKSqJ1N1eZpEId/UQUGeb5HV8xcClkcUPzlm1w0rSXC3a vU8ZR49eWvZHbFPqVCS1EDYjVatiQdj/yJCTPp8/NwfxQa1Iv7KEQrjmGhTXDfI4tktLi X-Gm-Gg: Acq92OHrXNVsOWaPvkzEXjRkTHOlLf8xbRoDcm/Y3HwB26rPw2gyDMeWgJ0sTLpr3sl XkeKmOkzFppLuzPJS4HM8t/CxZqsX4eN/ckWxxj5lusQSyiET33vaU2sZHNot1OMJCJHqcpOLhw 7lXtpWyhOgzKRziHvHRLiPsd2X6v9QjuZu103cuhkJl4UaFSThwdRuwWifRkCaJ8OF+ADclxb0o GRg1yuSI65OCplr9DS5uT2Z1+cTmULCipm68mBQnLp8GnIB6+SxwWcGgdt1Rah9AnzU16zQmu1F /syIUm5JG6hvWJtrwPqY4w05GSF8LUl70nGIM0M6xb2EYCeXPFloQn5l4+QfVewcBTLwsbQhNjc mwrBnCiXc88WxSyWdkQAvjqVcYmX56jcmVBFzY+PnCO5PlWqQd/qCqlHtv3ls8h3A+164Ywi9J3 vHwmPnL6rX2uFpX0JE X-Received: by 2002:a05:693c:23c9:b0:304:b15:17d6 with SMTP id 5a478bee46e88-3074fa5732amr2319301eec.6.1780519934105; Wed, 03 Jun 2026 13:52:14 -0700 (PDT) X-Received: by 2002:a05:693c:23c9:b0:304:b15:17d6 with SMTP id 5a478bee46e88-3074fa5732amr2319291eec.6.1780519933568; Wed, 03 Jun 2026 13:52:13 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 11/25] plugins: add userdata to qemu_plugin_vcpu_for_each Date: Wed, 3 Jun 2026 13:51:38 -0700 Message-ID: <20260603205152.1440291-12-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: CEQVTxwTZmk9Dl8HQ2wwpTqtmbjMcTT- X-Proofpoint-GUID: CEQVTxwTZmk9Dl8HQ2wwpTqtmbjMcTT- X-Authority-Analysis: v=2.4 cv=KoF9H2WN c=1 sm=1 tr=0 ts=6a2093ff cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=cNRYNflkPMW_Fags0lAA:9 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfXwyBNMKyyaOSc nV78pVWxjxubF9DzFXJrYGZkUMJ2j08a83S9VARJo1zn3T3ukFGRb1JRlxJGaSQjy41mLRCzXlM wNTj52AORJZQhkjAggy8bJYl5C8cK80XZtcCnuXJhgTP3Op2M6G2se1oeU8gUUfBtbAUjiFmcjP bsrVzepEpovYw+8Y/+WGMRmZ39wKKQoXC7Hf2Ce19HGitksr3bUMxHzogzXqxJTqiw0JyDfoYJd QoVtABzoziK15MUquuJV4D3G/9DOg6zhp5V3YIsQT+AnfCrOLMm78QjkDmBSaN6UoFO+0xYHbJx DxYFeddQAMn7HYVbvU4YY/aIUX6BySLJ7ds+llxG0h8CuqjEQRnrRs/TetoCrSKUDt/+C7TOgPH nnjI6SIyJzJrgHG3Woz0G9BiEMHVduNr/UrAUPv3Iwa8bNCNj1ALsIprq9g/B2+95xAaCglJ8my lVX88tZ3JUTNrZMyQ0A== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 suspectscore=0 priorityscore=1501 adultscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520107100158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- include/plugins/qemu-plugin.h | 4 +++- plugins/core.c | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 8c146ea49c2..320644a2f0a 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -957,6 +957,7 @@ const char *qemu_plugin_insn_symbol(const struct qemu_p= lugin_insn *insn); * qemu_plugin_vcpu_for_each() - iterate over the existing vCPU * @id: plugin ID * @cb: callback function + * @userdata: user data for callback * * The @cb function is called once for each existing vCPU. * @@ -964,7 +965,8 @@ const char *qemu_plugin_insn_symbol(const struct qemu_p= lugin_insn *insn); */ QEMU_PLUGIN_API void qemu_plugin_vcpu_for_each(qemu_plugin_id_t id, - qemu_plugin_vcpu_simple_cb_t cb); + qemu_plugin_vcpu_udata_cb_t cb, + void *userdata); =20 /** * qemu_plugin_register_flush_cb() - register code cache flush callback diff --git a/plugins/core.c b/plugins/core.c index aa9240fe21a..a5aac1062aa 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -296,18 +296,20 @@ void qemu_plugin_vcpu_exit_hook(CPUState *cpu) =20 struct plugin_for_each_args { struct qemu_plugin_ctx *ctx; - qemu_plugin_vcpu_simple_cb_t cb; + qemu_plugin_vcpu_udata_cb_t cb; + void *userdata; }; =20 static void plugin_vcpu_for_each(gpointer k, gpointer v, gpointer udata) { struct plugin_for_each_args *args =3D udata; int cpu_index =3D *(int *)k; - args->cb(cpu_index); + args->cb(cpu_index, args->userdata); } =20 void qemu_plugin_vcpu_for_each(qemu_plugin_id_t id, - qemu_plugin_vcpu_simple_cb_t cb) + qemu_plugin_vcpu_udata_cb_t cb, + void *userdata) { struct plugin_for_each_args args; =20 @@ -317,6 +319,7 @@ void qemu_plugin_vcpu_for_each(qemu_plugin_id_t id, qemu_rec_mutex_lock(&plugin.lock); args.ctx =3D plugin_id_to_ctx_locked(id); args.cb =3D cb; + args.userdata =3D userdata; g_hash_table_foreach(plugin.cpu_ht, plugin_vcpu_for_each, &args); qemu_rec_mutex_unlock(&plugin.lock); } --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520077; cv=none; d=zohomail.com; s=zohoarc; b=gLMNRx1gWJgSqOLVZjQhDlIwQz2I90x4WDXYbmsDFB3pA7ndCqs6wNXWoyCTqF4C9C0i19DNSXH0KzGmWZDSfy1lEwXOlyhTZ109A4MAMhBYxAtkQK88hNVehOecWdD7wbu40lToQKYSMUHqoADWdBI5G7BWqQvqb7YKGxIGTKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520077; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nF9LqZx18bG3EfHDJMdpL9kLXE5N189/TK0QSN9ACyY=; b=WfR3KDJQG/AKGO+3OcYPzUardLz67xDlfVC62ZIf6vV9+JdwmjCnOWfC1rn4VVb9QEzbrOCj+hgESb9+v+tXLcbQXWU8H/SpChxjlgeC6JGIe0KBWFMk0rAgLDET/SzlbQ2zZIiQdPl8p/JcLuQN5QQJDv7C2yqPyX+Xw7MuOo8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520077269606.4350677021778; Wed, 3 Jun 2026 13:54:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsb3-000270-7g; Wed, 03 Jun 2026 16:53:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZi-000852-A9 for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:31 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZY-0004Fe-A2 for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:25 -0400 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653Gjew42262005 for ; Wed, 3 Jun 2026 20:52:16 GMT Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejr2mh0uf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:15 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-307625ee07fso1180176eec.1 for ; Wed, 03 Jun 2026 13:52:15 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=nF9LqZx18bG 3EfHDJMdpL9kLXE5N189/TK0QSN9ACyY=; b=fdl6MAW/GPq/F+xMlHFGfjw6NzN KUPG1EwGRnFKcJw5WkLxkaoDdGYBPvuVeZtVxdhux0gwls+/j6o3goNrV8hu1cE8 /JltOkBwEubdXawRe/PiOaSVlu/jLA1y7KhlFuLR4TdNPnd6PHjfI1Nffq5KiP1U hGS8iIhmHlPpAUbOgAIcsf5VS1qAok40OinYwmm7ntDMx26xTNtPRzXiO9U6UNzn CT9dcxOgvsoUd/dXkFJVgRwpQtFiTaVppUQ6cCA6+g/3vNbN4Lz51CuiI9+CZhqS N9eN2WQagzJwYnJyPMbo0uUmM91N9Lg8UNuljm+fCcmIYvzkINNYTMW0jiw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519935; x=1781124735; 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=nF9LqZx18bG3EfHDJMdpL9kLXE5N189/TK0QSN9ACyY=; b=V2JTzCWMdn7ypSxGb/XjhQcrnRnryw0O9Y2R0bTyxE8feKh6WFT/ZLmUFVeE6go/Eq GfDcSzda0Y129rbBDMhLExDIAsYck5JY27NAi6RZ1r2lIOYRTJOOl1TASxP5PShssuST cTJ4a8ZpKLFCSX+vbuAn8UfgV2a0rAopy4GzucSa4wYHx2crA8Q+fNXLd7d3VuunIHg7 Rw7LsuOdN/h+45CQqm1xkc5KgT1PBtuoado5xPZ2bsqgEQDEwGc/EC1G2jC/Mze+S8S2 1N0f897uLHeK4CPDITJmefxk7Ryh3X6bqpuKW+tT8K9znq6saIPoVWHvr3pnL4D3Q7SL /dlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519935; x=1781124735; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nF9LqZx18bG3EfHDJMdpL9kLXE5N189/TK0QSN9ACyY=; b=sSmZMX03O/MCTXKkmopxCGlSQfYKfJFZAru/5K8YCbBB3tZRdMWERPWwcY1bnFwISb wW93t+OTaB92JvDsB/SPleQyMiG69PublT3/2T+4ps0YmlmZbUrtMBsmJDNHmOJw6bL8 q0ovjylsN9XI94RcuTg3WuHpOn9ZubYj/6V2ufV3VADBQhWG0S0JKNXQsf99YZbgMJsq A0C5gmiwBC0LpeOU5AGdR/81FXPzjTdW+Cbd8xxk10FH222dQgH9sEsLbFdqriB67Ksx fs5Ktpru28nlJmlRfwpEHNF8QzCO35jX01Au15Bfrp7/+hvTTOAonwpP0IjgZbRSy3cd 6YUA== X-Gm-Message-State: AOJu0YwdVSTtl/z/fjIZA9pqwB27jjqf9uWhia9H7pIMfEdpt5ulJvLq 7l/Y377fn1fUABCiawzFXkKF0Iyphwah3TZR7I8PejPCtvCKun9R6gqz1l719wLT/ymTi4iA8et VqgvYj9xkQuR9my4VKFLYuWjdr8lL//TXVuscd2Opbhvyj8QG2Ipb4AE+HuIUuplhak4W X-Gm-Gg: Acq92OGuI447Lc9S/W/15o+WbbnWL8U8wst1NWwxPIHJ2Y2ECDoKUFddwLKjTGKoiqL oU87xzgtEj0/fInJXukRLx41kUrE3XpoPiEeFhHTf+hy2P42lC31hsHkTn+BCIhTjvRCxDFfGVZ 6c+yCPoQC0EZa0eKtpj5H+nrvD0SuFj1LcJBM34hKqIjL6lidqtVebduwIGaiTitlJpJopeyZvm +rPsMJKEPheqrgO2iijtrB8cSboRTRrfGkO99nXCnDr4bMDKvRaWaQUGWftXqEUwc5QlBE4wPtM wej/qqbYDA+pXAOu0baLkR7FI7EEq1j8MVlqWwOkPX5X4NAxrELXM7Yi8A/vYZHiTuVY0yfNtBW yiDykvB558JPpNEgTDQfpWUJXgFMB7CJrTIy/s/tx8qxuHq8zg0ai24BSpO5wPEfciJC/pa+QY9 Sxdh3/BBhtZP2Buais X-Received: by 2002:a05:7301:1685:b0:304:705f:e4e8 with SMTP id 5a478bee46e88-3074fc366bcmr2538999eec.32.1780519935315; Wed, 03 Jun 2026 13:52:15 -0700 (PDT) X-Received: by 2002:a05:7301:1685:b0:304:705f:e4e8 with SMTP id 5a478bee46e88-3074fc366bcmr2538989eec.32.1780519934788; Wed, 03 Jun 2026 13:52:14 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 12/25] plugins: remove type qemu_plugin_vcpu_simple_cb_t Date: Wed, 3 Jun 2026 13:51:39 -0700 Message-ID: <20260603205152.1440291-13-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: qU0X8YUXEaBgtwJewQi5ilJ2Do_n9MaB X-Proofpoint-ORIG-GUID: qU0X8YUXEaBgtwJewQi5ilJ2Do_n9MaB X-Authority-Analysis: v=2.4 cv=A91c+aWG c=1 sm=1 tr=0 ts=6a209400 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=O-HLJylWCwHPwwrsMNEA:9 a=6Ab_bkdmUrQuMsNx7PHu:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfXzyar695O4vf0 HY13toCkkzIyem1WQ4+CUMcQqh9/KMKnanx284E7+pb1BHZVbqYU5jVZnSgn9bPZFgEBgO1r5TA P5fKtnzW2/utZpphKcHata44kShhYBdwAFe0uCXFayO1snoJvKFRtu92bKrW1IYapoa2cocXsrL R4jmxZ7/svhBiX/d9gvRGRQd6DuZnH04pMd5gPcJiV8jKGHZtCOuiEiTOpWTW4jyecVvU4y9M41 qd52vPYTGvxruAUurdgaZ+R4AscOHkk7ROh1I2Fqjc98kIlH0KYMJ4qI3XVNNkH9jj1Rfdu1uDC 3fLIaZUkaZE8Uy7pQLKhkfEFnGzyumsIoqr5msx8Y6A2EsgWGNRKwwAnyEV45BgSZW99G5vI8vp 7wcKyxvILdAsq73PP8N2Jo2RRqZYoP00LVVPxmi1wGbERW3G5vRZA0lmIGXxD372Anoyromjflj Cdzna1K3ePWx9Z595sg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 spamscore=0 suspectscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520079486154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- include/plugins/qemu-plugin.h | 6 ------ include/qemu/plugin.h | 1 - 2 files changed, 7 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 320644a2f0a..cf937c60ee7 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -147,12 +147,6 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin= _id_t id, */ typedef void (*qemu_plugin_udata_cb_t)(void *userdata); =20 -/** - * typedef qemu_plugin_vcpu_simple_cb_t - vcpu callback - * @vcpu_index: the current vcpu context - */ -typedef void (*qemu_plugin_vcpu_simple_cb_t)(unsigned int vcpu_index); - /** * typedef qemu_plugin_vcpu_udata_cb_t - vcpu callback * @vcpu_index: the current vcpu context diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index dac08cdc60c..9356ee836ac 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -56,7 +56,6 @@ int qemu_plugin_load_list(QemuPluginList *head, Error **e= rrp); =20 union qemu_plugin_cb_sig { qemu_plugin_udata_cb_t udata; - qemu_plugin_vcpu_simple_cb_t vcpu_simple; qemu_plugin_vcpu_udata_cb_t vcpu_udata; qemu_plugin_vcpu_discon_cb_t vcpu_discon; qemu_plugin_vcpu_tb_trans_cb_t vcpu_tb_trans; --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520072; cv=none; d=zohomail.com; s=zohoarc; b=BbWK9ynEYP23VeWn7e/+oVVcomrj53Ww3E8eX7oQYUc5J57sn+bJ9OXTWHJHeJYO63Ms4NBxAd5noenH10V/DNiiG0dpwTSd0hWJdRUTTibgVSYGBl9g42SyMjzZpftgQZZMh2vPbnPr6l3/5TEjuc6eDsWsyJTXrUjQ5STwYow= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520072; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=je3MUD6keVAfPWR8DdS5aO6YgwljUqYzUOpTW+/1Ems=; b=jleTBfr8Vk0tpzqOoUgB2rgtVjXRab9tdZfxQrQtS5VIcKetwGD53f5jThc7zhJAbRTW6XMcvyWkRWruFkKCOku3/Nz1cGSQiTuaq80kBHtHvk13jGQZgjdzxi/gclwYK1L62ylQrnmCvM1yV7NvGY9rvY86aw8QoJWQtQEzwCA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178052007297329.990914218188436; Wed, 3 Jun 2026 13:54:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsaf-0000aG-6z; Wed, 03 Jun 2026 16:53:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZj-000854-1Y for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:31 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZY-0004Fx-B4 for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:26 -0400 Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653JZejZ1039943 for ; Wed, 3 Jun 2026 20:52:17 GMT Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejtj8g8q8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:17 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-304d8613efbso7411093eec.1 for ; Wed, 03 Jun 2026 13:52:17 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=je3MUD6keVA fPWR8DdS5aO6YgwljUqYzUOpTW+/1Ems=; b=EW0NDc8K8EYuU6BXWBxf3b+3dgi U11cDvmqRMg33h22LtL76rwXE2h9gG0AMT0qiyB5IIXmhY1Y9x1lGsyYcOn4x7Qo mfJCEjuWsL4a2ZCt6TM1JrLPNa+7155HIeay+AsdH6jyacXnw1YCuLnteeCFzIj7 Zjy/h4kWiuMSKe/178/joVYAUENH5GvbYn7K6nFLuDQbVD/fwcnJx4ExM6kWW0GE zqhwoXaBjZp8yIMNEQ3mvlTLdQzm/eMOtd9s/hmhgOrS0bVFXLMLKM3upEDY5iZw +b9YtFm2zLTf6+7QRPlZoDRZs4jTJjwNVyaXsPtVZlMMvvwb314lzfJtsAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519937; x=1781124737; 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=je3MUD6keVAfPWR8DdS5aO6YgwljUqYzUOpTW+/1Ems=; b=Bcqj35sfPeEMkNRZ3npsSzrE/EtQW91o+UMdGZ08c2eOLf/RPwzOusf4el3Wb1DNN4 28DGfiHEtDVdXQtuq8041qtc9YO8Regu2yho+Gj+RnGF6x/ykfdVMu1aSxY5sEozOxDL rP3vFYw148prtOSHwPqK9MZTg/TOYUngPu8/M0f0wVRaJoSN0eisR02VXQTJwQoUXgNj 3fBkv2ml2JuDbtvvw7E+1FRo+axNwFK6VyiHA7Pk3ixERu1dQKh3Fo5MXXCGY1+n4YuZ lDMLsv0UlH0G3SJuzhozsQSb46ZfEXVroYZyB6Kd++jIks6Jx3sGnxV72GY9yW4X0l4I zHbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519937; x=1781124737; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=je3MUD6keVAfPWR8DdS5aO6YgwljUqYzUOpTW+/1Ems=; b=d4Bkjoo6ZWzOCmDmNs20RjH6wZAyTccK+8XJv7ShxJHPHl9HDHHaih5peP768Ar0hT yVG47b2VadpLLnj/eyUgIbB8CuvH8dK1Nlj/PTwbEZsMP+3w8BA7VbLE5/kDK0dByWBJ gpRFH6HmYaDI3grSImRX0JddubvI/dnv27prZu313RTCieO9al3IVA5tnGcDeKLmSmO7 Hr46UldUKGL/9bMUEVAhgYZX7F1yMK0EkEzz1hCHh0gzQ4ST446AxYgEgmGMLAq+Kj/l QkDxzCMjzYFi0KBzEz033PFYWak/c1NI3eE7k0fGWWSaf3RLYAUS1hpqGj9LR6IailkQ 9nNA== X-Gm-Message-State: AOJu0YyTbHqHLXlt8u9Wk8rOPcPlJfbaWQPKklQFAD6Vh27DoSwPUWQ6 7dO2XP3htcGmi52ecjsEhIeri8EbTgvpzVNaHMi7ho65sh6WDjeVYL7uRaQ/alT0qni8K1Nuqwv XfoVimntiDXEcMySKFt3MSfOXnR2s540LnBEKEEGFktgcI4JmW//qSutpUUl1icRoBFTi X-Gm-Gg: Acq92OG1PDZozZ70efkWDYNuzORXGMajqy/CmYEg2yrt06EclbTzijURIsCJJe1Q+Ri cbVU5BONCIw2rUw/SRRmIvPWvukYWSBMzvyPUW3+BToGePOUonvHNslRBQnPRViPBsDodESsvA9 y2j1ryoIDIiUhZLg+bcUcB4dB6hZ5WmUG6dzYJ0bore/3vdlr6xg8z8dwZEfcRjw5prCZ0gaOVy 0839WQI2qy4bkz97ljDbKYhXxBq/U8VMgv3kPoABFGWJujIH3OJNNyZL3RJeu+bJtOwneVCduml 93OORO6g85kvtn9zl/T7t7VjyE8FUtj/EI3Lk1NjGviaCELkzKP8ALavfHT0uaVct1MfktP61fJ eRi3XiDzxu4F/LTQGayNVdm6GmnLh4cHjWabZ4UvwlGk/rlVHLLSj06zxgc1mmfILv2SxPsde1r YvrY9D/6vmTEKy9l2T X-Received: by 2002:a05:7300:c88:b0:2f2:c336:7736 with SMTP id 5a478bee46e88-3074fbd9d26mr2493112eec.29.1780519936666; Wed, 03 Jun 2026 13:52:16 -0700 (PDT) X-Received: by 2002:a05:7300:c88:b0:2f2:c336:7736 with SMTP id 5a478bee46e88-3074fbd9d26mr2493090eec.29.1780519936175; Wed, 03 Jun 2026 13:52:16 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 13/25] plugins: add userdata to qemu_plugin_register_vcpu_discon_cb Date: Wed, 3 Jun 2026 13:51:40 -0700 Message-ID: <20260603205152.1440291-14-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: XoylCkEsUmyKM1tCPhF6GiS56fhE6diY X-Proofpoint-GUID: XoylCkEsUmyKM1tCPhF6GiS56fhE6diY X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfXxpWnRPql45Vb cvpeq7CdSVy1K1NMA4O5IjsBIn6wsjAj/D2R8BiEaQsKCduLMw80aMSTaYFFGeBqrkrLVDpeh3j jm+rFgbVzIvYxU7LRNh1UItha2OxX2X+kmfU3vEdgYr6Xq9Jx2/fCTx7R5NvOkobt8hNA/3YIRr +D9w8hpr0xvLiFp+VZPqQQp+ussNUv4/cF/3ovm1prN8erEJ5OnyFgVCQXFWMcUUqiKB/kvd9nX FNUPLR04CARYCCZqWW5yR4PS/ppft0UbUaBhZaXy7QcSAlKnQnfsIjYGaHIMMiETv2yf0X0RJyb mI8EStpCcarZrbH8Su2woiy94VsRg+ToBx4N6KyLr7YGgZOPawqc71vmWwlwStbIryd03EXI4nC 1ltWjoteDGn1HiiuFTHmtDFZG6O4OWldDgZkT6y8ra4XEuSnkol1PXEud5pQnFim431GXSY5nRO AIrUX0nq1vZ4WjP436Q== X-Authority-Analysis: v=2.4 cv=f4p4wuyM c=1 sm=1 tr=0 ts=6a209401 cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=UCrIKau3vUVB3JaL4XcA:9 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 phishscore=0 bulkscore=0 clxscore=1015 adultscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520075405154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- contrib/plugins/traps.c | 5 +++-- include/plugins/qemu-plugin.h | 8 ++++++-- plugins/core.c | 12 ++++++------ tests/tcg/plugins/discons.c | 4 ++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/contrib/plugins/traps.c b/contrib/plugins/traps.c index 4b879a8212a..4d59aa3c09d 100644 --- a/contrib/plugins/traps.c +++ b/contrib/plugins/traps.c @@ -25,7 +25,7 @@ static struct qemu_plugin_scoreboard *traps; =20 static void vcpu_discon(qemu_plugin_id_t id, unsigned int vcpu_index, enum qemu_plugin_discon_type type, uint64_t from_p= c, - uint64_t to_pc) + uint64_t to_pc, void *userdata) { TrapCounters *rec =3D qemu_plugin_scoreboard_find(traps, vcpu_index); switch (type) { @@ -75,7 +75,8 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_i= nfo_t *info, traps =3D qemu_plugin_scoreboard_new(sizeof(TrapCounters)); =20 qemu_plugin_register_vcpu_discon_cb(id, QEMU_PLUGIN_DISCON_ALL, - vcpu_discon); + vcpu_discon, + NULL); =20 qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); =20 diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index cf937c60ee7..03e7b2b1fb8 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -186,6 +186,7 @@ enum qemu_plugin_discon_type { * @from_pc: the source of the discontinuity, e.g. the PC before the * transition * @to_pc: the PC pointing to the next instruction to be executed + * @userdata: any plugin data to pass to the @cb * * The exact semantics of @from_pc depends on the @type of discontinuity. = For * interrupts, @from_pc will point to the next instruction which would have @@ -198,7 +199,8 @@ enum qemu_plugin_discon_type { typedef void (*qemu_plugin_vcpu_discon_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_index, enum qemu_plugin_discon_type = type, - uint64_t from_pc, uint64_t to= _pc); + uint64_t from_pc, uint64_t to= _pc, + void *userdata); =20 /** * qemu_plugin_uninstall() - Uninstall a plugin @@ -293,6 +295,7 @@ void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id= _t id, * @id: plugin ID * @type: types of discontinuities for which to call the callback * @cb: callback function + * @userdata: any plugin data to pass to the @cb * * The @cb function is called every time a vCPU receives a discontinuity e= vent * of the specified type(s), after the vCPU was prepared to handle the eve= nt. @@ -302,7 +305,8 @@ void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id= _t id, QEMU_PLUGIN_API void qemu_plugin_register_vcpu_discon_cb(qemu_plugin_id_t id, enum qemu_plugin_discon_type type, - qemu_plugin_vcpu_discon_cb_t cb); + qemu_plugin_vcpu_discon_cb_t cb, + void *userdata); =20 /** struct qemu_plugin_tb - Opaque handle for a translation block */ struct qemu_plugin_tb; diff --git a/plugins/core.c b/plugins/core.c index a5aac1062aa..54ab3bdbedc 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -122,8 +122,7 @@ static void plugin_vcpu_cb__discon(CPUState *cpu, /* iterate safely; plugins might uninstall themselves at any time = */ QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { qemu_plugin_vcpu_discon_cb_t func =3D cb->f.vcpu_discon; - - func(cb->ctx->id, cpu->cpu_index, type, from, to); + func(cb->ctx->id, cpu->cpu_index, type, from, to, cb->udata); } } qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); @@ -655,16 +654,17 @@ void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_= id_t id, =20 void qemu_plugin_register_vcpu_discon_cb(qemu_plugin_id_t id, enum qemu_plugin_discon_type type, - qemu_plugin_vcpu_discon_cb_t cb) + qemu_plugin_vcpu_discon_cb_t cb, + void *userdata) { if (type & QEMU_PLUGIN_DISCON_INTERRUPT) { - plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_INTERRUPT, cb); + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_VCPU_INTERRUPT, cb, us= erdata); } if (type & QEMU_PLUGIN_DISCON_EXCEPTION) { - plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_EXCEPTION, cb); + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_VCPU_EXCEPTION, cb, us= erdata); } if (type & QEMU_PLUGIN_DISCON_HOSTCALL) { - plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_HOSTCALL, cb); + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_VCPU_HOSTCALL, cb, use= rdata); } } =20 diff --git a/tests/tcg/plugins/discons.c b/tests/tcg/plugins/discons.c index 2e0e664e823..22114830fdc 100644 --- a/tests/tcg/plugins/discons.c +++ b/tests/tcg/plugins/discons.c @@ -98,7 +98,7 @@ static void report_mismatch(const char *pc_name, unsigned= int vcpu_index, =20 static void vcpu_discon(qemu_plugin_id_t id, unsigned int vcpu_index, enum qemu_plugin_discon_type type, uint64_t from_p= c, - uint64_t to_pc) + uint64_t to_pc, void *userdata) { struct cpu_state *state =3D qemu_plugin_scoreboard_find(states, vcpu_i= ndex); =20 @@ -214,7 +214,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, has_from); =20 qemu_plugin_register_vcpu_discon_cb(id, QEMU_PLUGIN_DISCON_ALL, - vcpu_discon); + vcpu_discon, NULL); qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); =20 return 0; --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520033; cv=none; d=zohomail.com; s=zohoarc; b=PI4E1aydpgyQLVHXTK0Hf50xUV0YGVuIv2odUFmjh737+yrrYXJhdYeH9WPiJdrs18dg2fXY5Ki8NEUpod5AJ2/3TOIva8i0dpGveUINrgpvsRmwgKrf7IYzQWGspgGTPB4z6orXQ4pBalf/nw6aW8kchNLb/XAaWIPiHeGbr8Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520033; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=n+kWYTH6qpMj15+EyZjW7Wg8K5k7t9ZwT/3Uje08PSQ=; b=U6snxUdNpzBaiTF9vddQHEHZIlSJ9j8s7S3hJQqlN9ImhNqQCDyTjiSoHeBaU5q9pBh7clN5uslL9Qqpe/HViMB4+xkzYjbvunZgQOFQNh1swplhGd7rMQjsI9rrY4Wd5iR6fAdeDlLbjhFQVAsk0WFmXVXHUsACvcGgYAZMkRo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520033408522.3158434558673; Wed, 3 Jun 2026 13:53:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsa8-0008L1-QN; Wed, 03 Jun 2026 16:52:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZj-000853-0N for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:31 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZY-0004GI-Ef for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:26 -0400 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653EbXSd1476538 for ; Wed, 3 Jun 2026 20:52:19 GMT Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejp6nsmxc-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:18 +0000 (GMT) Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-304b8d0ee63so12087636eec.0 for ; Wed, 03 Jun 2026 13:52:18 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=n+kWYTH6qpM j15+EyZjW7Wg8K5k7t9ZwT/3Uje08PSQ=; b=Pn/Vz3H/LwgXlsandEzMSPy1GKG 6FgJDGf22AGv2Ht+v2FdnI0p7hIpWeSdP01J9PBjtrstW7mHDnmsE2wDwtm2kNgZ K7ZgMPbWG6VMRB43KNu64SYamblI+XKdec8+Wa9y2DZVhRd6U9dsuYdkk/G5MOfq AP3vCaBlGB+s6L3GTehHEU3uOJYjcTty2dnuCeXwTYVW9nLetE0mxEfUZr+NnQep NpJ2egnDtHwOECEz0b20KlsCXyUX6ylx4sRJV8DAS0N063j/ROXeaLU4jNn68Ok5 G9B1SDMsHTnp5Hsjq8OOx/YKuZGdOIbM3ngeqrjHsVJYIu1/W4FjMe9C2jA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519938; x=1781124738; 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=n+kWYTH6qpMj15+EyZjW7Wg8K5k7t9ZwT/3Uje08PSQ=; b=Ea/dhwjItOMLO2ZM4+VAd/mf25abdx3PfHMMRgqBFUkDLHDewX/Tpeh8kn9MbLk/Gg 1b0yqW+Wj3cgfZuWke7pfWQnuoRgxBakD+L3SZClUz9S5oj/UuRUOTzPt/jHxdM+kZiE uzfCb1KPU3UDTyiu9bgqxZVT0hdfqclEIwmqavOUH+Wd4jq2X6GC9XWlOU3j/9jdBBM/ jVJMa5R6EYlxsNLcP22o44MwjYre4usV5agG1Ycs07n0kLTD9VwHeF+JB6PQyYOgQqDm CDHL0WfQLzcEWMBKYzXiMoHLpmppCUgm8jKeR3TF1eVaI3qieXhbk8NnevkjkFOqtI8n 81Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519938; x=1781124738; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=n+kWYTH6qpMj15+EyZjW7Wg8K5k7t9ZwT/3Uje08PSQ=; b=jMGEc6xFKmlPFCJ3cXxmPsmZDxUVBwKJDnUUeZmVMaH4EHomsFjA3vM2HGO0aD38Aw LBuI7Hjdy6EeyeU+o58S4+4p6J5TDwLfPvEU1Rj54BSk5EU54JYUeQUM1ij2+ukA11Dd 5FCyk7puzq/mEP18F52WiFvzxlPh69jUNrrTguUNGEjfZNZKyIbpTifLVISlysopQN4c pweVZOnufVVmXN/UX4vWkja+foJ0Tvc6MkMrgJawFUE24ufGsL/mUlLS41gClrf8x0Qi oHQrQQNMNeAOZcmzs6xWqsXcKvbq7o+KkUobypZDSlDIDSh9qVbyw1klx+ZCXVzRX+JY q5Ow== X-Gm-Message-State: AOJu0YzxvJ7ojRALK2/CJgkAWtXtY3FgkKap+CbxCHtdCl3XsvWdZcM5 I2Ljd+wX1HKD8aNjvAu5RJdGP7KXw5Qja5giBMepHfY8ZDl01pqKArOdH+2gemB3POUT7etAgbF IOgETX8JN5B+BO7F59oqwc73IThIsfjgk66xe6o+8GNTLIYhNkcsYTXR8+l3bYKLGGtIP X-Gm-Gg: Acq92OHNkkQ2woPQzcg8+rNTfbaYq2FiZw6l3qxrk8hpiQvdPQGZsneIVGkA+AMpmK3 c4hOiQb+aYgM3tjZGkvXntsoQmmq2qkSzupF2tF8lHkKTfqVBL+SuZ0av0ahT0yunxAnRzu6RXc ohpIiT8HjJU8tZqshj23XcajrVXCbWQlUCT/wEGhy7Inwpi0KFVFilR1aGcCDD+l9f0JEwKBKhB R2DXqLUkfcg2mUrdSoJY8IIhKy5wkjamhoBUeKcdepFZTt4YuC0t/9XnjGI8Br8VeTmRLEfroUS slocqpsLjBl2sPCcxje6qOhwnwu1236Mto0If4qItnd5PzkTnoUYjGnSLZ/qH5T60Xh7+U8duN9 GT9Qvoxt/muvE2ZPnAH9yA0fJ8qPgtwwWNTTuq9PStaj0aX5JPbl3Kx2M0b4RPhsYfpKmuRKzg1 /t5dkOQGEU1PkhOSUO X-Received: by 2002:a05:7301:1006:b0:304:d8e2:3c4d with SMTP id 5a478bee46e88-3074fbb703emr2129603eec.25.1780519937876; Wed, 03 Jun 2026 13:52:17 -0700 (PDT) X-Received: by 2002:a05:7301:1006:b0:304:d8e2:3c4d with SMTP id 5a478bee46e88-3074fbb703emr2129492eec.25.1780519937322; Wed, 03 Jun 2026 13:52:17 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 14/25] plugins: remove qemu_plugin_id from qemu_plugin_vcpu_discon_cb_t Date: Wed, 3 Jun 2026 13:51:41 -0700 Message-ID: <20260603205152.1440291-15-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: msPXHma_3TJsR-VK_BtBhL0iqS1r7xVw X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX3/bzZGDYUhgq 2uM96DJSZXemxXfEDFLsrElfEF7RH0W4n62qzx1dw+YJG0YpjGCDhgV+dbW+DSjvndWLtf1dOW/ HAv/wSU3lfo3IFIbdDROzdONifOmoh+qaUfMUCrvCT/5H8XGX3CGvnQ7b1YFyYrfgzAz7ZXbx3X SSjj7nF+fCHhes6kR138f0DQpmbcmj2jgh4MiC2uN/32QCmMW1oUPKZVblSrcpL+6Ore8T5I2Fq ido7IbLBDBW4Qz6x7OUDINGvLgPAmQo25ryNRI9pho0PCEyQHqdmrN/HEukhgGLPImS5CfSyivc uk9wvoQkAtg+IYXoT0EuXKkWW2mLX6GgGPAyyJiqfnRNMNhDOZPjo2tbkRlwyehqajWrSz/EBRE RKWvzaeS5l0lBUXtKY26Bpatd91oUqybWoZDIA6fPlW6lmatERGJ/VG7UpWrmywpI9hVT9p3i8M ECzIQGEjl88RVBVdskw== X-Authority-Analysis: v=2.4 cv=DbcnbPtW c=1 sm=1 tr=0 ts=6a209402 cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=ZiyQStk_4VnRclnpaacA:9 a=bBxd6f-gb0O0v-kibOvt:22 X-Proofpoint-ORIG-GUID: msPXHma_3TJsR-VK_BtBhL0iqS1r7xVw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 adultscore=0 spamscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520034833154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- contrib/plugins/traps.c | 2 +- include/plugins/qemu-plugin.h | 4 +--- plugins/core.c | 2 +- tests/tcg/plugins/discons.c | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/contrib/plugins/traps.c b/contrib/plugins/traps.c index 4d59aa3c09d..b6df4455d63 100644 --- a/contrib/plugins/traps.c +++ b/contrib/plugins/traps.c @@ -23,7 +23,7 @@ typedef struct { =20 static struct qemu_plugin_scoreboard *traps; =20 -static void vcpu_discon(qemu_plugin_id_t id, unsigned int vcpu_index, +static void vcpu_discon(unsigned int vcpu_index, enum qemu_plugin_discon_type type, uint64_t from_p= c, uint64_t to_pc, void *userdata) { diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 03e7b2b1fb8..60d27d8d9c1 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -180,7 +180,6 @@ enum qemu_plugin_discon_type { =20 /** * typedef qemu_plugin_vcpu_discon_cb_t - vcpu discontinuity callback - * @id: plugin ID * @vcpu_index: the current vcpu context * @type: the type of discontinuity * @from_pc: the source of the discontinuity, e.g. the PC before the @@ -196,8 +195,7 @@ enum qemu_plugin_discon_type { * observable via general instruction exec callbacks. The same may be the = case * for some host calls such as hypervisor call "exceptions". */ -typedef void (*qemu_plugin_vcpu_discon_cb_t)(qemu_plugin_id_t id, - unsigned int vcpu_index, +typedef void (*qemu_plugin_vcpu_discon_cb_t)(unsigned int vcpu_index, enum qemu_plugin_discon_type = type, uint64_t from_pc, uint64_t to= _pc, void *userdata); diff --git a/plugins/core.c b/plugins/core.c index 54ab3bdbedc..3c3212aedda 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -122,7 +122,7 @@ static void plugin_vcpu_cb__discon(CPUState *cpu, /* iterate safely; plugins might uninstall themselves at any time = */ QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { qemu_plugin_vcpu_discon_cb_t func =3D cb->f.vcpu_discon; - func(cb->ctx->id, cpu->cpu_index, type, from, to, cb->udata); + func(cpu->cpu_index, type, from, to, cb->udata); } } qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); diff --git a/tests/tcg/plugins/discons.c b/tests/tcg/plugins/discons.c index 22114830fdc..5ab645705e3 100644 --- a/tests/tcg/plugins/discons.c +++ b/tests/tcg/plugins/discons.c @@ -96,7 +96,7 @@ static void report_mismatch(const char *pc_name, unsigned= int vcpu_index, g_free(report); } =20 -static void vcpu_discon(qemu_plugin_id_t id, unsigned int vcpu_index, +static void vcpu_discon(unsigned int vcpu_index, enum qemu_plugin_discon_type type, uint64_t from_p= c, uint64_t to_pc, void *userdata) { --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520026; cv=none; d=zohomail.com; s=zohoarc; b=Ns9WXRt3Sb0C/gPTljLvYKKtyk42TrhhWwdfecTwlUZu7r/jnJ5iz66tiZAtKVkUa3OPycHhRI8dtf9yCdPe8lJv4Vyc5mzM2+5UZ44kYXIB9Wz+rlI47JRuWNf/ebLdGXtfbZBlJyX90BZKTtp9attvszdRCIczlDtlLXLFEbM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520026; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NXf1+G+lhb1N0s/zQtDborcjjPfHIczMbuPZOdktX2U=; b=AUYZrJSEH8MSDwpXu4KnZ0kWi+iqzyeAZ1SFIoQ+2ROcltjzXenARpj57WLpWnyyqKV0rQQEa+/gXFD6Fnm2uLLcMHs9UGbFgVoI1Kv1FQMa7hOj20uST8J1nDkUZcM+h9C85ktVertAqlnRm287erBfSAsi2l2jQ/eKF4ZThuQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520026772753.398194284089; Wed, 3 Jun 2026 13:53:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsa6-0008Jp-Ra; Wed, 03 Jun 2026 16:52:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZk-00085k-Ci for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:34 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZb-0004GN-0P for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:27 -0400 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653JTQQ71740936 for ; Wed, 3 Jun 2026 20:52:20 GMT Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejdq7uyck-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:19 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-304dd917645so6276782eec.1 for ; Wed, 03 Jun 2026 13:52:19 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=NXf1+G+lhb1 N0s/zQtDborcjjPfHIczMbuPZOdktX2U=; b=VtNG8yApuXGsIIFMJLO9RffL9Wi lD5mZZvlEM9BYuQL9gVXOfa9AM8OHhsOHvDHqtVekM7+hfq0+AUccnSn7I0lV/zK BmxHxZR8bDNhlr0o4f6CzTzKwQCArsYR4pnzVsQu5UqPojjsh9MWUCHuH5oZxkm9 vkcJrXcqHz9R4gyKRnMgmhLcSVhHPdayQ2Yn3rC4UYzBYXpG+/MwNiyqbVyBBmWr cFAX3nO9nGFddQYjmBIRhqTqoxgMmPQk6hypKiGjyqMyunDcn0w1DmS48rIIweI7 SfBqlEzXYPXRSayVqWxnKGZG7VcxzuJwrF4uf+z79CPW6an3lRKvHAClMhA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519939; x=1781124739; 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=NXf1+G+lhb1N0s/zQtDborcjjPfHIczMbuPZOdktX2U=; b=j5ewyk7wCR6RV0KOqnbwrh2OHQY9BNrthzYQSy99L8dB3cH9Qj+K+M0l72+vOZ3utH eeAHHj/1K77I7VxKygPuzJONSN2u7jbDkj9el8y7NN6JLnMzbeBcM5p3DOHkvVAmOK5n F31XkRKKy6vodAR3P5UqEXXuxjn/GgdSnQIy+l4C4hNugYqsJoagORPtaFPtoN073eAb Z6SikJh6CxrmsUARIHToKRHd+AsdIX9Ruv8BEBwmTIhYhmsvyr01Pjzfx0NwUQg6IQxf xK7nzp9lMuiORfRj201p3dA3UIRomFXaKhmAxEBL8jkVoJU/KGUAPlYof7AsYNHbPo8w amKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519939; x=1781124739; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NXf1+G+lhb1N0s/zQtDborcjjPfHIczMbuPZOdktX2U=; b=BkN3wui694nRVuoZHLWi84C4rjLK0aQD3qDsAOda5bj7Jm6vGyVpKBHgFXXDwEhx2U 5plJndegrLDNEaZkwUe3WnCipolgPi2nnVAQ0ihE53nSrnNPxqF6fUPwNDE4ZhE+ZBMP 2uwpk7yDEpmcMFDIUXsCea5x6NnSUmxK8zTv3VQ5hfv4zP5VAQCBmPjsCWlkw2sAh5Hj LsrcxaHM3kBu3X4N3sF4tmOUZpuDti1243fA644P1Dyq3ZliiyYuVwNBNJ62BxNM9Hkb 5j6we2Nt3W6WXWql0ELSO2VN2hn98udjC0v3OmrpzLVmYTunX+i+uuhqDseyMzOOBLva sbzw== X-Gm-Message-State: AOJu0YyVtR71E+EGnfxSRIo99LHAkXdGjqeqyWfXPX/9EaJzHhGYO2Nu nUdhx31n2ISthj7nhVgfjVgKYQcebQkcmFtA8CB1/rWDq03n7eaDID/N/EsuH3Ytovfx4j1Va4N 8h92ST+HjQn5aZmGlF4ZWxHTuwuJcs2l88l8F/ns6n7RDWDm3fyikQ1YluqtLUqLIOIXj X-Gm-Gg: Acq92OG0wYmpUJC4U2oqn824rdFtmCl1vnpunVBdRswAjXmKdfcMzw37ou4vTJogR5V mnj7G2f+BCa0icCe4IqsKVhsPEs7r9S7OGkE6kvVO7JfLU5KIRh/LSZ1G5TVb1vaphs+owo8uuF Hts/Q1g45Ks67BeFQznqR7vIBfnjXyXNbgAbm5sJTcURpWFTrRwqv+ciTrBku+cbXaVu4c58rD/ 5OYGh4yswD55y1lA004l6o1o5eYcpTw8IcKTMCDgd7f56beduL4f1cPMR33x9hTgHrI97nJ2/+W EtcpEH+DUtOdUCYYuNZNzA3VHFB4PVlqlIb65DuUwJ63P99SPmoZq3v7fvYb9jOY16TfgdASDDQ LLOhwajPdldRm14SYOFnZj0DpoPmv3juy2sHJ+8QZS/vZKwGZy5hQj8hca7PCGgy4AYR+7aq9nc 6PG6m3+KX5o1JydEM2 X-Received: by 2002:a05:7300:fd09:b0:2f3:c3d4:382f with SMTP id 5a478bee46e88-3074fa7f75bmr2806908eec.8.1780519938998; Wed, 03 Jun 2026 13:52:18 -0700 (PDT) X-Received: by 2002:a05:7300:fd09:b0:2f3:c3d4:382f with SMTP id 5a478bee46e88-3074fa7f75bmr2806883eec.8.1780519938382; Wed, 03 Jun 2026 13:52:18 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 15/25] plugins: remove qemu_plugin_id from qemu_plugin_vcpu_tb_trans_cb_t Date: Wed, 3 Jun 2026 13:51:42 -0700 Message-ID: <20260603205152.1440291-16-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX+g6riWE8eOVO /qSX6WCQYAQrtm6nxmvrQa8hT+tQPUKcRTFtXvZ9TyaYUHKyRpplbT0hvyaQbvrQad4qiX275ep hPrMqoXN4SOxWjhfst9Nor2rbzGgQXh2oKZB5lJUawVnLZ6GG9PdUqFL277BKlA81XfWeCxxyFw z0wAf2cBxSmsSmYIF2IOktXKj22FYu2qrYAc1QMve1wRT4FtRs8142X8k/m0OB/2LdBIO7gtkvQ 51W6FNebsrBEAUIR9NpQyYw1vdVKyx1lWDf5xWfKEBS16M8JS2XS5zVjYSGe+WaeHK9ozikF4Zo OyXBhq/pai0wKT2hKf5jn98XYptplADquH6XjCztyX6iJqJqAsrKgQy5K3gh9NkgSRlHpYWes+8 YriQH2zg+Q+2Fu3rz4MAHX9Jj6mKI7tzfd+A7JnTir6ossDVC61rtmLb9weRMTRWdQs8zQAKGTU ZNDhBb55Iy3HyT11pkA== X-Proofpoint-ORIG-GUID: s7XtXet5oK5bznD1YDFgoC65FdrhGRpx X-Proofpoint-GUID: s7XtXet5oK5bznD1YDFgoC65FdrhGRpx X-Authority-Analysis: v=2.4 cv=ccniaHDM c=1 sm=1 tr=0 ts=6a209403 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=deo0yMGDrNm56YX46o0A:9 a=O8hF6Hzn-FEA:10 a=6Ab_bkdmUrQuMsNx7PHu:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520028715154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- contrib/plugins/bbv.c | 2 +- contrib/plugins/cache.c | 2 +- contrib/plugins/cflow.c | 2 +- contrib/plugins/cpp.cpp | 2 +- contrib/plugins/drcov.c | 2 +- contrib/plugins/execlog.c | 2 +- contrib/plugins/hotblocks.c | 2 +- contrib/plugins/hotpages.c | 2 +- contrib/plugins/howvec.c | 2 +- contrib/plugins/hwprofile.c | 2 +- contrib/plugins/ips.c | 2 +- contrib/plugins/lockstep.c | 2 +- contrib/plugins/stoptrigger.c | 2 +- contrib/plugins/uftrace.c | 2 +- include/plugins/qemu-plugin.h | 4 +--- plugins/core.c | 2 +- tests/tcg/plugins/bb.c | 2 +- tests/tcg/plugins/discons.c | 2 +- tests/tcg/plugins/empty.c | 2 +- tests/tcg/plugins/inline.c | 2 +- tests/tcg/plugins/insn.c | 2 +- tests/tcg/plugins/mem.c | 2 +- tests/tcg/plugins/patch.c | 2 +- tests/tcg/plugins/reset.c | 4 ++-- tests/tcg/plugins/setpc.c | 2 +- 25 files changed, 26 insertions(+), 28 deletions(-) diff --git a/contrib/plugins/bbv.c b/contrib/plugins/bbv.c index 0ad1301a1de..7e9e72477d7 100644 --- a/contrib/plugins/bbv.c +++ b/contrib/plugins/bbv.c @@ -102,7 +102,7 @@ static void vcpu_interval_exec(unsigned int vcpu_index,= void *udata) fputc('\n', vcpu->file); } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { uint64_t n_insns =3D qemu_plugin_tb_n_insns(tb); uint64_t vaddr =3D qemu_plugin_tb_vaddr(tb); diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index f41ddb0aa43..c9d61de26c9 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -462,7 +462,7 @@ static void vcpu_insn_exec(unsigned int vcpu_index, voi= d *userdata) g_mutex_unlock(&l2_ucache_locks[cache_idx]); } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { size_t n_insns; size_t i; diff --git a/contrib/plugins/cflow.c b/contrib/plugins/cflow.c index 4d00879ccad..9a850c8c0cc 100644 --- a/contrib/plugins/cflow.c +++ b/contrib/plugins/cflow.c @@ -297,7 +297,7 @@ static void vcpu_tb_branched_exec(unsigned int cpu_inde= x, void *udata) * instructions for their execution. * */ -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { uint64_t pc =3D qemu_plugin_tb_vaddr(tb); size_t insns =3D qemu_plugin_tb_n_insns(tb); diff --git a/contrib/plugins/cpp.cpp b/contrib/plugins/cpp.cpp index 0673c4f074d..34243cc922f 100644 --- a/contrib/plugins/cpp.cpp +++ b/contrib/plugins/cpp.cpp @@ -363,7 +363,7 @@ =20 QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { } =20 diff --git a/contrib/plugins/drcov.c b/contrib/plugins/drcov.c index 458c0d2084d..2dc08512d44 100644 --- a/contrib/plugins/drcov.c +++ b/contrib/plugins/drcov.c @@ -119,7 +119,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *= udata) g_mutex_unlock(&lock); } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { uint64_t pc =3D qemu_plugin_tb_vaddr(tb); size_t n =3D qemu_plugin_tb_n_insns(tb); diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index 2d02816a184..8329112305c 100644 --- a/contrib/plugins/execlog.c +++ b/contrib/plugins/execlog.c @@ -177,7 +177,7 @@ static void vcpu_insn_exec(unsigned int cpu_index, void= *udata) * QEMU convert code by translation block (TB). By hooking here we can the= n hook * a callback on each instruction and memory access. */ -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { struct qemu_plugin_insn *insn; bool skip =3D (imatches || amatches); diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 92859872ac9..682b160019a 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -121,7 +121,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *= udata) * Otherwise a helper is inserted which calls the vcpu_tb_exec * callback. */ -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { ExecCount *cnt; uint64_t pc =3D qemu_plugin_tb_vaddr(tb); diff --git a/contrib/plugins/hotpages.c b/contrib/plugins/hotpages.c index a6d83b06c75..d8321a73303 100644 --- a/contrib/plugins/hotpages.c +++ b/contrib/plugins/hotpages.c @@ -148,7 +148,7 @@ static void vcpu_haddr(unsigned int cpu_index, qemu_plu= gin_meminfo_t meminfo, g_mutex_unlock(&lock); } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { size_t n =3D qemu_plugin_tb_n_insns(tb); size_t i; diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index 75728896198..feabc10bf44 100644 --- a/contrib/plugins/howvec.c +++ b/contrib/plugins/howvec.c @@ -310,7 +310,7 @@ static struct qemu_plugin_scoreboard *find_counter( return NULL; } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { size_t n =3D qemu_plugin_tb_n_insns(tb); size_t i; diff --git a/contrib/plugins/hwprofile.c b/contrib/plugins/hwprofile.c index b7f96117e94..fcc993015d7 100644 --- a/contrib/plugins/hwprofile.c +++ b/contrib/plugins/hwprofile.c @@ -242,7 +242,7 @@ static void vcpu_haddr(unsigned int cpu_index, qemu_plu= gin_meminfo_t meminfo, } } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { size_t n =3D qemu_plugin_tb_n_insns(tb); size_t i; diff --git a/contrib/plugins/ips.c b/contrib/plugins/ips.c index 2c110906731..a1fcba7c5d6 100644 --- a/contrib/plugins/ips.c +++ b/contrib/plugins/ips.c @@ -110,7 +110,7 @@ static void every_quantum_insn(unsigned int cpu_index, = void *udata) update_system_time(vcpu); } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { size_t n_insns =3D qemu_plugin_tb_n_insns(tb); qemu_plugin_u64 quantum_insn =3D diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index c1c2b0aca8e..dc527ad56e2 100644 --- a/contrib/plugins/lockstep.c +++ b/contrib/plugins/lockstep.c @@ -249,7 +249,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *= udata) log =3D g_slist_prepend(log, exec); } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { BlockInfo *bi =3D g_new0(BlockInfo, 1); bi->pc =3D qemu_plugin_tb_vaddr(tb); diff --git a/contrib/plugins/stoptrigger.c b/contrib/plugins/stoptrigger.c index 40f8fd313d7..222a3f92ae0 100644 --- a/contrib/plugins/stoptrigger.c +++ b/contrib/plugins/stoptrigger.c @@ -64,7 +64,7 @@ static void exit_address_reached(unsigned int cpu_index, = void *udata) exit_emulation(ei->exit_code, msg); } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { size_t tb_n =3D qemu_plugin_tb_n_insns(tb); for (size_t i =3D 0; i < tb_n; i++) { diff --git a/contrib/plugins/uftrace.c b/contrib/plugins/uftrace.c index 8be8409dce2..a1b10f9cf59 100644 --- a/contrib/plugins/uftrace.c +++ b/contrib/plugins/uftrace.c @@ -838,7 +838,7 @@ static void track_callstack(unsigned int cpu_index, voi= d *udata) trace_enter_stack(t, cs, timestamp); } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { size_t n_insns =3D qemu_plugin_tb_n_insns(tb); uintptr_t tb_pc =3D qemu_plugin_tb_vaddr(tb); diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 60d27d8d9c1..8242e054054 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -417,11 +417,9 @@ enum qemu_plugin_cond { =20 /** * typedef qemu_plugin_vcpu_tb_trans_cb_t - translation callback - * @id: unique plugin id * @tb: opaque handle used for querying and instrumenting a block. */ -typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(qemu_plugin_id_t id, - struct qemu_plugin_tb *tb); +typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(struct qemu_plugin_tb *tb); =20 /** * qemu_plugin_register_vcpu_tb_trans_cb() - register a translate cb diff --git a/plugins/core.c b/plugins/core.c index 3c3212aedda..c77da4d36fd 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -487,7 +487,7 @@ void qemu_plugin_tb_trans_cb(CPUState *cpu, struct qemu= _plugin_tb *tb) qemu_plugin_vcpu_tb_trans_cb_t func =3D cb->f.vcpu_tb_trans; =20 qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_RW_REGS); - func(cb->ctx->id, tb); + func(tb); qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); } } diff --git a/tests/tcg/plugins/bb.c b/tests/tcg/plugins/bb.c index ba605246eb0..713063f4945 100644 --- a/tests/tcg/plugins/bb.c +++ b/tests/tcg/plugins/bb.c @@ -77,7 +77,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *ud= ata) count->bb_count++; } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { size_t n_insns =3D qemu_plugin_tb_n_insns(tb); =20 diff --git a/tests/tcg/plugins/discons.c b/tests/tcg/plugins/discons.c index 5ab645705e3..d2a163a5714 100644 --- a/tests/tcg/plugins/discons.c +++ b/tests/tcg/plugins/discons.c @@ -147,7 +147,7 @@ static void insn_exec(unsigned int vcpu_index, void *us= erdata) } } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { size_t n_insns =3D qemu_plugin_tb_n_insns(tb); for (size_t i =3D 0; i < n_insns; i++) { diff --git a/tests/tcg/plugins/empty.c b/tests/tcg/plugins/empty.c index 8fa6bacd93d..5927507c18e 100644 --- a/tests/tcg/plugins/empty.c +++ b/tests/tcg/plugins/empty.c @@ -20,7 +20,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGI= N_VERSION; * This allows us to measure the overhead of injecting and then * removing empty instrumentation. */ -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { } =20 QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, diff --git a/tests/tcg/plugins/inline.c b/tests/tcg/plugins/inline.c index 1d17884b40b..3f5c49f5ede 100644 --- a/tests/tcg/plugins/inline.c +++ b/tests/tcg/plugins/inline.c @@ -223,7 +223,7 @@ static void vcpu_mem_access(unsigned int cpu_index, g_mutex_unlock(&mem_lock); } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { void *tb_store =3D tb; qemu_plugin_register_vcpu_tb_exec_inline_per_vcpu( diff --git a/tests/tcg/plugins/insn.c b/tests/tcg/plugins/insn.c index d9f94888d6f..a303275ea1b 100644 --- a/tests/tcg/plugins/insn.c +++ b/tests/tcg/plugins/insn.c @@ -138,7 +138,7 @@ static void vcpu_insn_matched_exec_before(unsigned int = cpu_index, void *udata) } } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { size_t n =3D qemu_plugin_tb_n_insns(tb); size_t i; diff --git a/tests/tcg/plugins/mem.c b/tests/tcg/plugins/mem.c index 5cdf71c7e49..24a3bce0bfd 100644 --- a/tests/tcg/plugins/mem.c +++ b/tests/tcg/plugins/mem.c @@ -266,7 +266,7 @@ static void print_access(unsigned int cpu_index, qemu_p= lugin_meminfo_t meminfo, qemu_plugin_outs(out->str); } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { size_t n =3D qemu_plugin_tb_n_insns(tb); size_t i; diff --git a/tests/tcg/plugins/patch.c b/tests/tcg/plugins/patch.c index eba2f8b8d6c..8fcf0bd409b 100644 --- a/tests/tcg/plugins/patch.c +++ b/tests/tcg/plugins/patch.c @@ -130,7 +130,7 @@ static void patch_vaddr(unsigned int vcpu_index, void *= userdata) /* * Callback on translation of a translation block. */ -static void vcpu_tb_trans_cb(qemu_plugin_id_t id, struct qemu_plugin_tb *t= b) +static void vcpu_tb_trans_cb(struct qemu_plugin_tb *tb) { g_autoptr(GByteArray) insn_data =3D g_byte_array_new(); uintptr_t addr =3D 0; diff --git a/tests/tcg/plugins/reset.c b/tests/tcg/plugins/reset.c index ef5a32781b2..1fdf114e5e0 100644 --- a/tests/tcg/plugins/reset.c +++ b/tests/tcg/plugins/reset.c @@ -27,7 +27,7 @@ static void tb_exec_after_reset(unsigned int vcpu_index, = void *userdata) qemu_plugin_uninstall(plugin_id, after_uninstall, NULL); } =20 -static void tb_trans_after_reset(qemu_plugin_id_t id, struct qemu_plugin_t= b *tb) +static void tb_trans_after_reset(struct qemu_plugin_tb *tb) { g_assert(was_reset && !was_uninstalled); qemu_plugin_register_vcpu_tb_exec_cb(tb, tb_exec_after_reset, @@ -49,7 +49,7 @@ static void tb_exec_before_reset(unsigned int vcpu_index,= void *userdata) qemu_plugin_reset(plugin_id, after_reset, (void *) plugin_id); } =20 -static void tb_trans_before_reset(qemu_plugin_id_t id, struct qemu_plugin_= tb *tb) +static void tb_trans_before_reset(struct qemu_plugin_tb *tb) { g_assert(!was_reset && !was_uninstalled); qemu_plugin_register_vcpu_tb_exec_cb(tb, tb_exec_before_reset, diff --git a/tests/tcg/plugins/setpc.c b/tests/tcg/plugins/setpc.c index 8f2d025e245..44cea064783 100644 --- a/tests/tcg/plugins/setpc.c +++ b/tests/tcg/plugins/setpc.c @@ -73,7 +73,7 @@ static void vcpu_mem_access(unsigned int vcpu_index, } } =20 -static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb) { size_t insns =3D qemu_plugin_tb_n_insns(tb); for (size_t i =3D 0; i < insns; i++) { --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520105; cv=none; d=zohomail.com; s=zohoarc; b=k6YwSZQCjX72yn+luOyU08T33hK9eWM0jCcw0FTGfnvRxy4BPGo6RYDgC/GyZTqB2XGnaxDlZa2+bOi2bnjSV6qxETVRXtAptV3Gn+fwsuV6j2wdhuihvOnM7yH2ryzrpnF9b60oZf/w0HyInTHmKHJDCkaJWEUNs8awQmoZ2RY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520105; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lXNzoOVFeilbT4v9yfKYd/8IIuIQM92poyM3BhyK2e4=; b=h97mAxAOUsX8n5C4yMyiA6JtLm2nsVyMkBkVpIFnaksx8FKXFBiF2XyT49r9E/P5dHrPcta5yl9Ry91YvSkJ+IT5wOVb5xOR5uYF+WC9dEJaGA/28LhFKQeQ/JrvUGoZQtfD7R53l3oyxcO3Q4nq9/VVuxLw0aZuq6hg8CzbBdI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520105013369.562478026308; Wed, 3 Jun 2026 13:55:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsb5-0002VL-EM; Wed, 03 Jun 2026 16:53:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZm-00088z-GS for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:39 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZd-0004Gx-2S for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:31 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653HABwg2651480 for ; Wed, 3 Jun 2026 20:52:21 GMT Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejre9gvh5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:21 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-30762d67a64so444225eec.0 for ; Wed, 03 Jun 2026 13:52:21 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=lXNzoOVFeil bT4v9yfKYd/8IIuIQM92poyM3BhyK2e4=; b=R6E5onNV1bQ1GqYoEVlcC+EtyRF JwmldGKc3BBe84GoPctQl3F/bYLyrIseO3KuXhsal9MyQBCOCQ9RbJqfx54ZBlPo hsSkxPicMq3EVk/qKfxsa5ay83v2ZwqGjl963LbmUUlcniB3U3gJ326LIUi4Ofb+ z6iszolI+rhOKGVuxXPQ9HF01FFhndC7y0yF4ySCMlIhO1PG6bjeB7LqFl4jegsT oGwPbus/K7DmTtXD9M/vQi8AuktWzI/cOWSIj/xBH9LPi+wjGGdWSqmU4shyo90H xoxyfxGPP8syzvoLii7HOfSlqImg1VTECE0pfd3lNL0PQvY/FI/pT/x2kSQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519940; x=1781124740; 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=lXNzoOVFeilbT4v9yfKYd/8IIuIQM92poyM3BhyK2e4=; b=TLs5m1JeOTh10cctPtrXgZCoJheSkf/w+hBd5vAH6TPiwPwU4vJylRT2+MaA3uOD1B mIcTHbkIPbXDTeLFabyz9jT72Pm98PQwNchi//98lCKnkoY1Z9jY9hUXLKkAhKNFPSc6 M+pBSusOPOGqQPUPG31CaHXEZHh6cs9tZrLg2EF0d0eJhkhFgcRU55/AOJ2XQ9P8qTtT JnbA1ti1b3wuvAKtjYZ+PArDCmrntDvO76vyBzPuzm2hllAOJVShD46zRqeKVQIF8Szi wpemhXK3gHpwc11EEFhzzr4crfTTSf5dX75OiGB7taGr09KX2hkgpa+ywNmKah6mCR/Y qsGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519940; x=1781124740; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lXNzoOVFeilbT4v9yfKYd/8IIuIQM92poyM3BhyK2e4=; b=LTdQK9MmQaBymMM/nt7fwNg4qyj1HCHr+JoSK4BEJ41WOBZ7QZTfjrvzmzqqSgC3mL Rd+J2q3ZwMI4UuiKGova28ih93rM2uqvvS0mlOKJAmZnkigGuhYFs71U66yoewSUVC04 5dkq0WROaRK5j1xkodm5RjNXBu11EXAgmS8/ZOh9qjWUIRYnYNEikv2n2LjWr5Qmr06K Zm0yQI+FbQUQ6e3tpfxvsB3EMSAlEhN98Lib+Ftn/HTp767A4Qqz/3Kp8rsg7tpYKy9O YHp5s1wKm+md+lK1O43b/fWeIAHqf3bZEhlwVOzmboxsBScuio9apizn92goZIBXyhnZ P6kg== X-Gm-Message-State: AOJu0YyIa1MOi2xrGy4rNL0JAyYyHRJSjBIKR0gmnN64Elf/p22vyy2L Hu/Sxc6E7Upum2Gobjmum4Qj6e5eG2uTyeWEDMEj31vAwE8BjBnPP0tTwNRcVqxoF3/Ma/3p+LE Zti5ASHIQM8wklD8P1Sznyn/4eIHeI5LY/W+AsooJImpYuiqN1dY5rRh7GT2o90rKoZS0 X-Gm-Gg: Acq92OEMuD682Z2Zy0biMrUTVhBXmLSFjEVKhhdNJ5CF+LrIlx1Je4r3dGkQUwqPoQX 3BgNrbKZdSoA1pf/ExuAsNPOX3sE2EsaRYMmI1Rdv8VLiSWolVahckBZ1mYToz3sv8LjtFgfz01 dwYFs9BBOsC4BYcP8G2Ka/fDSSWrAu5IXt/E3M8hqYbSCUWJfUKKXMmTuTN5YpOTLYHr6EL9aQa K17FQ8nZBhyaDs7QGmw4XsxvDlu493InGaqYCd2KX3Vi9Utdh4FuqFvW2BGl2g9r/PPNMcnMKid uJflY2nVGd6pLKdYz1olK0W6qDwYlBp2jCiXzDd060LeMiS+bW3Q0+Pi0+KWhLMXVsUZQgEVwtn WF1PqIdkdE+mw/n07CksnO95oJAo34oXyokLdz2v6UktriBR17+hkBz14Vz/M5fZ7ORJZxltjS0 X5VCwUgcEE0gdjjuWw X-Received: by 2002:a05:693c:37c2:b0:304:c520:4e14 with SMTP id 5a478bee46e88-3074fabd8d6mr2453625eec.11.1780519939961; Wed, 03 Jun 2026 13:52:19 -0700 (PDT) X-Received: by 2002:a05:693c:37c2:b0:304:c520:4e14 with SMTP id 5a478bee46e88-3074fabd8d6mr2453608eec.11.1780519939285; Wed, 03 Jun 2026 13:52:19 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 16/25] plugins: add userdata to qemu_plugin_vcpu_tb_trans_cb_t Date: Wed, 3 Jun 2026 13:51:43 -0700 Message-ID: <20260603205152.1440291-17-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: qABYCB2lJy-0Onvg0vMeZzPbXaDqC_B4 X-Proofpoint-GUID: qABYCB2lJy-0Onvg0vMeZzPbXaDqC_B4 X-Authority-Analysis: v=2.4 cv=KoF9H2WN c=1 sm=1 tr=0 ts=6a209405 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=t56wdHKumdETyko2czkA:9 a=O8hF6Hzn-FEA:10 a=6Ab_bkdmUrQuMsNx7PHu:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX/ftKr+EANNPR DmAxL/khtn+hGZehPXb/HkYWj/mnYS/qWpFZij1qEjhs/UKwUa/FhdwJ/0wTAmLtdLSRA9fwwtB KBFRLfaazx/QhBDeVf1gRiSK/GgQBKJ6l9mZpouWgrQ5ihJ5onnYBM8EBJxbhCylWqP86XwAO5O lHHkFV12AmUheI6BJ9hhX4FBBKRNcoii1Q6D2RAfdAhQF56ur8pTs9C3SV6IoQ/6XPOO85MovQZ 0sU6r5hP00eHztonc8bP7uEFYYVvqnUQr0KRPw2b0kSzAlYfIWlgzswYiQSh3HODUMClOMIqC7Y aMM3AO2xajXpxB7pLsULV/DYDJ+nmZHO9zcZAuM+7iAqQJMNbtPN1dj/4KMfT8d/YwTfEq1+E+V shhh0PnUGJWis/cYh55hmurBvv1tvnv29DxcfcYEtWKdmsVwPBk9U/6Ac6r6C8zq76LwZML/U0S F2gWi6+XuP3mTwd3mUg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 suspectscore=0 priorityscore=1501 adultscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520105903154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- contrib/plugins/bbv.c | 4 ++-- contrib/plugins/cache.c | 4 ++-- contrib/plugins/cflow.c | 4 ++-- contrib/plugins/cpp.cpp | 4 ++-- contrib/plugins/drcov.c | 4 ++-- contrib/plugins/execlog.c | 4 ++-- contrib/plugins/hotblocks.c | 4 ++-- contrib/plugins/hotpages.c | 4 ++-- contrib/plugins/howvec.c | 4 ++-- contrib/plugins/hwprofile.c | 4 ++-- contrib/plugins/ips.c | 4 ++-- contrib/plugins/lockstep.c | 4 ++-- contrib/plugins/stoptrigger.c | 4 ++-- contrib/plugins/uftrace.c | 4 ++-- include/plugins/qemu-plugin.h | 8 ++++++-- plugins/api.c | 5 +++-- plugins/core.c | 2 +- tests/tcg/plugins/bb.c | 4 ++-- tests/tcg/plugins/discons.c | 4 ++-- tests/tcg/plugins/empty.c | 4 ++-- tests/tcg/plugins/inline.c | 4 ++-- tests/tcg/plugins/insn.c | 4 ++-- tests/tcg/plugins/mem.c | 4 ++-- tests/tcg/plugins/patch.c | 4 ++-- tests/tcg/plugins/reset.c | 8 ++++---- tests/tcg/plugins/setpc.c | 4 ++-- 26 files changed, 58 insertions(+), 53 deletions(-) diff --git a/contrib/plugins/bbv.c b/contrib/plugins/bbv.c index 7e9e72477d7..0e6ec673d97 100644 --- a/contrib/plugins/bbv.c +++ b/contrib/plugins/bbv.c @@ -102,7 +102,7 @@ static void vcpu_interval_exec(unsigned int vcpu_index,= void *udata) fputc('\n', vcpu->file); } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { uint64_t n_insns =3D qemu_plugin_tb_n_insns(tb); uint64_t vaddr =3D qemu_plugin_tb_vaddr(tb); @@ -157,7 +157,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, vcpus =3D qemu_plugin_scoreboard_new(sizeof(Vcpu)); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); qemu_plugin_register_vcpu_init_cb(id, vcpu_init, NULL); - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); =20 return 0; } diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index c9d61de26c9..0a5349f131e 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -462,7 +462,7 @@ static void vcpu_insn_exec(unsigned int vcpu_index, voi= d *userdata) g_mutex_unlock(&l2_ucache_locks[cache_idx]); } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { size_t n_insns; size_t i; @@ -844,7 +844,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu= _info_t *info, l1_icache_locks =3D g_new0(GMutex, cores); l2_ucache_locks =3D use_l2 ? g_new0(GMutex, cores) : NULL; =20 - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); =20 miss_ht =3D g_hash_table_new_full(g_int64_hash, g_int64_equal, NULL, i= nsn_free); diff --git a/contrib/plugins/cflow.c b/contrib/plugins/cflow.c index 9a850c8c0cc..319a7a7fc07 100644 --- a/contrib/plugins/cflow.c +++ b/contrib/plugins/cflow.c @@ -297,7 +297,7 @@ static void vcpu_tb_branched_exec(unsigned int cpu_inde= x, void *udata) * instructions for their execution. * */ -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { uint64_t pc =3D qemu_plugin_tb_vaddr(tb); size_t insns =3D qemu_plugin_tb_n_insns(tb); @@ -387,7 +387,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu= _info_t *info, =20 plugin_init(); =20 - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; } diff --git a/contrib/plugins/cpp.cpp b/contrib/plugins/cpp.cpp index 34243cc922f..a0bb261fbe8 100644 --- a/contrib/plugins/cpp.cpp +++ b/contrib/plugins/cpp.cpp @@ -363,7 +363,7 @@ =20 QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { } =20 @@ -371,6 +371,6 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, const qemu_info_t *info, int argc, char **argv) { - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); return 0; } diff --git a/contrib/plugins/drcov.c b/contrib/plugins/drcov.c index 2dc08512d44..5a18a8f48b4 100644 --- a/contrib/plugins/drcov.c +++ b/contrib/plugins/drcov.c @@ -119,7 +119,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *= udata) g_mutex_unlock(&lock); } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { uint64_t pc =3D qemu_plugin_tb_vaddr(tb); size_t n =3D qemu_plugin_tb_n_insns(tb); @@ -156,7 +156,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu= _info_t *info, =20 plugin_init(); =20 - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); =20 return 0; diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index 8329112305c..74325495cce 100644 --- a/contrib/plugins/execlog.c +++ b/contrib/plugins/execlog.c @@ -177,7 +177,7 @@ static void vcpu_insn_exec(unsigned int cpu_index, void= *udata) * QEMU convert code by translation block (TB). By hooking here we can the= n hook * a callback on each instruction and memory access. */ -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { struct qemu_plugin_insn *insn; bool skip =3D (imatches || amatches); @@ -482,7 +482,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, =20 /* Register init, translation block and exit callbacks */ qemu_plugin_register_vcpu_init_cb(id, vcpu_init, NULL); - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); =20 return 0; diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 682b160019a..ea746b513a1 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -121,7 +121,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *= udata) * Otherwise a helper is inserted which calls the vcpu_tb_exec * callback. */ -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { ExecCount *cnt; uint64_t pc =3D qemu_plugin_tb_vaddr(tb); @@ -186,7 +186,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu= _info_t *info, =20 plugin_init(); =20 - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; } diff --git a/contrib/plugins/hotpages.c b/contrib/plugins/hotpages.c index d8321a73303..56e5698ce1d 100644 --- a/contrib/plugins/hotpages.c +++ b/contrib/plugins/hotpages.c @@ -148,7 +148,7 @@ static void vcpu_haddr(unsigned int cpu_index, qemu_plu= gin_meminfo_t meminfo, g_mutex_unlock(&lock); } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { size_t n =3D qemu_plugin_tb_n_insns(tb); size_t i; @@ -197,7 +197,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu= _info_t *info, =20 plugin_init(); =20 - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; } diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index feabc10bf44..55db9ff8028 100644 --- a/contrib/plugins/howvec.c +++ b/contrib/plugins/howvec.c @@ -310,7 +310,7 @@ static struct qemu_plugin_scoreboard *find_counter( return NULL; } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { size_t n =3D qemu_plugin_tb_n_insns(tb); size_t i; @@ -392,7 +392,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, =20 plugin_init(); =20 - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; } diff --git a/contrib/plugins/hwprofile.c b/contrib/plugins/hwprofile.c index fcc993015d7..87b0267ffe3 100644 --- a/contrib/plugins/hwprofile.c +++ b/contrib/plugins/hwprofile.c @@ -242,7 +242,7 @@ static void vcpu_haddr(unsigned int cpu_index, qemu_plu= gin_meminfo_t meminfo, } } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { size_t n =3D qemu_plugin_tb_n_insns(tb); size_t i; @@ -319,7 +319,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu= _info_t *info, =20 plugin_init(); =20 - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; } diff --git a/contrib/plugins/ips.c b/contrib/plugins/ips.c index a1fcba7c5d6..6f7ac1587ec 100644 --- a/contrib/plugins/ips.c +++ b/contrib/plugins/ips.c @@ -110,7 +110,7 @@ static void every_quantum_insn(unsigned int cpu_index, = void *udata) update_system_time(vcpu); } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { size_t n_insns =3D qemu_plugin_tb_n_insns(tb); qemu_plugin_u64 quantum_insn =3D @@ -206,7 +206,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, time_handle =3D qemu_plugin_request_time_control(); g_assert(time_handle); =20 - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_vcpu_init_cb(id, vcpu_init, NULL); qemu_plugin_register_vcpu_exit_cb(id, vcpu_exit, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index dc527ad56e2..ed9d18460fe 100644 --- a/contrib/plugins/lockstep.c +++ b/contrib/plugins/lockstep.c @@ -249,7 +249,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *= udata) log =3D g_slist_prepend(log, exec); } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { BlockInfo *bi =3D g_new0(BlockInfo, 1); bi->pc =3D qemu_plugin_tb_vaddr(tb); @@ -392,7 +392,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, =20 our_id =3D id; =20 - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, (void *)id); return 0; } diff --git a/contrib/plugins/stoptrigger.c b/contrib/plugins/stoptrigger.c index 222a3f92ae0..3babd014171 100644 --- a/contrib/plugins/stoptrigger.c +++ b/contrib/plugins/stoptrigger.c @@ -64,7 +64,7 @@ static void exit_address_reached(unsigned int cpu_index, = void *udata) exit_emulation(ei->exit_code, msg); } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { size_t tb_n =3D qemu_plugin_tb_n_insns(tb); for (size_t i =3D 0; i < tb_n; i++) { @@ -150,7 +150,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, } =20 /* Register translation block and exit callbacks */ - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); =20 return 0; diff --git a/contrib/plugins/uftrace.c b/contrib/plugins/uftrace.c index a1b10f9cf59..9b0a4963aee 100644 --- a/contrib/plugins/uftrace.c +++ b/contrib/plugins/uftrace.c @@ -838,7 +838,7 @@ static void track_callstack(unsigned int cpu_index, voi= d *udata) trace_enter_stack(t, cs, timestamp); } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { size_t n_insns =3D qemu_plugin_tb_n_insns(tb); uintptr_t tb_pc =3D qemu_plugin_tb_vaddr(tb); @@ -987,7 +987,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, score =3D qemu_plugin_scoreboard_new(sizeof(Cpu)); qemu_plugin_register_vcpu_init_cb(id, vcpu_init, NULL); qemu_plugin_register_atexit_cb(id, at_exit, (void *) info->system_emul= ation); - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); =20 return 0; } diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 8242e054054..53daa09fc72 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -418,13 +418,16 @@ enum qemu_plugin_cond { /** * typedef qemu_plugin_vcpu_tb_trans_cb_t - translation callback * @tb: opaque handle used for querying and instrumenting a block. + * @userdata: any plugin data to pass to the @cb */ -typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(struct qemu_plugin_tb *tb); +typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(struct qemu_plugin_tb *tb, + void *userdata); =20 /** * qemu_plugin_register_vcpu_tb_trans_cb() - register a translate cb * @id: plugin ID * @cb: callback function + * @userdata: any plugin data to pass to the @cb * * The @cb function is called every time a translation occurs. The @cb * function is passed an opaque qemu_plugin_type which it can query @@ -435,7 +438,8 @@ typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(struct q= emu_plugin_tb *tb); */ QEMU_PLUGIN_API void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_tb_trans_cb_t = cb); + qemu_plugin_vcpu_tb_trans_cb_t = cb, + void *userdata); =20 /** * qemu_plugin_register_vcpu_tb_exec_cb() - register execution callback diff --git a/plugins/api.c b/plugins/api.c index 849790fe13b..774b1b80214 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -195,9 +195,10 @@ void qemu_plugin_register_vcpu_mem_inline_per_vcpu( } =20 void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_tb_trans_cb_t = cb) + qemu_plugin_vcpu_tb_trans_cb_t = cb, + void *userdata) { - plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_TB_TRANS, cb); + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_VCPU_TB_TRANS, cb, userdat= a); } =20 void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_id_t id, diff --git a/plugins/core.c b/plugins/core.c index c77da4d36fd..d891da93040 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -487,7 +487,7 @@ void qemu_plugin_tb_trans_cb(CPUState *cpu, struct qemu= _plugin_tb *tb) qemu_plugin_vcpu_tb_trans_cb_t func =3D cb->f.vcpu_tb_trans; =20 qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_RW_REGS); - func(tb); + func(tb, cb->udata); qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); } } diff --git a/tests/tcg/plugins/bb.c b/tests/tcg/plugins/bb.c index 713063f4945..90adb3ebd97 100644 --- a/tests/tcg/plugins/bb.c +++ b/tests/tcg/plugins/bb.c @@ -77,7 +77,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *ud= ata) count->bb_count++; } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { size_t n_insns =3D qemu_plugin_tb_n_insns(tb); =20 @@ -127,7 +127,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, qemu_plugin_register_vcpu_idle_cb(id, vcpu_idle, NULL); } =20 - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; } diff --git a/tests/tcg/plugins/discons.c b/tests/tcg/plugins/discons.c index d2a163a5714..45f24397047 100644 --- a/tests/tcg/plugins/discons.c +++ b/tests/tcg/plugins/discons.c @@ -147,7 +147,7 @@ static void insn_exec(unsigned int vcpu_index, void *us= erdata) } } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { size_t n_insns =3D qemu_plugin_tb_n_insns(tb); for (size_t i =3D 0; i < n_insns; i++) { @@ -215,7 +215,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, =20 qemu_plugin_register_vcpu_discon_cb(id, QEMU_PLUGIN_DISCON_ALL, vcpu_discon, NULL); - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); =20 return 0; } diff --git a/tests/tcg/plugins/empty.c b/tests/tcg/plugins/empty.c index 5927507c18e..286b3035e61 100644 --- a/tests/tcg/plugins/empty.c +++ b/tests/tcg/plugins/empty.c @@ -20,13 +20,13 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLU= GIN_VERSION; * This allows us to measure the overhead of injecting and then * removing empty instrumentation. */ -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { } =20 QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, int argc, char **argv) { - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); return 0; } diff --git a/tests/tcg/plugins/inline.c b/tests/tcg/plugins/inline.c index 3f5c49f5ede..436223db0e6 100644 --- a/tests/tcg/plugins/inline.c +++ b/tests/tcg/plugins/inline.c @@ -223,7 +223,7 @@ static void vcpu_mem_access(unsigned int cpu_index, g_mutex_unlock(&mem_lock); } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { void *tb_store =3D tb; qemu_plugin_register_vcpu_tb_exec_inline_per_vcpu( @@ -303,7 +303,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu= _info_t *info, data_tb =3D qemu_plugin_scoreboard_u64_in_struct(data, CPUData, data_t= b); data_mem =3D qemu_plugin_scoreboard_u64_in_struct(data, CPUData, data_= mem); =20 - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); =20 return 0; diff --git a/tests/tcg/plugins/insn.c b/tests/tcg/plugins/insn.c index a303275ea1b..4ab30d6df8c 100644 --- a/tests/tcg/plugins/insn.c +++ b/tests/tcg/plugins/insn.c @@ -138,7 +138,7 @@ static void vcpu_insn_matched_exec_before(unsigned int = cpu_index, void *udata) } } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { size_t n =3D qemu_plugin_tb_n_insns(tb); size_t i; @@ -297,7 +297,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, =20 /* Register init, translation block and exit callbacks */ qemu_plugin_register_vcpu_init_cb(id, vcpu_init, NULL); - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; } diff --git a/tests/tcg/plugins/mem.c b/tests/tcg/plugins/mem.c index 24a3bce0bfd..e56d10574bd 100644 --- a/tests/tcg/plugins/mem.c +++ b/tests/tcg/plugins/mem.c @@ -266,7 +266,7 @@ static void print_access(unsigned int cpu_index, qemu_p= lugin_meminfo_t meminfo, qemu_plugin_outs(out->str); } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { size_t n =3D qemu_plugin_tb_n_insns(tb); size_t i; @@ -374,7 +374,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, mem_count =3D qemu_plugin_scoreboard_u64_in_struct( counts, CPUCount, mem_count); io_count =3D qemu_plugin_scoreboard_u64_in_struct(counts, CPUCount, io= _count); - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; } diff --git a/tests/tcg/plugins/patch.c b/tests/tcg/plugins/patch.c index 8fcf0bd409b..59215f8546e 100644 --- a/tests/tcg/plugins/patch.c +++ b/tests/tcg/plugins/patch.c @@ -130,7 +130,7 @@ static void patch_vaddr(unsigned int vcpu_index, void *= userdata) /* * Callback on translation of a translation block. */ -static void vcpu_tb_trans_cb(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans_cb(struct qemu_plugin_tb *tb, void *userdata) { g_autoptr(GByteArray) insn_data =3D g_byte_array_new(); uintptr_t addr =3D 0; @@ -245,7 +245,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, return -1; } =20 - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans_cb); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans_cb, NULL); =20 return 0; } diff --git a/tests/tcg/plugins/reset.c b/tests/tcg/plugins/reset.c index 1fdf114e5e0..949f2d6160a 100644 --- a/tests/tcg/plugins/reset.c +++ b/tests/tcg/plugins/reset.c @@ -27,7 +27,7 @@ static void tb_exec_after_reset(unsigned int vcpu_index, = void *userdata) qemu_plugin_uninstall(plugin_id, after_uninstall, NULL); } =20 -static void tb_trans_after_reset(struct qemu_plugin_tb *tb) +static void tb_trans_after_reset(struct qemu_plugin_tb *tb, void *userdata) { g_assert(was_reset && !was_uninstalled); qemu_plugin_register_vcpu_tb_exec_cb(tb, tb_exec_after_reset, @@ -40,7 +40,7 @@ static void after_reset(void *userdata) g_assert(!was_reset && !was_uninstalled); qemu_plugin_outs("reset done\n"); was_reset =3D true; - qemu_plugin_register_vcpu_tb_trans_cb(id, tb_trans_after_reset); + qemu_plugin_register_vcpu_tb_trans_cb(id, tb_trans_after_reset, NULL); } =20 static void tb_exec_before_reset(unsigned int vcpu_index, void *userdata) @@ -49,7 +49,7 @@ static void tb_exec_before_reset(unsigned int vcpu_index,= void *userdata) qemu_plugin_reset(plugin_id, after_reset, (void *) plugin_id); } =20 -static void tb_trans_before_reset(struct qemu_plugin_tb *tb) +static void tb_trans_before_reset(struct qemu_plugin_tb *tb, void *userdat= a) { g_assert(!was_reset && !was_uninstalled); qemu_plugin_register_vcpu_tb_exec_cb(tb, tb_exec_before_reset, @@ -61,7 +61,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id= _t id, int argc, char **argv) { plugin_id =3D id; - qemu_plugin_register_vcpu_tb_trans_cb(id, tb_trans_before_reset); + qemu_plugin_register_vcpu_tb_trans_cb(id, tb_trans_before_reset, NULL); return 0; } =20 diff --git a/tests/tcg/plugins/setpc.c b/tests/tcg/plugins/setpc.c index 44cea064783..595571cdfd9 100644 --- a/tests/tcg/plugins/setpc.c +++ b/tests/tcg/plugins/setpc.c @@ -73,7 +73,7 @@ static void vcpu_mem_access(unsigned int vcpu_index, } } =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb) +static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) { size_t insns =3D qemu_plugin_tb_n_insns(tb); for (size_t i =3D 0; i < insns; i++) { @@ -100,6 +100,6 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, { =20 qemu_plugin_register_vcpu_syscall_filter_cb(id, vcpu_syscall_filter); - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); return 0; } --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520038; cv=none; d=zohomail.com; s=zohoarc; b=mI+84M4f4nD8Qi06TrsmeRvWIgoYYNbn8mMu3sGZhaGwZo+KVPHbxPUmsqRueEM1OxP0uIPkp8naWeICR+CWI7Brb3KvH/vhJJRi6qSJMNV2l47CKIFDAMSkdV5UTn5pTuxxpKfglU1JD0qE/nCOp+TmFxNGA+GH7DPPVhQnbWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520038; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uHWPJptOowllfeARCp7csyqxhGGe6CXgaqzWc8TBjX0=; b=X6HXxyDdxpNMId7Omi8lfqBadEGaNpmY0SVkIaPwX3Huxtyw5+jn3e41CTDHu76tJYlYRE2HUH9r7cKLP24nnAyhjLJNxS5VaF+bsUMsk5W3TXFkGDRxhTfiOVFzu6nASQuUsVHVfeB4BB7qzcbT5u9go13q0jOICSxUmQMimgQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520038410459.7208007618585; Wed, 3 Jun 2026 13:53:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsa8-0008Km-Je; Wed, 03 Jun 2026 16:52:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZp-00089K-24 for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:39 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZi-0004Ho-3F for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:34 -0400 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653KgoI41740458 for ; Wed, 3 Jun 2026 20:52:25 GMT Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejdq7uycx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:24 +0000 (GMT) Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-304ea42b025so587597eec.0 for ; Wed, 03 Jun 2026 13:52:24 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=uHWPJptOowl lfeARCp7csyqxhGGe6CXgaqzWc8TBjX0=; b=BI+kOaQhi5RXHR/s2pN9teEQVT0 NUXx+XkvteGYS4wLrCMxRoN2Zpk4RE6dA0MQ85nNUe0niWuWTocxwHxgRWHW+CV0 x3i/ccWX4ddb4nNBOe98SiWm40Zz5U61XrthbFkR/rFZqx07LfH7LYw1OYp574sG OjV5C4+UjlFLWorHAe3LygcUoUua3cRYvpH0oqViz2iTVShAScx8q2NJTv6Hb1U0 DKP86AMKVEC1Dmd6EJ95JS2xFhTSxy0AEhCme54TqpGYB6nVXyi95PpcFztlrsoF bbucjgYnWc5j/7p+EXxenGYoJfi6D4wAij5n+dkX3t5lkDSyyWxUMCL/g8g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519944; x=1781124744; 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=uHWPJptOowllfeARCp7csyqxhGGe6CXgaqzWc8TBjX0=; b=Lp2EBCVfFIRjrD94pssY9uupz8M3KlSPSnWSeIW0avhLymcKFOH3jUYdfFyPANYnuS LmWATas/YIPHTsJrHP85pd0fSbQ0PhOSlQuyqpH4aCffBOjy2FjTE6LavfVXTOdX7pXG jXKOGli9L6fgtr0yN1W9zpUahUNlw9MrqvufV354Da+nzb/b9GFXsaAOGfJCehGpsH+q PvZ7QtkypkL2PC3KC0yFtyybTpmy//dbCzcLBeiKWRnQUUkrYoIgf9o5klD4qkzBhH0v 4cxcsXMcwrR39MzLfxBr/3WZFrepU6Bk8J2zlli0trr6TLaaqAs4BrvdWDTxt1k/V9UX ZfBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519944; x=1781124744; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=uHWPJptOowllfeARCp7csyqxhGGe6CXgaqzWc8TBjX0=; b=Xh6/nLtmRdu9PEV74fYlUFync083fHDrUs17WkNcm41iG4rem5wdeZcuJnGer5vDp4 lTIIcXL76/oToj8W2h1ciaJmVHokCrXdgd84Q6MRhtDDlHYDWW31gsjAd/BMIF0xo/7U gvfIVhHLBgzNloABoHVsV6UFGvsIgq5awnrz9Li149U7a5dtt+zfGKU5AYWpyKf1HqZB NV8cDjY4ozGDdolUBQ3quszeVuz7F0J7qh76DhOfHV25Yahi/myGaUe9lO1015C3drnn WmYyfXbFr3mr7iAJryx8KJh2Zuv5eCW45loWZE9Z09tcwxuPs9PDgR/PtlfzCmlN/mEq usgA== X-Gm-Message-State: AOJu0YzoNPRuT62+Rlfj1c440AdEZs2/i9oyMlTFctj56KxlVSgTpti5 WJMCID2PTkfuDn+CLqO3iXJNvZ4w/kdly9TAm+7/BU8GW6R4loBczA/BVkhXE536D/uhTVL5oJZ +afIMU2Ad6vCshDc/0VxtIMrlHDaApbrraZD7OfUzqCyEWt5koG6LzK4OLbrh8zJAfGA0 X-Gm-Gg: Acq92OFPayKl+6Oc23+oIXNlvKo1Ycvuo9vLL5f4FWeJt/5bV7aKqL6JI2JfLqH1Qaw NiR7LdAndyoGNsi4yztpKF/Fcv9qxXVy9s7nhCaqj7X//wyIHwhJ3JLzAoZaq3RB6Sjt3M1DsKv +mvdqoov0gPTI064RbFSP6XmkYQaCv8vBjo4ZN39OTJntkbgeWdaq+Z9nodEpKudon39HW61pvs E5l3owpp9fqKLj1ekJgZZk38YKQxmFGzY2JlpAb/VkPeD5fJZklvkU+kOYJNZMAUCWOmpMSj3gT vQDwpkkZwUZcERVZVY5BIRvfgk3Zjvfv8WrQ7VdwAcSi38aNyC2zCs3H2hqflULYfPIhcxBRqEp KX9mg/VXuktAu7Qy/FGwQLlpqY23VUIyldzW0E76xbJoiesBB7gH8LQT7nqXQzAzQVOOUxlCWML +gMCRIhefAyK1UcFBa X-Received: by 2002:a05:7300:d505:b0:2f3:b7b2:cbd3 with SMTP id 5a478bee46e88-30761eff6b3mr478334eec.5.1780519944254; Wed, 03 Jun 2026 13:52:24 -0700 (PDT) X-Received: by 2002:a05:7300:d505:b0:2f3:b7b2:cbd3 with SMTP id 5a478bee46e88-30761eff6b3mr478315eec.5.1780519943667; Wed, 03 Jun 2026 13:52:23 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 17/25] plugins: remove qemu_plugin_id from qemu_plugin_vcpu_syscall_cb_t Date: Wed, 3 Jun 2026 13:51:44 -0700 Message-ID: <20260603205152.1440291-18-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX0icQPFlCunjr Bvik89Xv2OwsBMBpfUj44mbhccbbCLAaSIMwNdXddl53nm5Wh1SPMcPsN7zY427tjyTCvsfFXQU WHZVGKOCL8SIIXqEh16mdBJ3jjfL2/VwqPndFhocZEmpUL6/comZGGkG02N66e07BA1xf6WcSKy g/uIYHjRJyWLkxAT0rdjG36yBS+qPN8mkefEcaaNWL35sUGYTWSDDqbk/dhbgJm/rZbbSJmm0X9 egZ9wWmwYWvdvCZTrGySRUSp/YdphGyhHyL4RUWvnYXHbfEwBdYcCK+2MNrpAJowdqan9XlEIe4 CRDKbEnazIeGD81RlYL9K400Nyf5ULt0pYWMj98I7WDG5pMJ3LW51kCJbSaB7xhw4LUdGDb5/ep WIEFtDXLyhqM65etEUEnuQeJrcPO3r2d8d0Y7fIUy4S1Ab9GT+z4l6llPOdlPNmBm2WR9EiaIEc 5g/ig5PTd9qzDJ2j89w== X-Proofpoint-ORIG-GUID: 1P4dClDotyIws9puQ1R-bTmRUxrvlLpn X-Proofpoint-GUID: 1P4dClDotyIws9puQ1R-bTmRUxrvlLpn X-Authority-Analysis: v=2.4 cv=ccniaHDM c=1 sm=1 tr=0 ts=6a209409 cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=XHT7D-x7ZMtFmikgfWMA:9 a=bBxd6f-gb0O0v-kibOvt:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520040957154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- include/plugins/qemu-plugin.h | 3 +-- plugins/core.c | 2 +- tests/tcg/plugins/syscall.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 53daa09fc72..d82d996bce6 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -830,7 +830,6 @@ void qemu_plugin_update_ns(const void *handle, int64_t = time); =20 /** * typedef qemu_plugin_vcpu_syscall_cb_t - vCPU syscall callback function = type - * @id: plugin id * @vcpu_index: the executing vCPU * @num: the syscall number * @a1: the 1st syscall argument @@ -843,7 +842,7 @@ void qemu_plugin_update_ns(const void *handle, int64_t = time); * @a8: the 8th syscall argument */ typedef void -(*qemu_plugin_vcpu_syscall_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_in= dex, +(*qemu_plugin_vcpu_syscall_cb_t)(unsigned int vcpu_index, int64_t num, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8); diff --git a/plugins/core.c b/plugins/core.c index d891da93040..878fc47cbe1 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -533,7 +533,7 @@ qemu_plugin_vcpu_syscall(CPUState *cpu, int64_t num, ui= nt64_t a1, uint64_t a2, qemu_plugin_vcpu_syscall_cb_t func =3D cb->f.vcpu_syscall; =20 qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_RW_REGS_PC); - func(cb->ctx->id, cpu->cpu_index, num, a1, a2, a3, a4, a5, a6, a7,= a8); + func(cpu->cpu_index, num, a1, a2, a3, a4, a5, a6, a7, a8); qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); } } diff --git a/tests/tcg/plugins/syscall.c b/tests/tcg/plugins/syscall.c index 938646f9359..bfe12ad5558 100644 --- a/tests/tcg/plugins/syscall.c +++ b/tests/tcg/plugins/syscall.c @@ -125,7 +125,7 @@ static void hexdump(const GByteArray *data) qemu_plugin_outs(out->str); } =20 -static void vcpu_syscall(qemu_plugin_id_t id, unsigned int vcpu_index, +static void vcpu_syscall(unsigned int vcpu_index, int64_t num, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8) --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520105; cv=none; d=zohomail.com; s=zohoarc; b=gMprruHX7bGGF9sZyHppXvolecR3uUqDqEKBhtykJKrYt1BABbCTg0RbelEsoI65yl7BtrMR7ODBVGKrpu6kXWqpT3miygsAtcXEY+ausG0xmCOQ0AAshE17aJGaRIeRc8/NFHcOSZnQfdTFFSrMToQn33OCU2WG07EcEtnmrvE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520105; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CiINoMcGNa7BjZALmFPyOcUditi0g/BfBdReZ8MePxg=; b=cocJ989HEKxnqJj3Y7zQlYCabOsSKXp5/H9/b/afLkYNMpNztEQWQ1Koc3uMjNbaBlFz5LxHPH1xJgE4ficnG/f3uQlsnhNg0lkDeQdDW9jPJmeymOh7X5H6WuFhbpXYciwoH95x9pDCBMhx7LNhCmcrsa5gQmHbI69QOmnN7cg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520105620138.5932436998463; Wed, 3 Jun 2026 13:55:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsas-0000zZ-Uw; Wed, 03 Jun 2026 16:53:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZt-0008Cn-ID for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:43 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZm-0004I6-9z for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:38 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653HA6r42651365 for ; Wed, 3 Jun 2026 20:52:26 GMT Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejre9gvhn-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:26 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-30762d67a64so444312eec.0 for ; Wed, 03 Jun 2026 13:52:25 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=CiINoMcGNa7 BjZALmFPyOcUditi0g/BfBdReZ8MePxg=; b=Z1yItKN414+a0FGQQGM+n5pOQGR SdBxucNIzYP+rek+4yIOaW8RK3rYHk3FuP0SeFrr8G8D1kkVqEm2//QMmae5AyJ5 ATqniAi+qpYo9JQhnH9tDxkZ4tANdVd7jdaKWfcV9BADuTTPuUrsByNXSIqf8HAp h8avj6kCoHu1gnnOvSkCT0nHmRz561ThxgKIB9JIiSKyIgXmHE0Sl/ZpaBp3iG6E 3wE1WBMnFUOWht3/B5354S0kMFAfu2OiE3f0m8lWbrmtJsq9EPzo0+eFIYB7dyxJ RTFIGoxSfjU2B60ZEHpQ8M3GbBVpt+XU1Vm39MWfHbMYIxm/lOqBNWe/ciQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519945; x=1781124745; 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=CiINoMcGNa7BjZALmFPyOcUditi0g/BfBdReZ8MePxg=; b=IlbNSqLhXrEf6OsvBalxuucdu0a6lXpfbcVg18I9ZKRWCYpEuNklwGqdSRLy6n1kW3 9k+a59Dygk65cMqGzJaTYjMW/EAjQ2ckyyRsziJ1P9ZUeLSt0yOJpLk6j6c6ZH+/1I05 g1RGLUrFEq+dDbVngEaoNFIRdy/ojflqIyeiILFsIr5t0mtvhkWaMD9kJBk8JXMg+A+A it+LvUB6+UDOwjpGJMplvibIk4DGN6Yu7KDwZj340Bz/igE0ApZc1a4ZyRIDt192qs6o F7Ys8bcMkVE+IouNbBew4x+nwww5IspwMK4B/ih7QZCNUL7YBR/vmf+8e0DLsQv0G2O7 iyEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519945; x=1781124745; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=CiINoMcGNa7BjZALmFPyOcUditi0g/BfBdReZ8MePxg=; b=scv0wrkna5v9svKP5RB1XdJYrFPgkOSIfTYC9iHSkNsC3SP5PQ+w33mRbCVGXi1Qmo tah9M+SkvIvlrSwEfK2w2Qawc2OWIxFLc1zRTYCp7nnDbTuma4CNP4Qx8ydEXK03cr+Y t3Mls56Lcm3ZiJWP13Mw8S0muk0orGUkjsL8yjxBtNJvUz33KQFifgOAmDY8LYruXQFT Fp5VCweJeCk8QqA+quYUBoRyfGFciVEj+8GNVPe8qm+aRlK8F/99An09t4FEfqbopIvQ ZpyboV2kGPt31Kj6AcTKGVIMAvDwCAgq9Ggt0QXhQkAsERnIe3+UUZWtuOESgVRddEss ZOiA== X-Gm-Message-State: AOJu0YwNbwlC5pJwSTDtqw332ZjtHzeC17wAgBGYB34lIlG4FlUX4Vvl XDoBOZjAbJkayLUeuXMjFWjii6dc5L9sgrSmdJjxTuiFbwNRtQlIbNT8sTiPV6EPE0rW54Z4H49 rbDpMcbA1CAvK9anq8tKnHo/yyAKIz70Gp4wFGzwbehNkXokePB/IDD2xRrDJ2qbq9wGp X-Gm-Gg: Acq92OFf0FpvxMiF+qm7SumX2X36hJdADxGNG9Wx5LKoqDXzT4fddGa2oLABrHy6E4g 9iMF0/5TeAK8pmcraSYmq4rM4eSQRljx7TvV8HTHkA8i/QBMrzWvCqFUOG5AAO4lUYIBmAzinal yPG2vNGJC5Ggx4eWqJK7vKSMG+ULGdKe6ghAdN9bi1P1kYM1CtZPeUfCXbDTTUJNYIO6t4RhbZt UkzVysPhZjvuOYNt4lCfUjn/aldpUv2T1b7+hHWF6FvJQzIvJ3vi1Pvl+F9D5EH6w4PLjwYBkUO x7ifVKUL+RSWAtn3rnSP3MZxEt6I00Sm3b8YFxkE6Zl0xUAeDRUcFEiTR+cTI3TZtZ9V4cGYPVt BfLz/X+i4LFAoGkZXoU/OIhka3VB8gQhX3v7BYmaOTSVJkG3NHkbqndNLMr7U1N3B/UWVnBIM8I 8vZujv/SX2zCmoQHo6 X-Received: by 2002:a05:7300:2393:b0:304:cefc:5fd7 with SMTP id 5a478bee46e88-3074fc910bbmr2757606eec.32.1780519945053; Wed, 03 Jun 2026 13:52:25 -0700 (PDT) X-Received: by 2002:a05:7300:2393:b0:304:cefc:5fd7 with SMTP id 5a478bee46e88-3074fc910bbmr2757582eec.32.1780519944492; Wed, 03 Jun 2026 13:52:24 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 18/25] plugins: add userdata to qemu_plugin_register_vcpu_syscall_cb Date: Wed, 3 Jun 2026 13:51:45 -0700 Message-ID: <20260603205152.1440291-19-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: YjHxKfGQwY1q2Xc_dr3qEJa8ZcdFBl-w X-Proofpoint-GUID: YjHxKfGQwY1q2Xc_dr3qEJa8ZcdFBl-w X-Authority-Analysis: v=2.4 cv=KoF9H2WN c=1 sm=1 tr=0 ts=6a20940a cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=HFGiEJlbZgj7dAjcEtYA:9 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX3JC3htBkIr4j qecnjwhg9rdUJz1RPXfMHlymTUz1CwynzRpYefh3uIues3XRRhxc71kvGdUqmhIkGzzYIZ1eHuk qqVDcR1SH4eVLN3NutPpSkIHXRbx6tNQeNRflBkHcsIue3el3tp+5zClf4/2qeaFHDeNR6dLeTF tBJG2n1yd4gTKeIFficGcHunSocKGf9Qt5leBkS+7wFWhL00+1P9XZVuFeDjrvGZQsYB0+iLZxi wmOeDj7CHhDiuV3VtIUs8xo5qPBBirVnOZ5k34e0BuvToaPrFjO5CHVy5YY+g9EXcVp9zPopKkx Hf1x/OPcnT3HHRQFXM1ErQlvinzhJbZBmjlslIvBERivY8ByPM+y/7LEOy8Vj/yeqNiBySqYEnT 1VjxVwhW+xnGnpmms78+owHWq9+Uj4V1kTtO5gZcyEHXFAhkpi8MEs5JOnb5RmPeWbaqnUCBXRw URPMojwmzb5O2hmTLcA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 suspectscore=0 priorityscore=1501 adultscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520107920154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- include/plugins/qemu-plugin.h | 8 ++++++-- plugins/api.c | 5 +++-- plugins/core.c | 2 +- tests/tcg/plugins/syscall.c | 5 +++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index d82d996bce6..909f19b7128 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -840,12 +840,14 @@ void qemu_plugin_update_ns(const void *handle, int64_= t time); * @a6: the 6th syscall argument * @a7: the 7th syscall argument * @a8: the 8th syscall argument + * @userdata: user data for callback */ typedef void (*qemu_plugin_vcpu_syscall_cb_t)(unsigned int vcpu_index, int64_t num, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5, - uint64_t a6, uint64_t a7, uint64_t a8); + uint64_t a6, uint64_t a7, uint64_t a8, + void *userdata); =20 /** * typedef qemu_plugin_vcpu_syscall_filter_cb_t - vCPU syscall filter call= back @@ -891,13 +893,15 @@ typedef void * qemu_plugin_register_vcpu_syscall_cb() - register a syscall entry callb= ack * @id: plugin id * @cb: callback of type qemu_plugin_vcpu_syscall_cb_t + * @userdata: user data for callback * * This registers a callback for every syscall executed by the guest. The = @cb * function is executed before a syscall is handled by the host. */ QEMU_PLUGIN_API void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_syscall_cb_t cb= ); + qemu_plugin_vcpu_syscall_cb_t cb, + void *userdata); =20 /** * qemu_plugin_register_vcpu_syscall_filter_cb() - register a syscall filt= er diff --git a/plugins/api.c b/plugins/api.c index 774b1b80214..a72cec541dc 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -202,9 +202,10 @@ void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin= _id_t id, } =20 void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_syscall_cb_t cb) + qemu_plugin_vcpu_syscall_cb_t cb, + void *userdata) { - plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_SYSCALL, cb); + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_VCPU_SYSCALL, cb, userdata= ); } =20 void diff --git a/plugins/core.c b/plugins/core.c index 878fc47cbe1..45136bf950a 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -533,7 +533,7 @@ qemu_plugin_vcpu_syscall(CPUState *cpu, int64_t num, ui= nt64_t a1, uint64_t a2, qemu_plugin_vcpu_syscall_cb_t func =3D cb->f.vcpu_syscall; =20 qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_RW_REGS_PC); - func(cpu->cpu_index, num, a1, a2, a3, a4, a5, a6, a7, a8); + func(cpu->cpu_index, num, a1, a2, a3, a4, a5, a6, a7, a8, cb->udat= a); qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); } } diff --git a/tests/tcg/plugins/syscall.c b/tests/tcg/plugins/syscall.c index bfe12ad5558..8a823acfca7 100644 --- a/tests/tcg/plugins/syscall.c +++ b/tests/tcg/plugins/syscall.c @@ -128,7 +128,8 @@ static void hexdump(const GByteArray *data) static void vcpu_syscall(unsigned int vcpu_index, int64_t num, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5, - uint64_t a6, uint64_t a7, uint64_t a8) + uint64_t a6, uint64_t a7, uint64_t a8, + void *userdata) { if (statistics) { SyscallStats *entry; @@ -271,7 +272,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, memory_buffer =3D g_byte_array_new(); } =20 - qemu_plugin_register_vcpu_syscall_cb(id, vcpu_syscall); + qemu_plugin_register_vcpu_syscall_cb(id, vcpu_syscall, NULL); qemu_plugin_register_vcpu_syscall_ret_cb(id, vcpu_syscall_ret); qemu_plugin_register_vcpu_syscall_filter_cb(id, vcpu_syscall_filter); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520075; cv=none; d=zohomail.com; s=zohoarc; b=MiPiAoUw3VhrBEkju2up+3QDNxkFlO4ISiG/9ARFybmlulwMDMsmIUcHlcjv7/DyaIsmg3R8XTW5GubHGTN9PghnjqcKRnF64uWzgZXsF/O4PuewtMuV02ppZxbXUF4K2MPhfHKqV6ZDGmWn8LEjk9L8TLPtOvo3pndCNdRMn9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520075; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PVvrPaIoObYDYUC9DNIpLydqYY9Flw1wxl4B7t+Ck1w=; b=JITdYhadH6LJYEwIInPt+aBaV+KOkOorfSQuAe9QajmEMjjEZCB5t9Jc3KQEgiF9M22bibEE5BW+aY4O01qPErb+lxBKUfpsOd51CyyaHyy92GlYlm1KSFUdzl5BHhR7gWo+tAIbj7rFcHWlwhSwjoA9rkknJdA9Q2P7WeRdXkA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520075127385.88952356405196; Wed, 3 Jun 2026 13:54:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsaz-0001on-Mr; Wed, 03 Jun 2026 16:53:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZt-0008Ck-HM for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:43 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZm-0004ID-5E for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:37 -0400 Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653GtTO83552128 for ; Wed, 3 Jun 2026 20:52:26 GMT Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejj9mtp2g-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:26 +0000 (GMT) Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-30761ab3483so1305869eec.0 for ; Wed, 03 Jun 2026 13:52:26 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=PVvrPaIoObY DYUC9DNIpLydqYY9Flw1wxl4B7t+Ck1w=; b=Fj3YEXXq5PaMVjuqS0WhBVrOleG nuxENkF3/xgAR3Ur8F46gPGpyWAgwYur0/QbQjLuO0paz6EUlJytKPZmR1+YBt6b 86Ew2hN3mN9QTZuMTkW0TP2HUg1rzvLnd753OGz/DI53Q1VBKedp0xKtl71qd7CW dSk9Wxi+l26MGdjLPMBZbyFMNPegiaf1KkTAXDqvm2AnjhxlDDK93IISi1GAamof Kxrv9YUC85DA8Vt2rCsNnBAqNg0DW5MwnW8hAZJSfu6VRjsmHoaqnSXLR9d2627h //JNldkvjJFIiQzXGuA9kIddLBZamGJKlQBNdxmtDkq4jgpPcDjaIC3Eqwg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519946; x=1781124746; 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=PVvrPaIoObYDYUC9DNIpLydqYY9Flw1wxl4B7t+Ck1w=; b=BZ2EL7edidwxBxSAE5N9Gk+q7bfVIAE1xgx7+48vQyL4fmtqssc02BzdP2zBzOEf27 Pg6VkKlmUpaAm4GjqRXtLqhuIFOr9JQT0CRX7YL3Rq5ip5zHGxh2+q6pMwbenTH37LXE v3o3/qdvI89u661AHEIdE7KsF2k3poTlep4X9kr3eeBvcBSNPcU3MdPLlT8jqliAWSYD bkWAap5IDHqU6gptuzRafU84Bx5+goEg3k+o8LWy0xIY6V89sT2RGFi8ahD8xaSJXdFE +BLV2x3kBUiKpNDhIVJzBzK7y7+hDi7ydJDNJ85w9J7NmtNIpx9Frk9yARuvl5gt8CiR SDlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519946; x=1781124746; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=PVvrPaIoObYDYUC9DNIpLydqYY9Flw1wxl4B7t+Ck1w=; b=EEjBQ4W7zOt+UERA8Vr7+e4Gr3g6S3GNgQ/uImPEwQXyN7+JHygwMimEf5F2ojyFN1 wTCpvZjQ7QeuxGzHY1TrbQwQmIuApFRRfEE2vm1cFPUDEH9dINCbtjcue0geuocf4RyV bxEwDX/Z7l5e51MCFDXOIeRgsv+l/BEQgPw2pXoA2tHlZpxbiD2XXXNQo+C9WECeBO68 jeqwfHuVk6bt73DTaB+VfFO7+uNYzXTIY+zlELJxuhWVQ0VywMRcSSl6kzTmBmeuIfC3 F7wn27ei+MFdMkYryl1JEdC5BKyP6t8lGQq9fSQ0oDA4kFOPzcPV3nq402W53AKmR+sW 8eWg== X-Gm-Message-State: AOJu0Yxt6zNPGwCQzRDLQDf3Cc/ZvWo+69CFpM7QKZS80uwcjtir9kgr Xxg8DoQC9JpD1VEFm4OO5UXwrt4d3aX9KJzA1amJ6I+inKAAY63PY/QjIuyg+ociLrop6JkHXQq mb2x/a7tgtrH5aXplN3YwRv/vPZhgL6zpf2GCH+bSYP6mGsjRewQakkeLxvRhZfPWPXvR X-Gm-Gg: Acq92OHQtY0o06dYZDS98ga/8YcABu+O48h2xw+x66IQFdePHP8tazprnHHSAIwaPCQ xVJ95cO3uKGx6/ZnQXxFtqYZ0jDi4fR36KCxKWXHdOb59gRCUHbTcIFxgNZbq23SXNLhAx+YBZ5 PvMoE632vo9DOUfqraR1b0ylvFhHFKwqf3ZgNfIyMkv2l0ejF4dNxLsQ8iyamVKFdgCXm9Cfqg4 9vmnEdpclyvdaDg7Syb5roDSXLRVxmspRTRl7xC1rLccscYq8rEjYVnBOYSF69UYZObrjkKzs1U z9A2WJQUzBRRkoQppA4GGYFRSC1T4pgfTuyU/hU1bOBFh7tfN3Db1qaT79NIiLzaTcNnElSZe+q IoMDGxpiNVGkL8q2OKMPZPdGiE9DcpZ9yuZIdyvXrFfl4FhcQ7p6Dc37XQ+qBrFgZ6fp9bK5XYh Li+9yL83GAsPMVoECS X-Received: by 2002:a05:7300:5726:b0:2d9:fa9c:87a9 with SMTP id 5a478bee46e88-3074fa53068mr2902135eec.5.1780519945687; Wed, 03 Jun 2026 13:52:25 -0700 (PDT) X-Received: by 2002:a05:7300:5726:b0:2d9:fa9c:87a9 with SMTP id 5a478bee46e88-3074fa53068mr2902120eec.5.1780519945240; Wed, 03 Jun 2026 13:52:25 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 19/25] plugins: remove qemu_plugin_id from qemu_plugin_vcpu_syscall_filter_cb_t Date: Wed, 3 Jun 2026 13:51:46 -0700 Message-ID: <20260603205152.1440291-20-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: L90x6Axw7mb3Fn-4o--zvJgmZ1eCbpcs X-Authority-Analysis: v=2.4 cv=XK0AjwhE c=1 sm=1 tr=0 ts=6a20940a cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=ZpZNCfPiCzbVQKdpNmsA:9 a=bBxd6f-gb0O0v-kibOvt:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX6sNvuU/Ci2Nl o+pX9qaub05UddACNwtvVn1x0xuUN0kYXCJnwF87xwmwSUpZ9lGJslJY8BnrahnFEqxy+1Lznjv 5uy5lBRSVaUAB0PWP73UDCu4ScExRLvTeXGtDNiViVZmsmmmEwiScvFyzm+F1pmrXSveXobNDRE OcJRSY2zeB6OF7T+kY26506RAWOE9mUHs9XKuxdc1CSsQ2Dp7p0q2neU/wt6Nrs7j6gyLFK3egD ohsiqCxEQiQS4AnrCdV1SL3k8yCTHS+dEtxicSvezMgv+1NxXyeZOmyTXImjPE0t3txW7IP8Fe9 at15ep3zMpqMnksymRpy0mSr6gdRaK7J8PxA2odKgd9n95ZogAL93V6ON+7SXoC9LtfjS/D9rZR OiWK7+WzCbhvWtyWGeKXjsl7S1bUNT86HhxYDr0wo4+wmUyZYXEUuvIFX5z1ipJyXjz2WHLhF52 +MhRn01PW4ynEKCCuGg== X-Proofpoint-ORIG-GUID: L90x6Axw7mb3Fn-4o--zvJgmZ1eCbpcs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520077632154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- include/plugins/qemu-plugin.h | 4 +--- plugins/core.c | 2 +- tests/tcg/plugins/setpc.c | 2 +- tests/tcg/plugins/syscall.c | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 909f19b7128..c38ae7db1b3 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -852,7 +852,6 @@ typedef void /** * typedef qemu_plugin_vcpu_syscall_filter_cb_t - vCPU syscall filter call= back * function type - * @id: plugin id * @vcpu_index: the executing vCPU * @num: the syscall number * @a1: the 1st syscall argument @@ -869,8 +868,7 @@ typedef void * handled further), otherwise returns false. */ typedef bool -(*qemu_plugin_vcpu_syscall_filter_cb_t)(qemu_plugin_id_t id, - unsigned int vcpu_index, +(*qemu_plugin_vcpu_syscall_filter_cb_t)(unsigned int vcpu_index, int64_t num, uint64_t a1, uint64_t= a2, uint64_t a3, uint64_t a4, uint64_t= a5, uint64_t a6, uint64_t a7, uint64_t= a8, diff --git a/plugins/core.c b/plugins/core.c index 45136bf950a..987e49b89cd 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -589,7 +589,7 @@ qemu_plugin_vcpu_syscall_filter(CPUState *cpu, int64_t = num, uint64_t a1, QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { qemu_plugin_vcpu_syscall_filter_cb_t func =3D cb->f.vcpu_syscall_f= ilter; =20 - if (func(cb->ctx->id, cpu->cpu_index, num, a1, a2, a3, a4, + if (func(cpu->cpu_index, num, a1, a2, a3, a4, a5, a6, a7, a8, sysret)) { filtered =3D true; break; diff --git a/tests/tcg/plugins/setpc.c b/tests/tcg/plugins/setpc.c index 595571cdfd9..9bb5bf0f5f7 100644 --- a/tests/tcg/plugins/setpc.c +++ b/tests/tcg/plugins/setpc.c @@ -23,7 +23,7 @@ static uint64_t source_pc; static uint64_t target_pc; static uint64_t target_vaddr; =20 -static bool vcpu_syscall_filter(qemu_plugin_id_t id, unsigned int vcpu_ind= ex, +static bool vcpu_syscall_filter(unsigned int vcpu_index, int64_t num, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8, diff --git a/tests/tcg/plugins/syscall.c b/tests/tcg/plugins/syscall.c index 8a823acfca7..2afd71895e3 100644 --- a/tests/tcg/plugins/syscall.c +++ b/tests/tcg/plugins/syscall.c @@ -171,7 +171,7 @@ static void vcpu_syscall_ret(qemu_plugin_id_t id, unsig= ned int vcpu_idx, } } =20 -static bool vcpu_syscall_filter(qemu_plugin_id_t id, unsigned int vcpu_ind= ex, +static bool vcpu_syscall_filter(unsigned int vcpu_index, int64_t num, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8, --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520067; cv=none; d=zohomail.com; s=zohoarc; b=LTX0ZLt6LKmHUuhRbX4/58XXKjpGTFrbIKtZ9mH/2lVbl2Ozpx03G4NCxD6pTWzo6QE38+b8Mi+TJc0DPgOSvppu9s4WnY5oNZVqRkbssbUqrCTiht4hxEf7vNn1hJ+unH4Gp5eJ38Wa0neHoNVOCJ0OuY811otBO1+lp2fYK4k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520067; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dtYli/cv0EtLiTk960i6eZHYKN3lSoJNgps2z3Cozcg=; b=j4DTPd5fKMplcAkHiXNG2Rm+ScYijzpOYoVvw9tXoHWmoePzN/3vPuuxIOQJoaNfQxCYyvf8SBW45oskrW6VgHnRlMadkDSkYRWQ0eO4MDria/Zs+KQO3RCAU37mvv4b5fyTt8aSqFEEuMJG33SfWaJylk0jNUkh29XNzI8jlaA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520067221750.3783587827344; Wed, 3 Jun 2026 13:54:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsae-0000Wr-S7; Wed, 03 Jun 2026 16:53:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsa0-0008HB-Pt for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:50 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZy-0004IR-Sy for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:48 -0400 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653KF0Aq1740883 for ; Wed, 3 Jun 2026 20:52:28 GMT Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejdq7uyd5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:27 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-304e4636205so17097360eec.1 for ; Wed, 03 Jun 2026 13:52:27 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=dtYli/cv0Et LiTk960i6eZHYKN3lSoJNgps2z3Cozcg=; b=ItzDSgsl2EI44MGONlBZODywYpQ zZBOAXt2XpirbAWAWOUBNu2Jfn5l9Gm688rZPOqtGX/yV7tbTw5rJ+tWGNAzMb36 CkbnB+3a4DWpHgM1ZRPc0HUHK4Gzuj1ysVWBQhK75oosb4Pn2UHKRil6aBptjnVe a/NBx6suLKEXp45e9ODVLI+KMYRb9JocfISVxxCaok4sbdFviZscZFwJsvPg1Lj0 qDfojkBrwNQ2nytC1Aslj5OeT710fFw3uCUadIE8H7QcXzZ3Tc3tS4REIM+0eGnY yTAvDtB4No48tyfV+MfDaca8x5wcJklHsKs6Z1D5XiZwCOqucxbqM85QAOA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519947; x=1781124747; 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=dtYli/cv0EtLiTk960i6eZHYKN3lSoJNgps2z3Cozcg=; b=cChZORwPxI8YB1BhzSoUjNns2bTixhArD0KRtiGLv5oDBeq/XcHZ5T1ke7ny4jQiF4 AzeOp+84oB6Tk7jz0VO+4wwGVjlZ7V9m+nhyw4zM3iJ4ILkfnV3xejaghZoMpSqVn6ZU ayYnbBzAZ79OOud45qzJ4bFfZK81WaIHonJD8vZnSrSR21Z7uWCRXMOSw7FP+hQbN8nL /WTpXq4nSWSqQtklfKaNxfJ8EtPvAVxjys8elWOK5WtRF9VGg89bBAIMcZJlu1Tq9aQa b2BpIN5nq3bqO4NeXR8O3fL3H/zLwP6hoHXOr8m//B319izH86zorEdM9hDUeTFrn8sM CiKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519947; x=1781124747; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=dtYli/cv0EtLiTk960i6eZHYKN3lSoJNgps2z3Cozcg=; b=quOB3vXrcECmxezl595DWBzarawOtdwPDLr4uQGBKI3FVlulhYj8g6hodZ1vjnmGHG 4U/u01rLWZDh6KFR+GzLbmrso8grgv3VDwb2F2hueL7jo+4amLEGJ9sEuiF3y7UB20ZO dTSPKWEBO7AEF2zzmkOrH9C7oMUtQ+yaI+VNcOy93He2dD7qiyYaVFpm7+HAQ7ohS7cf rQAzZ5ClPilUFaTNnELsU0jC1Q2uKddybbBcsmKiNbtm2Jc/SeYtM/j7wNuuBp1lyiNy ul9u2XDInQhZ3PuWKkU9kpT4vW8V4dOmdOuYiiXghIcjOSag4pvEEzDUrflCOkM3BjF3 O+sw== X-Gm-Message-State: AOJu0YwyqH/Qz3Eiq/NKlv/3RGnZQ/8x/kXEWSs+vV+Zlhp1pefkA1xI mpb6H2RNtM6zmRUMNJYSctQDGSj18bYkHO9XU80zQb49w92mIGWlkVDRj38dMqnw8AubhrEIAmZ UpyDE1H/q1KBqRvhnGzIPtK84tm4mUMvghCmhwBFlrGf1m46xrkmy51bv6dNT9XswbNCF X-Gm-Gg: Acq92OGOGcTvow1uyW0YyQxalityrCA+cRwFYrfc/eKJjJlYVtIjTfwG8es0bnsXnXf cIXs/2e6QmOWoscVd1rchFhznh4GX/09h0o2tK7uZ2fo+Gu75w0/J0TRupggz19YFvsvcug23qb CMKO19GJfclPFbdMTBsty8NlDmoIX7j05JRnWq98S/tKDb7pJAjz5sYoh++3/oZ7gmxFrWkKaS3 dy7CXpFbzXSArpET0V0S91WBJhru7wy+qYadq6KZpOBZ6QDmgzObtMUT60reQ/PKu8CEfwlaXtP +x/TADG761SNIxAViH1Q6Whvbjnydpz+0r58AQjJ5VaMtXOIjitEajTCfRL2svxJzxNGzBQ3fUK z46uWrlSiebMfUZ5u1dS1Ron3YcY/VLtS1xx3eaAcyCpSr5F/WcMk8/E32NFeC5C7snwsH1vo0w 1NGjkmJXo7DAfgMSzo X-Received: by 2002:a05:7301:e2b:b0:2ed:e12:3773 with SMTP id 5a478bee46e88-3074fcab311mr3011983eec.35.1780519947209; Wed, 03 Jun 2026 13:52:27 -0700 (PDT) X-Received: by 2002:a05:7301:e2b:b0:2ed:e12:3773 with SMTP id 5a478bee46e88-3074fcab311mr3011958eec.35.1780519946458; Wed, 03 Jun 2026 13:52:26 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 20/25] plugins: add userdata to qemu_plugin_register_vcpu_syscall_filter_cb Date: Wed, 3 Jun 2026 13:51:47 -0700 Message-ID: <20260603205152.1440291-21-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX6bEYRQb0dgR5 Z/ugBJh97mmKPfiQxt229r0zZ2Oqs909Mj2O6b4GpvQi3qtgLytM62Oo05Gub283/Ky7ReHwkTl 20RY28poW3Cv0wQDRzWNPFQtLw2rBwvm9gQR4B6GVxrbMVLreO+Qw1DQSS73vCwbPx5KR+e2Hdi BET/mVlW+joyRnRoKLCu1edjP50noJRZbGpB6/jcMoMvThLYTC9OYvvmt2R8Ow6OODOL2CQpW00 09qrLC7YtvfaA0wgwOiFr+UtURmIYAcc1Am69WDgARXXzfqprp2XHapbX7kTjxLKJNdPoARHMq2 zzX5/a9oezyTtlY8IlQ4e00hOSP+0arPRNJsXe0x9LTMdI2z9nUhsggitM7tERwaq6ifEW2Q29p TeHb/lmdmGeTIThLDI9KpqOfOmmd1lCr/MldaTitcN4cw8ZE/SH+xYTZP3MYXz4JrJFipQ0KKxD 4HcPqN4rVKxfck3SzgQ== X-Proofpoint-ORIG-GUID: zCiZ_qFLdOCEEflsTlcOtGn52kpgZfF1 X-Proofpoint-GUID: zCiZ_qFLdOCEEflsTlcOtGn52kpgZfF1 X-Authority-Analysis: v=2.4 cv=ccniaHDM c=1 sm=1 tr=0 ts=6a20940b cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=Rmn1aRlouh7kj9PRvo8A:9 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520069464154101 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- include/plugins/qemu-plugin.h | 8 ++++++-- plugins/api.c | 5 +++-- plugins/core.c | 2 +- tests/tcg/plugins/setpc.c | 4 ++-- tests/tcg/plugins/syscall.c | 4 ++-- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index c38ae7db1b3..33d6f8e0b7d 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -863,6 +863,7 @@ typedef void * @a7: the 7th syscall argument * @a8: the 8th syscall argument * @sysret: reference of the syscall return value, must set this if filter= ed + * @userdata: user data for callback * * Returns true if you want to filter this syscall (i.e. stop it being * handled further), otherwise returns false. @@ -872,7 +873,8 @@ typedef bool int64_t num, uint64_t a1, uint64_t= a2, uint64_t a3, uint64_t a4, uint64_t= a5, uint64_t a6, uint64_t a7, uint64_t= a8, - uint64_t *sysret); + uint64_t *sysret, + void *userdata); =20 /** * typedef qemu_plugin_vcpu_syscall_ret_cb_t - vCPU syscall return callback @@ -906,6 +908,7 @@ void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_i= d_t id, * callback * @id: plugin id * @cb: callback of type qemu_plugin_vcpu_syscall_filter_cb_t + * @userdata: user data for callback * * This registers a callback for every syscall executed by the guest. The = @cb * function is executed before a syscall is handled by the host. If the @@ -916,7 +919,8 @@ void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_i= d_t id, QEMU_PLUGIN_API void qemu_plugin_register_vcpu_syscall_filter_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_syscall_filte= r_cb_t cb); + qemu_plugin_vcpu_syscall_filte= r_cb_t cb, + void *userdata); =20 /** * qemu_plugin_register_vcpu_syscall_ret_cb() - register a syscall entry diff --git a/plugins/api.c b/plugins/api.c index a72cec541dc..f2176be5304 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -217,9 +217,10 @@ qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_i= d_t id, =20 void qemu_plugin_register_vcpu_syscall_filter_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_syscall_filte= r_cb_t cb) + qemu_plugin_vcpu_syscall_filte= r_cb_t cb, + void *userdata) { - plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_SYSCALL_FILTER, cb); + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_VCPU_SYSCALL_FILTER, cb, u= serdata); } =20 /* diff --git a/plugins/core.c b/plugins/core.c index 987e49b89cd..fe292a098da 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -590,7 +590,7 @@ qemu_plugin_vcpu_syscall_filter(CPUState *cpu, int64_t = num, uint64_t a1, qemu_plugin_vcpu_syscall_filter_cb_t func =3D cb->f.vcpu_syscall_f= ilter; =20 if (func(cpu->cpu_index, num, a1, a2, a3, a4, - a5, a6, a7, a8, sysret)) { + a5, a6, a7, a8, sysret, cb->udata)) { filtered =3D true; break; } diff --git a/tests/tcg/plugins/setpc.c b/tests/tcg/plugins/setpc.c index 9bb5bf0f5f7..7c78f182f01 100644 --- a/tests/tcg/plugins/setpc.c +++ b/tests/tcg/plugins/setpc.c @@ -27,7 +27,7 @@ static bool vcpu_syscall_filter(unsigned int vcpu_index, int64_t num, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8, - uint64_t *sysret) + uint64_t *sysret, void *userdata) { if (num =3D=3D MAGIC_SYSCALL) { if (a1 =3D=3D SETPC) { @@ -99,7 +99,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id= _t id, int argc, char **argv) { =20 - qemu_plugin_register_vcpu_syscall_filter_cb(id, vcpu_syscall_filter); + qemu_plugin_register_vcpu_syscall_filter_cb(id, vcpu_syscall_filter, N= ULL); qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); return 0; } diff --git a/tests/tcg/plugins/syscall.c b/tests/tcg/plugins/syscall.c index 2afd71895e3..410fe617804 100644 --- a/tests/tcg/plugins/syscall.c +++ b/tests/tcg/plugins/syscall.c @@ -175,7 +175,7 @@ static bool vcpu_syscall_filter(unsigned int vcpu_index, int64_t num, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8, - uint64_t *sysret) + uint64_t *sysret, void *userdata) { /* Special syscall to test the filter functionality. */ if (num =3D=3D 4096 && a1 =3D=3D 0x66CCFF) { @@ -274,7 +274,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, =20 qemu_plugin_register_vcpu_syscall_cb(id, vcpu_syscall, NULL); qemu_plugin_register_vcpu_syscall_ret_cb(id, vcpu_syscall_ret); - qemu_plugin_register_vcpu_syscall_filter_cb(id, vcpu_syscall_filter); + qemu_plugin_register_vcpu_syscall_filter_cb(id, vcpu_syscall_filter, N= ULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; } --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520035; cv=none; d=zohomail.com; s=zohoarc; b=URhd/9QoaC3+4GxTWXzjhi/yug5oUq8/NHGYuDDQYYel2GVHrtcTVJgPUq8GShJHr27w+3sPGXZdLIUcBKh5uTd9U4flgSc1RI2JVbTHxRiXbWqC0CDTyk5Gr6mUvv2ovudTr4g/9pavmDgZxcrzwx3A60iF3HpdmoT91reuVOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520035; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HcsLIn0GwPsPIHV8RI5dCIz6YCsvDXVP5MbZpOwf0gU=; b=DR9y3slCKTg/6Jy9hIEc3ctGthnQSyZRpyx+XNHRSfLmIhpGzTptQmBk79o+mg/uDi7YpErKSm9hS2aFVov+NnEUZlD1pJaIJ8n8Pl5svV2GH4FMVgkq1Yt8UoYx0J0GOitdGlUW1mLlFXB06Ubv0sCuzkwZwysj/Jts1xYxdUU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520034999212.82255681429638; Wed, 3 Jun 2026 13:53:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsaU-0000EC-5B; Wed, 03 Jun 2026 16:53:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZp-00089M-21 for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:39 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZk-0004Il-4t for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:35 -0400 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653Gj9d82260700 for ; Wed, 3 Jun 2026 20:52:29 GMT Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejr2mh0vc-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:28 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-304f23c55b2so5686227eec.0 for ; Wed, 03 Jun 2026 13:52:28 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=HcsLIn0GwPs PIHV8RI5dCIz6YCsvDXVP5MbZpOwf0gU=; b=CJn9d1T/0C4aVnI9EkfkHa7EbrP eKIOaVLjbR6dt5xZxnyYjnUz7n6mE7SqHmQI4OxR5ZcPQKe22iNFCC1uAOALTajY FFzxY9KFL0CEj2/rEycNZD48WDu6Rf07MeE5CejqdBRJ12Lo6rFU3B4YOzjpVBW/ dcddgUKInJgvdcw7sofIyOAxWnB5wE4In0NWNL4xqRgqsBAEVeouYxTqDi2L7vas XDi2CYCx50027AD1ZXVVzPVRFkWETumfzbV6VJzwgqkiUPbLLSPBS0B4jhS0Ujky csBSRQ9TLe98llyB0jfUW6IvcQEQ+nrty9ITGWwQQPk6UrwfhH8ZMEhOROw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519948; x=1781124748; 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=HcsLIn0GwPsPIHV8RI5dCIz6YCsvDXVP5MbZpOwf0gU=; b=RZ5MI6VHTtE9nGCEKj5jVHvBqCjMvikw4TiO7MhftLEPdDVVHnSVdz5KuGWc0HA/5p jch8comNDvo6gz/frAf8Hd3ETZhrePIjVs/Z6VxagxiEq88OXtWuWIUPDgi7tg8wq/bJ vL6VQbQTjQta4C+7U0gPYGD65Ms50m9DEb57GD3VE8MbUWf54X6p3Moh4LFjbYbs6Q5G Jb8+12ie72XSEcBCj3rpkV+RyXf+h2BjdTSfXjz9YMwYNilMR0dA/8s7tkF5O7+RfCk3 3YKE9JicPsRez31jLcV28JK56Jui5VKd/jVUaTgPBAdf7tCEECpBxDpXPrgR/iFRw7RA Mk2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519948; x=1781124748; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=HcsLIn0GwPsPIHV8RI5dCIz6YCsvDXVP5MbZpOwf0gU=; b=SHXHWBw0i7mJV8HmgUzWI2N/4f7FRzIVAom9f8a9AlPwxpn5o1Ti9Tn5Pa9PgOl3cc ysaY6h+E8KukFG/6GYFlWZGkL2dk/qqAu0PTN/pABDGHLW4OFVf5+IgY6P301i/ZlhSu 0IRb5VuatJv4ledlvvhQ56GjlfzhQ6AvmuLhXJmNjdcRsW15e4MN1Ip005FYPQwe/kw0 kTXY/gkL5lwrrbTtjhFjzqcMsj41bQVR6sxHfjmBk7pmcyGkBmr5vlrkiH0sjLYcGT1k nv8jcobkOHg0pDYudCJGcmi+LcWRAB68fZsi5+9DnjuDX4J4QSXdRqqkHvT6XExmtBsb YEuw== X-Gm-Message-State: AOJu0Yz58Yro0Ts6rhug7+WpwDLXKlG7i9H7dji/lHWdKUc0F1YVH4Ds 6M9xNyli2kFBzwdzgyWkrB5hOzQ6yEQlodM8+5XDlWSr5v2B37cDk4HH3b5aztlJPD6QbzqJtsl wmFQgcvRJW9RHD5KojNgFH2yhmWCYlKwkP+Xpa46TWNPUGbjmIUvPCOXD3txsORWSqWCY X-Gm-Gg: Acq92OGUdMIFrykZtudytvz7AeBmAbQwXLTxHmumGqKMfQcpEpX2o10WCLnpZYHc3nO EmpJPz37EEbE7gIF6YiujERd7DVSyf2dfWKs/n+mtpdn/sFioxFFbxwzk5pKNyxke9sMN8wah3e lm+U54yEMkiDcGTIzrXI8/Nj2ZiqE/bIHEpVW61MbZm1zvObiGZrnSicNeXNgTUKN2lQx301NYK 9sUYn1SMCHPACyauImwv6X/azawbNvwDr1daae6mAmw0KFoTnQlepcq9ka2Uyrd+Pl01hA2PnGa RKUsKbQORsO88x6UyXCIU+bIZH9OwD9JTnEqadixnCbNSdtGS32TsGKqih0DVcOobe6bb98K9p4 LZ+F8ogTezVe3C4d9q7bNl9wiAxtzu6fP3hDwO6TZGICCPX0clC7QJoY4GBisqrX53yTU0oCD/M SGW4y/KCeoW07no6+J X-Received: by 2002:a05:7300:7fa3:b0:2d2:96e8:1bf5 with SMTP id 5a478bee46e88-3074fa3b84fmr2644747eec.3.1780519948244; Wed, 03 Jun 2026 13:52:28 -0700 (PDT) X-Received: by 2002:a05:7300:7fa3:b0:2d2:96e8:1bf5 with SMTP id 5a478bee46e88-3074fa3b84fmr2644729eec.3.1780519947786; Wed, 03 Jun 2026 13:52:27 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 21/25] plugins: remove qemu_plugin_id from qemu_plugin_vcpu_syscall_ret_cb_t Date: Wed, 3 Jun 2026 13:51:48 -0700 Message-ID: <20260603205152.1440291-22-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: 7stvX0Yd-nHOXhKEPBlBt8Jj4QLwKhzy X-Proofpoint-ORIG-GUID: 7stvX0Yd-nHOXhKEPBlBt8Jj4QLwKhzy X-Authority-Analysis: v=2.4 cv=A91c+aWG c=1 sm=1 tr=0 ts=6a20940d cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=r2ysFZ-m1ga4sL3LQvwA:9 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX/Z++iLTC3zCI EF/dURkJOc0gTFohukruNiZJv6i97AmqbfJtY3YEK92RViUHVmZL7CSv8G6GzbpSMeV3CToPkxb U6+agXUy4UkKbdbUOtr59KtvhEHWpiWiBhRS0OuOQnur4APuRcFpN3dp5lXKB0EomNUFVOUpm2v Iiqosyq9oLJxkgMmP6R3U+0TiTa8ibMp/iMOnkpTSf4vM2gh7QcsRYG3EaTmbx8uWghuj6q/jlM zCG6C84EnqOkmnC8b0eS/AHlYCCF9IyrpAoZd/LS3xA8Z/knA4X8ShC0/L0GmreyZ98o1xoMaxN Npso61JiSpbS8et4DvI/W+BWVHhAvZE71P/vyFMmAdW5yT+/sIjT2pmnL4pdSrs8Kb7yEvZvUi5 IzOUhZ7E/3GcF0X0JF7ipli5y3O3zrpINYfG3xW0W4eeOnx5bUOCfBVet9NOMesKB86LNLbHpm1 xauO5BVW8mJhDdtbiqw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 spamscore=0 suspectscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520036829154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- include/plugins/qemu-plugin.h | 4 +--- plugins/core.c | 2 +- tests/tcg/plugins/syscall.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 33d6f8e0b7d..4f0c73c7b33 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -879,14 +879,12 @@ typedef bool /** * typedef qemu_plugin_vcpu_syscall_ret_cb_t - vCPU syscall return callback * function type - * @id: plugin id * @vcpu_index: the executing vCPU * @num: the syscall number * @ret: the syscall return value */ typedef void -(*qemu_plugin_vcpu_syscall_ret_cb_t)(qemu_plugin_id_t id, - unsigned int vcpu_index, +(*qemu_plugin_vcpu_syscall_ret_cb_t)(unsigned int vcpu_index, int64_t num, int64_t ret); =20 /** diff --git a/plugins/core.c b/plugins/core.c index fe292a098da..887267f8174 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -557,7 +557,7 @@ void qemu_plugin_vcpu_syscall_ret(CPUState *cpu, int64_= t num, int64_t ret) qemu_plugin_vcpu_syscall_ret_cb_t func =3D cb->f.vcpu_syscall_ret; =20 qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_RW_REGS_PC); - func(cb->ctx->id, cpu->cpu_index, num, ret); + func(cpu->cpu_index, num, ret); qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); } } diff --git a/tests/tcg/plugins/syscall.c b/tests/tcg/plugins/syscall.c index 410fe617804..1bc737824ce 100644 --- a/tests/tcg/plugins/syscall.c +++ b/tests/tcg/plugins/syscall.c @@ -151,7 +151,7 @@ static void vcpu_syscall(unsigned int vcpu_index, } } =20 -static void vcpu_syscall_ret(qemu_plugin_id_t id, unsigned int vcpu_idx, +static void vcpu_syscall_ret(unsigned int vcpu_idx, int64_t num, int64_t ret) { if (statistics) { --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520018; cv=none; d=zohomail.com; s=zohoarc; b=F03IagJTXZknEcks3sbb6KXH7gpeCJYd/YDr1yLnNZjX3fD3NHVhsmNkz3XUPdZM1wHR7Ozyvz0vVoGBEvj3MMPJkcW2bzOTLN1Wpp5hbFs66oJGuYzgkHt5ATT6iZ2dSM+jMexeIiEJY6XTFrgn+5Ou9+jqGFePHYke+7RXOTM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520018; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+qHsgnZ0B7fDiRoqQQWP3yXm2jFq0UmJZ5nbSad2ncc=; b=KTXVu24kB9yfO4eG05C19jso+W1WaH2GByjdLvdxs2c6EqCGguz4wDlzZ6XATW2EuMS4M2++fOK6Yti1omCUKizBZz6Py1vzSJoIQhzW++/IGBqk+GevDLGX4yR5RKT/fC8gRvypcVc6uyEMZTTgoYey9QA+8liOp5cJ9yAAHYE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520018454138.05951283709942; Wed, 3 Jun 2026 13:53:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsaW-0000EB-1S; Wed, 03 Jun 2026 16:53:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZt-0008Co-J3 for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:43 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZo-0004JJ-Uw for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:39 -0400 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653Gj9d92260700 for ; Wed, 3 Jun 2026 20:52:30 GMT Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejr2mh0ve-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:30 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-304ed777a96so756393eec.1 for ; Wed, 03 Jun 2026 13:52:30 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=+qHsgnZ0B7f DiRoqQQWP3yXm2jFq0UmJZ5nbSad2ncc=; b=BNKRxdBCqq8Y9WKAkBM9399KKJO lzRKgaZdE6yBGnEO7lWPw9jKnbEwpifJhjchoXBUgVop+uPPTd4GU5yJDvaoF92L 4d0iSec4tkbsQ3YgvgPMsfUeVlXE54mG1Q4czfOtCdlY/CH3nlrBjjpkTlWagfDk n5ZTj3Uve63YFd+hWivOcAcjoqmTJfot0iM9i6CZkyWK2xFAIr/sMLeGkCinBc/J 9mo673vs/uYDGp2k7xlFInCLjydtkP8WFXT8nSTN8yOYYUcoAfwDZSav2DUvrYVV 5BbugtFcArWrA2QbB+as5pilCaczxJueexdV952oOsirXG0EHr3D+T5sGeA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519950; x=1781124750; 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=+qHsgnZ0B7fDiRoqQQWP3yXm2jFq0UmJZ5nbSad2ncc=; b=kB6ktttQVxASQL0P+MsWWvraHGtWlONiGI5BvkcRrcG3dxalbVoQniFAXflISZ/r6p U1y6l4B61Dma4Ym8a/hn2OyrZUzXZZklEhHev+/4dOnapI5j/s1CXtgcydK8xWmw93tn Gm6oHcIn3PzUGqYvpGPrz0iYOj61CDP4K/dSE3yKsvXGkYM7P60nQaklN3lCZpNZ+CWV sGj3f+9ldFF6HZ99yExghaCR9W38tGPAAeFX5s6+vyB77M9bbBOwn+x46CdvcXX2VkQv g61E/u1qTp3h5zuIJRPv+DBD7VTvIoqnNNogx/aHywbRnor7lYsLSKRloqpW+Poi0Qbm 5ukQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519950; x=1781124750; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+qHsgnZ0B7fDiRoqQQWP3yXm2jFq0UmJZ5nbSad2ncc=; b=pUKxm2j+/K7KIy7wArWSfINRA6VeBuNaYkcbrLrK41dll28nWTao1wqzzFg0xFUI1Q D9gE+7izmxIpk1HdWoZwwpp/eaxMPxxHLVvXP5/3STwPlvh1BchFC0FQ8NCc1HcccPMH E5J3EcJeAtOhdO80ThOHMYv1Y9IU10J/2KLOeVJB8vGL4tAtNOO8VxdQhwYXat3lHu+M 6c7WiWFGq/zsuwrlerZIEARyFljtxQc12xoDpyAWvhx2mwbOwVEEgseUWfwjctI7jKx/ hbLLVc6ZgTL1i2JxM5QAZVl8uHPugw7koWWhIza7L7fxXXUwwA+S3XTEqjlNcQq97fZq dr1Q== X-Gm-Message-State: AOJu0YwCTFC+FuKpF+YpuZcLt0u61Wq/9Vw3jxuqdhiuADzel2sX8aSt 1TdmvzTfJSWYYUeC+P8sSrGUASB56p/BlCBkLYAZR75FX12Gpj+7Ts/vIE9c2bwG7/CUcu1pOtx 2cc4IRinj3H5+nFbk7rMLj8FjkUqZtms0uPaBWPgULzMYybcKZ/dVKEv78rnjqDWkEHNU X-Gm-Gg: Acq92OEfKfqV5YvKVFPk0ZJxrFQJmI3SDQ6MzRvoE2aaAviSzkhyy3JFimOUF3qSO/i Lz+Qc7zgdcSG4OopZe9UTdrvEfCy7G6SE7IlKSZS49Pif4qrLf6SKQTj7nFDYfaxd9WMJysugoR tIlNs38J7Uo+jScKY3z17+VfECOX/d3TP1xtLNB1CTvb+yMKr5sDsumpI4ybxMiHstiEDByhn0N F0EnpUumEcb2An1B41y2ElH6F3ET/Q5GEiu8CeRiKzu5M6a9/ep16+aUPfO1nJXS32ydx+WrzdO iD4lvwHGcQTOMy1V1OO20fFajEZNhr701djdx3+iFKaT+PLTKd0+5LSctSRheaAgF6CvJIzPlGK BVjalKbw/78lD3l7uheBY1m1fMJ2hAOxDD02LF6rki1VmH6MF3j/aDobN7Gca8DNw6z0AMNQ1NY 95a+UV/ZPzxFW96dg9 X-Received: by 2002:a05:7301:db18:b0:304:81b6:fd51 with SMTP id 5a478bee46e88-30761d44422mr321025eec.6.1780519949820; Wed, 03 Jun 2026 13:52:29 -0700 (PDT) X-Received: by 2002:a05:7301:db18:b0:304:81b6:fd51 with SMTP id 5a478bee46e88-30761d44422mr321012eec.6.1780519949192; Wed, 03 Jun 2026 13:52:29 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 22/25] plugins: add userdata to qemu_plugin_register_vcpu_syscall_ret_cb Date: Wed, 3 Jun 2026 13:51:49 -0700 Message-ID: <20260603205152.1440291-23-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: BYYKMW8H5binOXqhnhtq0rNlOAT_XpNW X-Proofpoint-ORIG-GUID: BYYKMW8H5binOXqhnhtq0rNlOAT_XpNW X-Authority-Analysis: v=2.4 cv=A91c+aWG c=1 sm=1 tr=0 ts=6a20940e cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=HFGiEJlbZgj7dAjcEtYA:9 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX58+2HEKNy0lG 0lADcAukFPeQRy5tXl+wo7HyeXJkFD/8cv1jUv5aEn2w1n3ry2RXPpJRGWgebr0pIXklUtoUNxe oNJu64Ujv0IqRjPBpYa5x8pPetFKFLFZonUM3Kn41/o/0fJrWGCQU4CdargoYsaBpXJmhU6sJg1 5uoZPLPpRelOQ4tql9kVdl6EOmCEkKu/ZPiXL2Ekst5P/WKaMND5NdTeTCyUxImUwkEnrtfL9t1 y3iDLpgEpk21ttF/knFwBBWZ3rRlgtltC62XlSHN1OCPNga7R6AlheAIlkEDeTIhL6nizM5oR+D rM/f2zTjiWTdClQ0K4TtK/uIbWfdmzCJ5v9Qd680JnUoCujRN4EFGtFWyYxW+Mnmq6J0yX3iCtX o0qSKWrvNpCJBovfgtu1N3Lz+JualIrv1chMWdYsRdAYWzLV334/5RjURL1W+7WfEwgUpFlisJD Ymw3uHnq16iAVAJAYRQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 spamscore=0 suspectscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520018692158501 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pierrick Bouvier --- include/plugins/qemu-plugin.h | 8 ++++++-- plugins/api.c | 5 +++-- plugins/core.c | 2 +- tests/tcg/plugins/syscall.c | 5 +++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/plugins/qemu-plugin.h b/include/plugins/qemu-plugin.h index 4f0c73c7b33..50a39e51d46 100644 --- a/include/plugins/qemu-plugin.h +++ b/include/plugins/qemu-plugin.h @@ -882,10 +882,12 @@ typedef bool * @vcpu_index: the executing vCPU * @num: the syscall number * @ret: the syscall return value + * @userdata: user data for callback */ typedef void (*qemu_plugin_vcpu_syscall_ret_cb_t)(unsigned int vcpu_index, - int64_t num, int64_t ret); + int64_t num, int64_t ret, + void *userdata); =20 /** * qemu_plugin_register_vcpu_syscall_cb() - register a syscall entry callb= ack @@ -925,6 +927,7 @@ qemu_plugin_register_vcpu_syscall_filter_cb(qemu_plugin= _id_t id, * callback * @id: plugin id * @cb: callback of type qemu_plugin_vcpu_syscall_ret_cb_t + * @userdata: user data for callback * * This registers a callback for every syscall executed by the guest. The = @cb * function is executed upon return from the host syscall before execution= is @@ -933,7 +936,8 @@ qemu_plugin_register_vcpu_syscall_filter_cb(qemu_plugin= _id_t id, QEMU_PLUGIN_API void qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_syscall_ret_cb_t= cb); + qemu_plugin_vcpu_syscall_ret_cb_t= cb, + void *userdata); =20 /** * qemu_plugin_insn_disas() - return disassembly string for instruction diff --git a/plugins/api.c b/plugins/api.c index f2176be5304..0038da6d706 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -210,9 +210,10 @@ void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_= id_t id, =20 void qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id_t id, - qemu_plugin_vcpu_syscall_ret_cb_t= cb) + qemu_plugin_vcpu_syscall_ret_cb_t= cb, + void *userdata) { - plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_SYSCALL_RET, cb); + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_VCPU_SYSCALL_RET, cb, user= data); } =20 void diff --git a/plugins/core.c b/plugins/core.c index 887267f8174..7a58fb537c9 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -557,7 +557,7 @@ void qemu_plugin_vcpu_syscall_ret(CPUState *cpu, int64_= t num, int64_t ret) qemu_plugin_vcpu_syscall_ret_cb_t func =3D cb->f.vcpu_syscall_ret; =20 qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_RW_REGS_PC); - func(cpu->cpu_index, num, ret); + func(cpu->cpu_index, num, ret, cb->udata); qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); } } diff --git a/tests/tcg/plugins/syscall.c b/tests/tcg/plugins/syscall.c index 1bc737824ce..a28d1087840 100644 --- a/tests/tcg/plugins/syscall.c +++ b/tests/tcg/plugins/syscall.c @@ -152,7 +152,8 @@ static void vcpu_syscall(unsigned int vcpu_index, } =20 static void vcpu_syscall_ret(unsigned int vcpu_idx, - int64_t num, int64_t ret) + int64_t num, int64_t ret, + void *userdata) { if (statistics) { SyscallStats *entry; @@ -273,7 +274,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, } =20 qemu_plugin_register_vcpu_syscall_cb(id, vcpu_syscall, NULL); - qemu_plugin_register_vcpu_syscall_ret_cb(id, vcpu_syscall_ret); + qemu_plugin_register_vcpu_syscall_ret_cb(id, vcpu_syscall_ret, NULL); qemu_plugin_register_vcpu_syscall_filter_cb(id, vcpu_syscall_filter, N= ULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520105; cv=none; d=zohomail.com; s=zohoarc; b=geUKompJkoC6epgA57iZNnEiShUzL8fFoiG1smUu7R1vNYW9CnCMCQfHQeJObl1fLeTurA1F338MZz+Zu9Z+58DB/y3nXuiAIKj0323e1sBukjpd/7qnjaA11J+nantDx6toQNuCSeygljAUymqKegkKZwtg2oh8nx8zujf+lSI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520105; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JQR90cp+QFPUvm6Q8olzCzDAjjCzsQS5gRAB0T0h0cc=; b=F42jNEJSvZb3kE01MkGaf2Qocgh283yd7rRgQh5mbLQ/bGLX5CXCI82zyAKyi4ggSC+ofOSiJXAa1R2D2dk7mYM8+H8758XEwOjewA75MrBDXr3LxPb58KxJOtl9uBZdRyVOYoherVEYOERVGrUvrFTZUeKpFdoSZ+z1o1qQwz8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178052010577925.524377903969707; Wed, 3 Jun 2026 13:55:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsar-0000xF-7g; Wed, 03 Jun 2026 16:53:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsa0-0008Hg-UC for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:50 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZy-0004Je-Sz for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:48 -0400 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653EbhHm1476759 for ; Wed, 3 Jun 2026 20:52:31 GMT Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejp6nsmyg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:31 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-304ed777a96so756401eec.1 for ; Wed, 03 Jun 2026 13:52:31 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=JQR90cp+QFP Uvm6Q8olzCzDAjjCzsQS5gRAB0T0h0cc=; b=JGpzHJyVDwLKguJ2jIY+2sZAgDo Zm4lunUmBz8YZS8dKNJxJAPqRTe/Aa0K+E32iBh0fWRdKGjttmBMASkh7iNv8lSJ p0nxEaXo3VOnnhRfQqQ7JylhjE72eLzcwFfaZa67wbeaGr4qjg8vGmyGzID/5C6O tMS9Wj8Pzn4eRKxOpM5tfuq23pJAeluk8Ea+5DQ5d6FzNDUhsgnGVd+HlrQNScZz 14G0u31lgMcOD1e71y47t1ZFkmw/X1OD4I1RWd+QW6sztURRF1FMmkyr80XkXOIA bokWjzgm7YKlghrkoxCCWbgmHeQANM4cHp9ZPGhZI90gQCvfrIYwa6EXeQA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519951; x=1781124751; 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=JQR90cp+QFPUvm6Q8olzCzDAjjCzsQS5gRAB0T0h0cc=; b=cX2qYP9Cwf+VeJ+SD9MSjSWXHlTmBTYBTD4HIdzJExm6ZG4BdUBEn353ROw5uEyUhq eOCdNyULPSWKaseEUfJy93Zly3ZNdGKr8qlb41Tc1S7X9j1Z27AxwCXoNgK9klHBd4N/ d3q+VwMkG/W+87Rht/tmmjp0r3vMTXDiNz1xQiPDCGGMshxZHEZYqE5mhJpfFt0uM/jF 2t2NjU/QH9Zz9Ik8LYA25ChpFfb4J5hMI7Xo7kHxvUDio+GOOeIJZznmyAm3ncbEQ3LU 1JBDmHhsxEAnek9VpuJCBj5Yj+Smmi0m1cKIg8oNhsqwDoWQONt6AMZLGohqkqljLNV+ 7h+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519951; x=1781124751; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JQR90cp+QFPUvm6Q8olzCzDAjjCzsQS5gRAB0T0h0cc=; b=qlsXlmQY2TTmXXrczUevPPKDIGUAF1gPQaApXkfXF1/BkIfNhiHnhN1nFMwRd+LxUm f+Dr9n4BXmxxPssUmzp43d5n+l0MO4LNE3kczAu/6jx5S7G4vHug6vRRQCnna+fZZ9/K FGTKs5gF+zNfwgLzZU3znGNObNelKcFcOngWAhyA7DDOS5nsQL1ARCJY2rq3sjOQMV/h 0972wTZvLaqmnEiFWweoI973Cz+P4OWoOy40J9TLDZBhrHDVaA15jtexGQ9rZKqiyQeu eTedpKKqk2Fp7ViDUPr1eGYy8QwboNW47XMcC7QHlI7T9mRI93R1X4Bw6T3oNvFHpJeM DnDA== X-Gm-Message-State: AOJu0Yz6xTrIWpjIgD0SmkCgr8j0dxIFvdDxX7ZCtIVH6383vyDL2Jkt I+d99TSk3UdWW2/jq0wPSQFNzZj31uf1hd17TLxxKbLa8xhb8WCDCF+S5pL4KBqJKmv6/BvcZvD EyXKuedD5/rI087pk7yjuS21LbAg8O/8GmRlNxwzPWhynKdXXgQuNUZ8SkzR9/rlHgruq X-Gm-Gg: Acq92OGx7mjVBhWTERz4/P7Amlat63oO1504gUxZ/22q7HNn0TwbtQIZt2xNz0anT0+ 5gzA2rr5cl8fdmz3xs8s3DGa/MI9F5Kq1p6r2+n1iBODSLvSeyVl7AAxHk158ZcVer7UBzgT7Gw XVUJFCyg+ck+xkYzcZHVjoD+mddd5w9wn6GSFV7I8LBmvCg40OZQSGcnoQwHxTJ66FTNAQwgY5A HHPQjHwOvZ3CGNVRpXJkqH54XYtAajtY17F3GRotoB6VwqevHpWZ/5rtbLrKu1jUNaAY2vtXc8T OzT3g5exiYSUxaWixikZRikCdm/2CM5A/sRKBkpWB6XSSWWukY33vj44hDXmT1QQrHeyuyOwcEn MUI169cnebdKXicyAyNF8SqMH0e881pbtlPMEeJLfzzgICmISs1CSamqAKAYZwEauYd0MRwKHjr Jv0deLvilN2atqUQUb X-Received: by 2002:a05:7300:cc8a:b0:2f4:d190:37bf with SMTP id 5a478bee46e88-307621ad2c4mr313844eec.16.1780519950866; Wed, 03 Jun 2026 13:52:30 -0700 (PDT) X-Received: by 2002:a05:7300:cc8a:b0:2f4:d190:37bf with SMTP id 5a478bee46e88-307621ad2c4mr313831eec.16.1780519950360; Wed, 03 Jun 2026 13:52:30 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 23/25] scripts/checkpatch: ignore spaces required around some operators in C++ Date: Wed, 3 Jun 2026 13:51:50 -0700 Message-ID: <20260603205152.1440291-24-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: RiMVzUVv-XLb9-lRpqJrrxZqEGKSoBrU X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfXym4eWKjEQiVI auikULkVxhtIpl8qobggexzJ0aYhhg1NUqA2v5ERSOgu28P0+4lca99wm0m+XEDyuS5JvaA4RRS 95atkNPbGuxZJJ9Tr+6blHBlViNx8oN07FMjVcTQa+WdYnQRE69gjM8JLgXQ59s0pBM1yDRbya4 Ho4oitLuHEZZx8hLBkqHQ7j+AkH82s7uJL02CUTD1a0v3EZEvtbBXgoNECqIkumJm1UpJiFdFCs VzGX+llrYgt6srWyD7vCJs6RbVTBQwCYV2PskgU/rU8MjBgDXe95l5pAWtZCctzxiVfyjGymZjo JUQe4DOlGH8PDsegr+Ph56dE/vmBrqP45ycaoTmMDe0z4ZpCy891lOGNeqGnkGvC3wToVDr8N5b ZtulivVhg6iAP0okHSOyaqSRwL+YUdxBzaCkas19OtIvDD2tJ2RwhCsl0okRD3KDFXiWFO4BRK/ vb/FcdnHaNHuOCt9Egw== X-Authority-Analysis: v=2.4 cv=DbcnbPtW c=1 sm=1 tr=0 ts=6a20940f cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=CL0rStCbWIDYl8qm6LgA:9 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-ORIG-GUID: RiMVzUVv-XLb9-lRpqJrrxZqEGKSoBrU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 adultscore=0 spamscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520107924154100 Content-Type: text/plain; charset="utf-8" C++ has a different style when it comes to space around references, dereferences, so don't report it. Also, closing templates with >> gets wrongly confused with >> operator, so just relax this check. Signed-off-by: Pierrick Bouvier --- scripts/checkpatch.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 2189db19f54..c74ec070c53 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2621,6 +2621,23 @@ sub process { if ($op eq '::') { $ok =3D 1; } + + # Ignore * in C++ + if ($op eq '*') { + $ok =3D 1; + } + + # Ignore & in C++ + if ($op eq '&') { + $ok =3D 1; + } + + # Ignore >> in C++ + # checkpatch is confused by + # >> closing templates + if ($op eq '>>') { + $ok =3D 1; + } } =20 # Ignore email addresses --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520100; cv=none; d=zohomail.com; s=zohoarc; b=nRceeOBzyjCD+yBg/dIUzlTjWr5sYWYscJxS7yvFC9GexyPAWm3MwQPsn6/ChnyS+ZIFSsllgl4MPJNEHjHl1nfxh66dr4HWmQ313fOxqx9rbb3iCTBEEQOsiTShjJanRty38fLYcfAgquaeZq1EeajVqPwsFqhrBfMg2PEUexM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520100; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iAMw+Umamu426qsiuv5WzZwhKM+xLIsnUWXk/+9vdhA=; b=K1aH3oLkPrvgSYW+GqcyZmgUqr/q7O5M7X1q+xq/MBXg+ZnkodNCEJB+r/7AFn/TCyGZ3+RllIwW+0Ph64bLrN/CJFAfyzA9sXQCwMMtib9TpevYwEU0tz1w7cBgODqD0qGqrwTUSHkrF2+2Gd/lXqkRy3rZKYVu+c8Jc9oZMpk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520100121589.6740454599327; Wed, 3 Jun 2026 13:55:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsaa-0000LA-0c; Wed, 03 Jun 2026 16:53:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZt-0008Cl-He for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:43 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZm-0004K4-8w for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:39 -0400 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653EbhLD1476767 for ; Wed, 3 Jun 2026 20:52:33 GMT Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejp6nsmyq-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:32 +0000 (GMT) Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-30762d67a64so444452eec.0 for ; Wed, 03 Jun 2026 13:52:32 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=iAMw+Umamu4 26qsiuv5WzZwhKM+xLIsnUWXk/+9vdhA=; b=M5VU71+hAF4DI1GmDcTqJ+gwRQD ZNd3VWSnjO/YdtpVQbmDQLwQ79uK/XS0bR4edNcCVK0MytlTsMGFfkZ0i5rE8iLi 38JAsUbdxBRczTPO0lvEiv16N/CKpVQGq2ZOMqiMINTMCiq63tc/ctSG/tom6rRh 1KpNqTWvkC8YMFqlS5MDAKcbmnv7/sygwXvg72L7eNV/4JY59PEqwW48nQwuf2ig X3fr0+FpCi912+16CkmU2GV+wwSEE6GkBLeGcuVWOelZ/bPNqXTAmenO7dzpWCKY M9htWAz8rlfa/Uo3PJVIH9rXYTVW8HbQcB07kpzFwxFymbyB8cSrNHKfJnA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519952; x=1781124752; 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=iAMw+Umamu426qsiuv5WzZwhKM+xLIsnUWXk/+9vdhA=; b=Y0QTR3+tf5ZglPXvmHCKhJBRgrYLxqnNro1RT6+3qyw0WnG7zdplqd7T20HrIqfw9z cufRpwgRNk9naWYipQtOUPIST0iqAgFNv15jjIPElNlP3JAxYSywACMukS5VvF3QKLOx fXWftpWgKqpVpz6L6bB0lciJXhINzw+OYFwV34DNxdh+Rp6yo2506EBohrKBq26AL5f2 suKb7cC4vnFl9zVs7KwgGS/EKsaYpzDYUeL+BHfPzlWC7zyk0Ochz5zdyGdu/wxiS8te Lb5GC5zdx7NWO7/wGyIGUB7C5txWI7dSpK3x2ZoyRR+aLlFKSNlNUEAp0a1YtnT2AB9f imhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519952; x=1781124752; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=iAMw+Umamu426qsiuv5WzZwhKM+xLIsnUWXk/+9vdhA=; b=S7Ytak8pOhWaY7vV5x7261wy1Xf45BK0M6UCWM9oOHL+ZAITF8wD+BC9pH95t4BbJX 0Q37j3i13se/2JeiNcOC2Vr9PJkIUaHqPWUuwFTWIFbxHOHSwL351XjEJbIDtV773gUH OMeyvSPzed/9TJnqVGJ25q4xaiqC44G+PtV99BDkEfO9/a7juUiIz/DwAWRiUeBWo1AJ WyHu7qqnAt+/pQVCTttKb6vUWNhOpzsFUWQN5G7G6XksuCSzOJHTpGs7CnRooXwL8kWq /sUNAQmi277Co6bJKwZLq8Ohhrlv4Tqoqul/gPX9k0PSXsnRF0zwthUr1jHfQ7U8IVMD aSCQ== X-Gm-Message-State: AOJu0Yz2Sp+iuBkn/g9aAH8Vt+s/PvemDallk6080ohtjO4cNdGtdmmL QnqqRYnSzmvvKsj1NHrZoYw7Lt+GRDopyXMo+KWnmFrpm3CPmv8F0Xk2FfwdvlKyutY7SqWJAP/ +3R10MqEnPrntN7vyMdCDCwhYc/dmz/p8gOq42SRqX0lJy+4TUtLO1wiRQbAwRYtmRRua X-Gm-Gg: Acq92OEOajZyPdaq5ExepR7Qlj5WQI2wFWAu9XxOttJ9ifmxXK+HoM48FnmIl7zWvSK rBAAUP61dkpXitMBX6d/f4w4qoZLbMKiTW2Fy3HBVgt/QDn99tTnZMCs9u3zjIw4edhQgUW5OhH bnzaMxwGxHKpBBtsSOyuobIBLMvlkHBRKEfOd2YU8+MJhy+YYfXTYgF16BrcgSBu4gRi0HkHMAw YgZixT84ya7zEmgRPT8bCQrd70N1EyLVmG6C/cryI3PGtBE1T7Rc9dC6Or3xgkhJSoCCJ1TzsZH lPK4esvzLPLlnElsjBL9mw1bh+8VmEZRAYzb0tm8CWqXfe7FPyYcXoAhQbz/G3PiaCc/bQLdQN+ bcH2vWtkPL7OGRHLAtoI35V+y6sypg33OEqv1MVSG7QAaT0WQnhDXNum15wJvRrlt0OxDqCeRf4 vFmyo595BykkjpL38V X-Received: by 2002:a05:7301:1f0d:b0:304:2e9b:8f57 with SMTP id 5a478bee46e88-3074fca0bf8mr2701801eec.34.1780519952169; Wed, 03 Jun 2026 13:52:32 -0700 (PDT) X-Received: by 2002:a05:7301:1f0d:b0:304:2e9b:8f57 with SMTP id 5a478bee46e88-3074fca0bf8mr2701788eec.34.1780519951670; Wed, 03 Jun 2026 13:52:31 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 24/25] scripts/checkpatch: remove check on forbidden space before '[' in C++ Date: Wed, 3 Jun 2026 13:51:51 -0700 Message-ID: <20260603205152.1440291-25-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: 9UT1r-aLr0ZRUdvwGZpboDZ4xLg1T7uS X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX48o67Vbnk2bm M2kc0IIAkrNbGEicXQ4Gi/+T0aOoEePKFo8a1l+719vtlLxEo5pz+GuvydJR60sLXr9r0vP4uOy zM0yigk2+QpE1v/V5O8SoRpQjJrpb68uK8IuHCwKgaKihNHbylhabI4OZZiAQquuQg/FkA6MT04 T1rxkJ4cq/Rzu2b5beZL2x170M5KVejitQpXvFI0EdptMM1WVWCc5Ztkrezw6wVQcMF2vlvmPvX e6TWREOCIRXHGUvmz/OAEqpHtajFaYOwvX3QJpS/OrcsmInwrVIPAo7azpLq5DGU37whOgYJluI vCPhXdouVcB2/C2QsuRD63nb2CIU3/weMN3PDy6H0WquwqGFHgCTDmF4CKQBsWDtU+D8Y/fqKLC 8uvmAXbdHkX37dF23mgMy6KhESu3wB+vZhtBFJnRX7o3UtEk8ZXHI4AQHs9mL+RxvUO2qdUKqa2 2zMJ2fb86cQNrM4kBAA== X-Authority-Analysis: v=2.4 cv=DbcnbPtW c=1 sm=1 tr=0 ts=6a209410 cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=AevLI7NHNFxaMMikSDMA:9 a=bBxd6f-gb0O0v-kibOvt:22 X-Proofpoint-ORIG-GUID: 9UT1r-aLr0ZRUdvwGZpboDZ4xLg1T7uS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 adultscore=0 spamscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520101835154100 Content-Type: text/plain; charset="utf-8" Lambdas are very confusing for checkpatch, so just relax this check. Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c74ec070c53..d90aca6fcbf 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2423,7 +2423,8 @@ sub process { # 3. inside a curly brace -- =3D { [0...10] =3D 5 } # 4. after a comma -- [1] =3D 5, [2] =3D 6 # 5. in a macro definition -- #define abc(x) [x] =3D y - while ($line =3D~ /(.*?\s)\[/g) { + my $cpp =3D $realfile =3D~ /(\.cpp)$/; + while (!$cpp && $line =3D~ /(.*?\s)\[/g) { my ($where, $prefix) =3D ($-[1], $1); if ($prefix !~ /$Type\s+$/ && ($where !=3D 0 || $prefix !~ /^.\s+$/) && --=20 2.43.0 From nobody Mon Jun 8 09:51:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1780520077; cv=none; d=zohomail.com; s=zohoarc; b=O7NwnGNWkI3TeUouv5GN+//elNC9zj92X2IbC91m26Tu1zkPvdZL8Sx+5pT4Pnc9JriXHLrIzhP6BSDFgmfZT1TBghT8Pp7j2fd0uviSmzQ//5IeBHOPDwfnbOmqmDvnU6r6WGVxQ0w01MLaqEso54z2R7R6QUdXF2rvI0E3CjM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780520077; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=amhGlZw3DRao7feJkWiGnFMlE8A3+ahtNigty8xHgWA=; b=XDDBOXBi+uz/BoTaqv6FgXRsCzkUzGGPmYox2DNCaBUbCkcWkjy3T5YnmREiS6nBE9lYnd/Qn1eJs+MKib/GXcy01W86Y0MDLcuVH71DWldVa/7vjRg8moWOrqPs8P/RE5oEJZM/d4Il/nERZgF7EsDKunleDgghJ8kyxOnk0Qk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780520077774630.929097668272; Wed, 3 Jun 2026 13:54:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wUsb8-0002i8-7w; Wed, 03 Jun 2026 16:53:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZt-0008Cm-I9 for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:43 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wUsZo-0004Ku-UP for qemu-devel@nongnu.org; Wed, 03 Jun 2026 16:52:39 -0400 Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653HWSPZ3552373 for ; Wed, 3 Jun 2026 20:52:34 GMT Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejj9mtp36-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 20:52:34 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-304f1820babso359986eec.1 for ; Wed, 03 Jun 2026 13:52:33 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074db85f60sm4586333eec.8.2026.06.03.13.52.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=amhGlZw3DRa o7feJkWiGnFMlE8A3+ahtNigty8xHgWA=; b=lNWU4izE2HA2UH1bdwRqR2/QQQj 4bWWZoRI44y8NFyOKzgSYigtmXM20RMVHL1Vx2Qi7x4arU3XTiq5kMuptpqD0VzO TKCxvyN+4yPQ5NMqNzD60Y5FszAEtGeO0gKhGLp/eKlfQoehsihv2lGnpj3JEuyb 6rG7WNCp/8Gs+5bU5z7Vx0/d3rUPeg9zYqvZ0j49c3nBB/7BUt25DCfkUe1tIc1m 5l18FkxNIQLvchUf66kwFu2xbm02wEueIW1IBrBZlYtjh6TNbc+mRBXhsuR4hfJl qP5NplqTjT2Cpg8Myax0CkuzlgAwiBU63SkcCXI4nZ5y2yEOzsYvQfMadDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780519953; x=1781124753; 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=amhGlZw3DRao7feJkWiGnFMlE8A3+ahtNigty8xHgWA=; b=SJQivX5IkXL1yQknjU7xzxekSq1G06G+ALZpdhwUTe+hAFU3/Yuel2zzg9KkSh2nC4 6AeIugXl4NISfZ8dukjgyNXIOMx2YJRkqIpbjeAEz5FM4ZcEsPGvrw6zh2OUG6+w+NgB LxfLBpb6mE5be0i+Mla9eRTgQ5iY0sOcCrBKnao1L56i+UJQR4mrksdsf6UPAZrSzaAw 5fDMd8/izDqm0k/swJAUH4sMBgYDTcbzqHv3jOnOq3QKndpQf8SrYf8lZoEaMu3Yr8md JLhHzpiZCDdT3+Z1i80aVWZ9UvwHVecjtg10ns6JfuMhl47h19dUoyE4Pd6ddgqHy89y lvIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519953; x=1781124753; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=amhGlZw3DRao7feJkWiGnFMlE8A3+ahtNigty8xHgWA=; b=hH/vLItj1IeInnbmrNOPtGNODB+K/J09E9XQL+Bw4FoC1bOdIIHNfFc9/y+ewiJV5E euFBnkRDeHOydTuj8RhMUv2+MONdS15YE+quJ7XyGLdAqt57xI12QkOxIVAvF9ErNDHy KLm30WboDdSnWh/TLr0crjQ5ZFiD439eMhONIXaP2CI8a/fbNckMt2v+f3IGTkctNTDM RtINYUeWKpYOovmzI3VffQPek6mVQ3o1kNQZAMWih263qwmAo+0oqkifOxMAPpTK/9VU ePpmev7sDe7e1Gyn5HcJONh4TykVBSCsRqqnUzu8WypB/LSbIbOWLw4XZ5db9oKASmCd Y0iQ== X-Gm-Message-State: AOJu0YxxxeJAiyi1vOk1iLzk58TuCGVJYolrZgAcoK7ovBtSjcD2pHXx h77uDhntD8XRU8OvX8oSG2LWdo1kKImtjRc8KxdgwDYOPU0v07ogz3urkTItt20qES3koLpeU6V hEL0/hl4tSqOwOH9lvupBa6gLOKiG67z2ZBfYGM9dwMD4Mbmc3E/xNO4xHSOwmB/Cuzg8 X-Gm-Gg: Acq92OG7bhl2TTNRQMbCesbYXusYgwQenRInxMCwbQxhJsmxM2SQj43I6gU6pwbprpT +ecTNsuw7mCgd25GQWs/o3ENCSwW/5TrnhvKogk3G1ZKT0wmqNy+3AX2NrnEjpQKPCpXOgyVDrD jG9kV0pbt81n0J1YZe9BpD2WMHO31tzirWS1GIu9SUkB62arT1CnPe2/bHur6WRoHeUTHfnDhIM u3o9TCoRAXz+yo/zEjS2SBS6wIO4dh/zUgZCPFYaDye6g8sTJp0z1+Z+mvuqTnw2Tudbi6XHQtD HzJtA6QrpP2XfkwQBQ+yYAUIyy0/1U3K5oQu4hvPgdvRT4JfWsunA/Jlj6SEe97BvYAVHKhjSJB 2Qx0c3ca8r/1cZzCPTP9A3YAvIIdBuQkAs2gKuneOb6y+Yo4LW9hM9GXTAzicHsQDhjRuSxrmKC WktqBa1gKSeYZZ6Et9 X-Received: by 2002:a05:7300:3c21:b0:2f7:d419:dee0 with SMTP id 5a478bee46e88-3074fa6550cmr2676083eec.6.1780519953284; Wed, 03 Jun 2026 13:52:33 -0700 (PDT) X-Received: by 2002:a05:7300:3c21:b0:2f7:d419:dee0 with SMTP id 5a478bee46e88-3074fa6550cmr2676075eec.6.1780519952752; Wed, 03 Jun 2026 13:52:32 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Chao Liu , Richard Henderson , Brian Cain , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Alexandre Iooss Subject: [PATCH 25/25] plugins/cpp: register callbacks using captureless lambda Date: Wed, 3 Jun 2026 13:51:52 -0700 Message-ID: <20260603205152.1440291-26-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> References: <20260603205152.1440291-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: gxZWtS81N9Rmj9R9PglEEvfADGMS_vVa X-Authority-Analysis: v=2.4 cv=XK0AjwhE c=1 sm=1 tr=0 ts=6a209412 cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=4ZBAFY-vN_xJtpMkgcgA:9 a=O8hF6Hzn-FEA:10 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDIwMyBTYWx0ZWRfX7rz9Fv9g4l7N oh4HrH8AZVykBqUPd7mFAWcxrjZSFffapuil2D/QrlOhRLhzXsD7H+zSt4AUS5o/jiskCdKK7sD WDQWEEqY55idrskWYhsMRWXQ29QUz3pYJVO3NsqRMNsXrRU+lr6ZEEiPfuWRpX1G/rU6YXruwFV OKmCuVFyrYkpV3rwx+525SOri8MB/KfbTI2PQaQHjribZryn7aGo4DjK5BYM8PmJDK6SwuU0MC6 sLzb5dSyIknwjjPFnweSZuTjHZ4dvz/TycunElyhYBF1e1hRCPd9xZBVT7X9o+oL/11XMEuU+PL HvO19TcqZVMv+cl43GJznCr5S4gZOzSwuE4M0+fMF2pCZTSqUv/tHOJ2fsjhDHxt0uMEd2dTE5X Ne7ktNXJDH2Yd5KvqzROy18W5Va/2gJbzcWWbjpSqQ8Bl0suBWgroLZ/uy94d3QWCgEcpFUWHF3 DiA2WHd70GAhNLycvTg== X-Proofpoint-ORIG-GUID: gxZWtS81N9Rmj9R9PglEEvfADGMS_vVa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_06,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030203 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1780520078985158500 Content-Type: text/plain; charset="utf-8" We can now demonstrate what previous changes allow us to do. Since all callbacks have a userdata pointer, we can use that mechanism to move an object through all of them. In other words, we can now have stateful plugins without resorting to any global variable. As an example, we implement tb counting plugin with our cpp plugin. It produces an output similar to hotblocks, with same performance. Signed-off-by: Pierrick Bouvier --- contrib/plugins/cpp.cpp | 89 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/contrib/plugins/cpp.cpp b/contrib/plugins/cpp.cpp index a0bb261fbe8..c5099456525 100644 --- a/contrib/plugins/cpp.cpp +++ b/contrib/plugins/cpp.cpp @@ -363,14 +363,97 @@ =20 QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; =20 -static void vcpu_tb_trans(struct qemu_plugin_tb *tb, void *userdata) +class PluginInstance { -} + public: + void tb_exec(std::atomic &count) + { + count++; + } + + void tb_trans(struct qemu_plugin_tb *tb) + { + auto vaddr =3D qemu_plugin_tb_vaddr(tb); + + TbData *data =3D [&]() { + std::lock_guard l(tb_trans_lock); + auto [it, is_new] =3D tb_data.try_emplace(vaddr); + TbData &in =3D it->second; + if (is_new) { + in.second =3D this; + } + return ∈ + } (); + + qemu_plugin_register_vcpu_tb_exec_cb( + tb, + [](unsigned int cpu_index, void *udata) { + auto &[counter, p] =3D *static_cast(udata); + p->tb_exec(counter); + }, + QEMU_PLUGIN_CB_NO_REGS, + data); + } + + void at_exit() + { + std::vector> v; + for (auto &[vaddr, data] : tb_data) { + uint64_t count =3D data.first; + v.push_back({vaddr, count}); + } + std::sort(v.begin(), v.end(), + [](const auto &a, const auto &b) { + return a.second > b.second; + }); + std::stringstream ss; + ss << "Top 10 executed TB are:\n"; + size_t idx =3D 0; + for (auto &tb : v) { + if (idx >=3D 10) { + break; + } + ss << std::hex << "0x" << tb.first << std::dec << ": " + << tb.second << '\n'; + ++idx; + } + qemu_plugin_outs(ss.str().c_str()); + } + + private: + using Vaddr =3D uint64_t; + using Counter =3D std::atomic; + using TbData =3D std::pair; + std::unordered_map tb_data; + std::mutex tb_trans_lock; +}; =20 QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, int argc, char **argv) { - qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans, NULL); + PluginInstance *plugin =3D new PluginInstance; + + /* + * We can register a cb with any function, which may be a free + * function, a static class function, or a captureless lambda. + */ + qemu_plugin_register_vcpu_tb_trans_cb( + id, + [](struct qemu_plugin_tb *tb, void *userdata) { + PluginInstance *p =3D static_cast(userdata); + p->tb_trans(tb); + }, + plugin); + + qemu_plugin_register_atexit_cb( + id, + [](void *userdata) { + PluginInstance *p =3D static_cast(userdata); + p->at_exit(); + delete p; + }, + plugin); + return 0; } --=20 2.43.0