From patchwork Tue Mar 26 12:34:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 782599 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1656205wrt; Tue, 26 Mar 2024 05:35:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWdYbOQsRH6F44RioFZ+oOF2ufRlIDAKVI+dSqXSOTCv9bqIqJ9VorHLEz7FLFTYfxcpq3XtlI/vbpBZ4Hn0B0Z X-Google-Smtp-Source: AGHT+IGtA5aq9KJA5QC9c0xcxFoyQkvLRB0wkwlqYkiTzfrtiXZCcqtInIDpQQlrVqnGtqW6QY/I X-Received: by 2002:a05:6122:1da0:b0:4d4:1340:df12 with SMTP id gg32-20020a0561221da000b004d41340df12mr8211901vkb.0.1711456506091; Tue, 26 Mar 2024 05:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711456506; cv=none; d=google.com; s=arc-20160816; b=LgqfkNhUUWuLUzlOA3hcxacFs4K5h0V88pxbToVJwVu6NLk3iOX6rb7wlJgdlCCjQJ yKJKdu4iGFCv5cYAl+qYy8fIOadTSif0MaW2rBtpxvd/h0rByaUqjsxjCbT60de5U8ZJ 1dl4DWGFBOBRuBsyE7ZAbUbJVhsqmXszTpj2rv+yf8CC7zo57z2xsQE7EmPwi7bYOZbk O0kzQ69FdV8PYuRrczmkgp1REMFlhYLMI7jfEgdiiQS5US7xv1baPCVGJu2iNOq+oFgo faCu3I0yWow3oMV0hrkLDIs3SWTx6i7P0WhKGloRx7MT036KA4QbWOndQMBUjC24Tl06 gGaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=svUOsYaO6p9SY9abVfjJdsXNvOCTqKkw1oua4oYqZig=; fh=sPT8jK0hpUYw2nA3qnRx+CfMFrlQBSyMr7RtKrxXrvY=; b=z7G1HKt1fmfsWEIi4iQd/0t8e/huIrG1WnQBcfOuF+SFDlIoLi1KULE+y7tOYpnXv5 /Q+qLlam6EIo660GC9Mke6J9tfnzQ81dD4Mad/ejB8k9BNnsRs3EYgtYXgIyy/ON+wHs TCVMeFyam07unS5vPEok+uay0uqf/KiHa0zTNfjjUBo3Sm2a5+Ivkfi4H9Kv8OnqT9zj xt3ebTyen20uF1JK9YYvANahUcszbjpb1lejHC7zNC271fVkcp29tBUVSMaVhzL6Fim3 UDqfnuPWHbZjcW53IlFpdnj9+H0hU+ZD0/8GGJXITrRXzz8POasVezC3PCITacCchhS8 NC5w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BHio45ZA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gg12-20020a056214252c00b00696a535c898si267991qvb.85.2024.03.26.05.35.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 05:35:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BHio45ZA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp60u-00056j-L5; Tue, 26 Mar 2024 08:34:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rp60s-00055n-8n for qemu-devel@nongnu.org; Tue, 26 Mar 2024 08:34:47 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rp60q-0000d3-L3 for qemu-devel@nongnu.org; Tue, 26 Mar 2024 08:34:46 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4148f00fa66so5021585e9.0 for ; Tue, 26 Mar 2024 05:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711456482; x=1712061282; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=svUOsYaO6p9SY9abVfjJdsXNvOCTqKkw1oua4oYqZig=; b=BHio45ZAsoeaKjNRdxqWSZrWL42sXrZiKfx9Fhf9QXbR5Kj+QVh22SwEB0c57aZMol 7o8tT/RRpuT0dVNKYHvqeohdkeFdocohjow7BN5c1DpRHMGGyh6syys0lc6v1kk6tCC6 sjVVqdYbtdT4yrflI7Ytr/QbeZWGGesq74YiMafxGHJ4mjPDz8n7Lnl04rMwX0q0j4rU s+lTHtgKOS9AoXxzo8J+z3RiOpdCXDv3Gnfrt6OjhQTbIGXShYa5jnfakf0oLCG/bi6Y O4pFuAfB5FxdGs2wUW2doypp3CZRO6/NLQwBY/VT9qii7UO5d6FE09/0yVdX7zD6GRju d5SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711456482; x=1712061282; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=svUOsYaO6p9SY9abVfjJdsXNvOCTqKkw1oua4oYqZig=; b=qjrhF0wlpTGk4/4waAtmU06hrfawL8on+tJ5K8+//6BZzqtSaPYOQ867HRa5KhLGfT x0NXE89O9ANfeFhTxH4xzn9JAqPtqTKmhjdrm++5pxg5akBUXjtOTGAU59z/ncUeHQVc iKy9UU0vr/B3YO0vtlnN9rOwEFNV8o2JGMDAEIYqC5lNz4sz0gzf6SmiZkDYxg2It02d W1PDt1/1LAfGKhyhG6FZ7VovZMiOzjPf2obmSUSf5agLxjTqRu83COPua4arOeJbo+05 P10Gze0H5lbR4TzFkJ6JxFVyoJbEpLiqQ1jFgwbXMwtLGe/gQnbRoi7xlU1DpQaM8jV0 DaIg== X-Gm-Message-State: AOJu0YySabslcuY//JpnDkB2m3YTBt2STv7hSlfp4uAve2vMXVk5pR00 idEACoX0qZmSqWwIwzvU3sYT9tUyhAsojpc7oD/HYWrIXa1zoGbfppxv+Nwzdn2JeV7BE0ZvKzu ajoU= X-Received: by 2002:a05:600c:1c8d:b0:412:beee:36b3 with SMTP id k13-20020a05600c1c8d00b00412beee36b3mr9810309wms.7.1711456482258; Tue, 26 Mar 2024 05:34:42 -0700 (PDT) Received: from linaro.. ([102.35.208.160]) by smtp.gmail.com with ESMTPSA id y19-20020a1c4b13000000b004148090cf85sm716317wma.0.2024.03.26.05.34.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 05:34:41 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Mahmoud Mandour , Paolo Bonzini , Alexandre Iooss , Pierrick Bouvier Subject: [PATCH v4 0/9] TCG plugins new inline operations Date: Tue, 26 Mar 2024 16:34:17 +0400 Message-Id: <20240326123426.761473-1-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This series implement two new operations for plugins: - Store inline allows to write a specific value to a scoreboard. - Conditional callback executes a callback only when a given condition is true. The condition is evaluated inline. It's possible to mix various inline operations (add, store) with conditional callbacks, allowing efficient "trap" based counters. It builds on top of new scoreboard API, introduced in the previous series. NOTE: Two patches still need review v2 --- - fixed issue with udata not being passed to conditional callback - added specific test for this in tests/plugin/inline.c (udata was NULL before). v3 -- - rebased on top of "plugins: Rewrite plugin code generation": 20240316015720.3661236-1-richard.henderson@linaro.org - single pass code generation - small cleanups for code generation v4 -- - remove op field from qemu_plugin_inline_cb - use tcg_constant_i64 to load immediate value to store Pierrick Bouvier (9): plugins: prepare introduction of new inline ops plugins: extract generate ptr for qemu_plugin_u64 plugins: add new inline op STORE_U64 tests/plugin/inline: add test for STORE_U64 inline op plugins: conditional callbacks tests/plugin/inline: add test for conditional callback plugins: distinct types for callbacks plugins: extract cpu_index generate plugins: remove op from qemu_plugin_inline_cb include/qemu/plugin.h | 42 +++++++---- include/qemu/qemu-plugin.h | 80 ++++++++++++++++++++- plugins/plugin.h | 12 +++- accel/tcg/plugin-gen.c | 136 +++++++++++++++++++++++++++-------- plugins/api.c | 39 ++++++++++ plugins/core.c | 109 ++++++++++++++++++++-------- tests/plugin/inline.c | 130 +++++++++++++++++++++++++++++++-- plugins/qemu-plugins.symbols | 2 + 8 files changed, 466 insertions(+), 84 deletions(-)