From patchwork Thu May 2 21:15:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 794138 Delivered-To: patch@linaro.org Received: by 2002:adf:a153:0:b0:34d:5089:5a9e with SMTP id r19csp456640wrr; Thu, 2 May 2024 14:17:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUZW1ttl517IzI6U5ilfxGfoR7k5idDXLfbPeUF84/gnDMNwJyfrBcIDwMBsVbHLZJCPX8tgkZQ/xzySuPILzmu X-Google-Smtp-Source: AGHT+IEN9ZJ7QouOYTw36ghBAZh6qsMkas+B1nNhCJc6BohP+48U+s+9t9ytA1HN3KOkO9QbnK+V X-Received: by 2002:a05:620a:4448:b0:790:8c28:bd9c with SMTP id w8-20020a05620a444800b007908c28bd9cmr1173986qkp.6.1714684655156; Thu, 02 May 2024 14:17:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714684655; cv=none; d=google.com; s=arc-20160816; b=K0HW4ZjaQTXHg3UdTcxynDo9imkTFAqwJPQc07/id7FbP0/bvAgmqyTjWAOu3Tgwhk 3g9PJb3Xw2tv9rAtc3CWWckuSLumQtgnMKkip8MdBd7ghDriXf3xz+rRezeuV2+puw1k NBpmlbKIg3hvIKzNQgCUyJDBBPTxwx6mJXpTnaJ2sTKdxa7mpueagnw8S20LqFojtHgd dNftMRzP2kLZQZLHYCnvnzto8oNabd4HUJjXGaW06sgNfH31s7gx0IlxW3QPmHHFwu+j BlkrCfJP6w9Oj74UypfklWBDpQ0SXJWKFS+T/u7n42rHv5+5uYdKqP3ul6QSufqBtAE5 YGcA== 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=4oV0Bq5JAyOVtAmAE/+atb+/0axiHuyH+IUkyLsJWWY=; fh=9xGhv+1UliIX34j+rhFuVtnm9fBdMYzeJdXCJAB33Zg=; b=prjLNyR1o1lMaLiDxQPryPxxbQE4x258zNZEMvqpxFq62NCGHq9yORzmuB8NlvSdL0 DthArXpT4peRN6AGCHGE+3gUebr0UcijVPp0i/dOPmUmBR3QtsOXQjVOv5CKxzmmbKPv GpyhvvyCGovakEO9r8aQGp3v1+5kwy05pAYmolD/Rh53FjY3n57kI94zappOlDCwdBwT 6eUrp4vs+YUnh24fEK/horVQT+sxHFxig2IobeqlrEOa6oOfyl8dJkjhJSZrBIR1pz4Q 6KV46EQjiuf57PvT/2iENN/TOsWHEQUL/IcOy3B1n3XXzojSGFaw/g0EmBKqljzNQPCs 3iFg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ATavs0YO; 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 p16-20020a05620a22f000b00790f8d84125si1711220qki.453.2024.05.02.14.17.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 May 2024 14:17:35 -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=ATavs0YO; 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 1s2dmH-0008KW-Et; Thu, 02 May 2024 17:15:41 -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 1s2dmF-0008J0-Sp for qemu-devel@nongnu.org; Thu, 02 May 2024 17:15:39 -0400 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2dmE-0002nx-56 for qemu-devel@nongnu.org; Thu, 02 May 2024 17:15:39 -0400 Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-36c0ef5f7ebso37791035ab.0 for ; Thu, 02 May 2024 14:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714684535; x=1715289335; 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=4oV0Bq5JAyOVtAmAE/+atb+/0axiHuyH+IUkyLsJWWY=; b=ATavs0YOPqU33wc56JB5XSkJmqlkRQ6i0b9hjHucRvPDyTaczLO5qco5YTsQfX1O8n 6WunhNwNNqSBiI48rYmo8XR5E7WN8eV8M8boAXGfesyh1aUns2253YhC4TxaP99j0yH+ e252Aa2QWpSqmyt+RWtqnwUGrSRyY5iccHKBRaKn5U2TlBND9tu7gm6qfMXrfUecPiX0 8Hfau/R0HRa8remln+SyBQBaJW83Kb/d6Vs3tJi1Gs+MZAzGqbiMGocmrgUmZ9O8k7yo fZkSaWSDrsLPBQlNDDptA5yJaSRg8be5pb5Qcef3v5Gs0aE8v8Y9B5+edeiEtdOLkdRj T1sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714684535; x=1715289335; 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=4oV0Bq5JAyOVtAmAE/+atb+/0axiHuyH+IUkyLsJWWY=; b=cj/yLqG+H6U2DtyDZY+KnbJpPkwIku6OZDfyIpFaA572S0/RHSMkgHdDJdrO9nzxy6 0mWO0ZIU0ICDLpFjh9t0egfcNIobjXrpTkqSAZQz+RXXd+jcFnwnsRBrxT9J433erpU2 8xC44UoO/HAtETJKI1PU0RdGTWyCKgYZ3DdcRsJMCOPewwM4ur1BdXmwbovRHA7Wgcha CdQUWryFXdPIUQuH2WaMmJE98gqgkEw3xnT6PoN72sTxdpmB+FXuaUn25OvTxodqf14/ CCficdELlLKcdGhKrEMEWA8/vPrscAJbrXSz4BvAx5FImRIaFLYferY6Qx+9nCH38B+P CR5w== X-Gm-Message-State: AOJu0YwlhIc07rP3sNf9KvruH4XuRwcgaBXRI9aYPMNMLJKwyjPTjvJY TrlQUE4U/bEc0Pqr6hU7GU/OeOFVEP461kCwPaPXmKxM0lEf+7H055q2VDg6fz7FWjD2ZFvGhe7 Mjrc= X-Received: by 2002:a92:cd8b:0:b0:36a:ff3a:f135 with SMTP id r11-20020a92cd8b000000b0036aff3af135mr1240394ilb.15.1714684535596; Thu, 02 May 2024 14:15:35 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::ecd0]) by smtp.gmail.com with ESMTPSA id d14-20020a63f24e000000b0060063c4be3bsm1700915pgk.14.2024.05.02.14.15.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 14:15:35 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v6 0/9] TCG plugins new inline operations Date: Thu, 2 May 2024 14:15:13 -0700 Message-Id: <20240502211522.346467-1-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::132; envelope-from=pierrick.bouvier@linaro.org; helo=mail-il1-x132.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. 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 v5 -- - rebase on top of master now that Richard's series was merged v6 -- - more elaborated commit messages 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(-)