From patchwork Thu Feb 29 05:53:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 776895 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp659264wrn; Wed, 28 Feb 2024 21:55:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVTcoTixNmoS/Y6bhqF/Caatj+Dh15kngD95IgPjxzbATiVcGCCIhuF5hR28QiCt0TKKkzBe461V285ELEXbAFl X-Google-Smtp-Source: AGHT+IHrlh/0p8B6CE8fFoH0c5klSIHvVrhlASyo38oSRNAG0tZtAz0Bq46umPO3rLXCmGLKH5rv X-Received: by 2002:ad4:5363:0:b0:690:46a2:f06a with SMTP id e3-20020ad45363000000b0069046a2f06amr783678qvv.22.1709186131922; Wed, 28 Feb 2024 21:55:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709186131; cv=none; d=google.com; s=arc-20160816; b=ubJIAksl6ucMp3g0ul/nYxk0GCQVWK/VJlHwrGeLcdb7ygLoEFeRKF0tyONUY/H8cZ A+DL6JowCvIZ+sjyYWPAN/pzcGxxSKQbpKV5vvfymiAupL14H+X9iNldDbKtp5djWDYb 0bvO7PQQu3w0hN73vzCZM0GFbaiwsevjXu48KH8fdeVVQ8YlrJWBHsPnJuj45pB9Lj2w e47RMMB1phGAJ7bXNP3EGiKwctnRtlL95QzqpRR+j0E50iXthX15saR6OaQyaub54Sl3 b7IZ3086bahDTCyhFEt5wQzQJO4GwDtVbrQERJvEmJSu151G52G0LEZE3yZcqPqplVWx mvSg== 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=T2HBVz0S4NJ5PHHJFwkPmozZ7jbnrWNnxao4/XSu/No=; fh=8lOiKNd9h86rc82T3YMc9TRwDu6QzmEoHMzVmFEI/Z4=; b=Eyxsbt0QoS0ZJI21beFz8L8ggvVUZmv+ZSCItNXyoGRwcsQR5Flj+n5jZtGNuBmhv5 eiyJRCp60KPFIMsQlmqgo8J1v7pGhTboXK642dZ6tf+3/Gw4+2gRHYyZ5tAQnSnDOmNn Hl35TOsyPWWNcNm0hUkzynfy6Gl1C6+1Jokrpzx3bWpz5VXqSH8ZDyFid9873XfSo1ma ASW8JmuvZmiic2pqag52+AvPSNGybuobdaKuTJQbeJjZKujIqhQjZNf/n9cl6trG6bTD 0tCgUoNDx5nFJV+XX3E2vFShi4NBseg9kCTl6B9FmSpHCMDreHk8iWMdxZ7QCm6PQApQ GTOw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AK1TpYyy; 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 gg8-20020a056214252800b0068f654af189si734394qvb.110.2024.02.28.21.55.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Feb 2024 21:55:31 -0800 (PST) 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=AK1TpYyy; 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 1rfZN5-0004gt-AM; Thu, 29 Feb 2024 00:54:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfZN1-0004gi-3Q for qemu-devel@nongnu.org; Thu, 29 Feb 2024 00:54:15 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rfZMz-00076G-LM for qemu-devel@nongnu.org; Thu, 29 Feb 2024 00:54:14 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-412b68d1a42so3926535e9.0 for ; Wed, 28 Feb 2024 21:54:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709186051; x=1709790851; 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=T2HBVz0S4NJ5PHHJFwkPmozZ7jbnrWNnxao4/XSu/No=; b=AK1TpYyy4RmCaZCIp8AvDV5DOE6RESj80/bF9731v9KsMJG3bT9LKo3Cu9TcDQNMN7 f9rEyxLRu1dLv4vuQZ0jAKXEcDI85gdFF+5zJAF85wNvEUZtCwo/MARIVUoVnW74UGgo xY9fSMTiPIqkarq4vECtm0w9/Wpfcxk4j0WNS/2PUVux410RzR4BW8g3Hs5Z/f+Qpr/X Lg8W6j5XN9YdNaXC7x8q3bE854+0mAC6FcHcfwYIqMtbFG3zf0jEzgkppRbNBLsucaSo 81KM55sQzAvU3qscLINCiRu1V4qgdRHStQVtW177GaIlpPKoUjU9tPWL32Ygnq0NRF8p 2o0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709186051; x=1709790851; 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=T2HBVz0S4NJ5PHHJFwkPmozZ7jbnrWNnxao4/XSu/No=; b=X9J1+jzeg8cr1lmDBjfP+mN1yauypoZ2MA6WW+1i2gGMpjAZctDG/9mNrXBpawrt6K ZEgsoe2CR2OcxhMOo79eD4PfjwqWkstqiefkZ8Dp1B3lI1CjQJxyt7nXz12LbnV84zRF PkUemvoWnSbDjvFOH6lX+jp5U+cB2n+NuQ5kyAV7f8QR0CDmJvWADsr1AKiZjV11IS3I UeSYEfIX+BZ7+BZIUseCLdicLmmgE3wX+L9MApkifKnGZnJZTNgtu8y3op4Rdp4NDPL3 059+XYFKFm2RhesZtt0A3ykYJRX4tvsyhenIaoKS9FPVLIFnoLtMURL5qvstyklVGOZp 0OwQ== X-Gm-Message-State: AOJu0YxEcTu2+1tzBC1Nip0Ae/h6gaQsk2I7+64WFK0TGXrmhKdSsB/B JwHviiFNFRAeu4MO6BevjlbFhblQKXSc7QOMn+lGXAptCDE+oUkqVchtEis6xMFfe6Q19/wdBIR 29TY= X-Received: by 2002:adf:fb52:0:b0:33d:5a6f:a856 with SMTP id c18-20020adffb52000000b0033d5a6fa856mr569911wrs.30.1709186051045; Wed, 28 Feb 2024 21:54:11 -0800 (PST) Received: from linaro.. ([102.35.208.160]) by smtp.gmail.com with ESMTPSA id ck12-20020a5d5e8c000000b0033d2541b3e1sm721589wrb.72.2024.02.28.21.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 21:54:10 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Mahmoud Mandour , Paolo Bonzini , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , Richard Henderson Subject: [PATCH 0/5] TCG plugins new inline operations Date: Thu, 29 Feb 2024 09:53:54 +0400 Message-ID: <20240229055359.972151-1-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wm1-x32a.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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. Based-on: 20240229052506.933222-1-pierrick.bouvier@linaro.org Pierrick Bouvier (5): plugins: prepare introduction of new inline ops 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 condition callback include/qemu/plugin.h | 10 +- include/qemu/qemu-plugin.h | 80 +++++++- plugins/plugin.h | 9 + accel/tcg/plugin-gen.c | 359 +++++++++++++++++++++++++++++++---- plugins/api.c | 76 +++++++- plugins/core.c | 28 ++- tests/plugin/inline.c | 128 ++++++++++++- plugins/qemu-plugins.symbols | 2 + 8 files changed, 633 insertions(+), 59 deletions(-)