From patchwork Tue Mar 12 07:54:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 779676 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp1898208wrt; Tue, 12 Mar 2024 00:56:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUsLlmuG2pHTw00zO9MR5rWdG2HxQPbPq8U/MhV22WDh4vc6U3/m2Z2B+tdLMgVQT5L1h7N2bXNNRGMSc+mQZUy X-Google-Smtp-Source: AGHT+IFk/l/Nbcuj4dz5Il232nS+CFplSg6SU8Bjmaae3gPDeCO/oRwJwqoeAy3qxKVkP6nMOZRF X-Received: by 2002:a05:622a:4d3:b0:42e:ec41:99e5 with SMTP id q19-20020a05622a04d300b0042eec4199e5mr12040375qtx.28.1710230159940; Tue, 12 Mar 2024 00:55:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710230159; cv=none; d=google.com; s=arc-20160816; b=k0MuA4jUfZZD/6KgK/xeaBd2jwfBapeNno/q8CAPhr3wrpVrmVDnRmxuakIQ63evv2 KrmHreKiKZaWS/rXcYbTaPF95TWqXTozVYVF6XFnJB3kaN3xBlwOGL8FkTRpL7rxsLLg ekd2clZp+q6vdlNcOuUbDDGWxSStGe8SpxqCzDCfMNtRGSnVONW923Wf9PKcvTVieBXH Xs5DDqmI7WKbruvZlTlxbpp0yM7SNQFNU7GKowtHG1ze1ZN4Z3xhLCUbL8ueck3fRY+m ElmS13Mpdcz2gvk1xg8GRModlaYg/NiWK/pwSKdfFQhb2c4wJEAlxvcClHsJtzltIsVh CfWw== 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=aV8YuU7WEijoOBCxsiWGl1C9Vof5bYJZHCBIlqB4nFE=; fh=V4SgTU7V4nf8OtmvRvW259BlAHhRyVi2BkDbVAQpFgg=; b=R+1ihhWMiTr+B1BTPBMyBocQ/PhcaC2tCv/5/hbVsztE65KLuCRN7zYozz46AKjO3t bFuApd/Qf9zr7OKRiEPdgRZ4x3agyd0/4IXRPPeaQ/lxnOS/478AlQQK0B31ddQFyOC+ jQ2jZFraZwRGO9HqWYWXVyhcZNGdl4LquxzKgp+NvTn+b9onjrn5hvp8GoflL6I2FR97 fWpz5u7fi7fCPEnGsvU16Nl+gY8V+gwLyFeCy95yq7G70nsbr05SKGDrCTm417HaAYDN 27DqnPjohqAV5ea3F4pS4S+LL7neSIT29m94Smjs/q9UYXoHG2dbWtmOhLAylxvrQJnW W51Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wc/aipDi"; 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 t17-20020a05622a01d100b0042ebc897cd3si7291378qtw.364.2024.03.12.00.55.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Mar 2024 00:55:59 -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="wc/aipDi"; 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 1rjwyO-0001wx-Ns; Tue, 12 Mar 2024 03:54:56 -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 1rjwyM-0001wd-Qc for qemu-devel@nongnu.org; Tue, 12 Mar 2024 03:54:54 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rjwyL-0003cZ-8S for qemu-devel@nongnu.org; Tue, 12 Mar 2024 03:54:54 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-33e959d8bc0so1761472f8f.1 for ; Tue, 12 Mar 2024 00:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710230091; x=1710834891; 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=aV8YuU7WEijoOBCxsiWGl1C9Vof5bYJZHCBIlqB4nFE=; b=wc/aipDithQuV6B19QxtMiaetolgNovLPd9Ytb/E2UZZlg53eu41Xuoo2yO+bfUwid vc2UooQkqb6FSNIjgBmJG5cJ0VHHX9NHNSlPwRBBSfD/fpI7zBUx7z876mcGBoTSZgmx GpZiQUgUmVVs98E3LZ+ez2YeXoMOdHyJTrRAx2/d1fnnqftFXz+pvav0I1bHM8NZFrIw nK90DeIVDM+xdrWVAd4aUhRO0Vih4+euHrToH1FQyhz/Djz6SMx2JNJT1zh0lo11V4T8 8DvnAKQD2ya/8jLEJzvqtVJfg0mHWuNQL8R0yti2dVgdVffdNpah7sv/V8g4lvt8waGy ia5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710230091; x=1710834891; 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=aV8YuU7WEijoOBCxsiWGl1C9Vof5bYJZHCBIlqB4nFE=; b=Gn8ijqCYeCRPw8/rROn5dW++61PClRnM81+TipGtzuxVPI/xBcL30Hiq1mhSMDokYt XCX64h8TBdNgVWkHtoBnXNnmE37sIX8kB2awHaghoBDB7fQll9d7EyBXrYVatj/x1y07 MAZmrFo6IrLRw/exGWLY70VjqiMb07HpCR3etBy0OQwGBmX28q5AB5dZDv8dFmf2j8Wp OyZpOc7SeoCd0xm1W9w+JvrHVCXZzFTX+WFsWsmEJ01JAv7HTFZBgPzpcaJ4vvT6XB5z Mi2C2/IcQ7sdWGbDVodqzjQiPrXu6CEtPa5qG5Num7HPNK0VdhLatEp8y/0sOcZxpMxz CXNg== X-Gm-Message-State: AOJu0YwGHjGW2Q0dgTbi8mfwxp/wd5DTBJTmmFIjAwS0JRuKnkTD1U8F AqlSouXnJ/iKYZHtY78laehk9zqJ5aZhAJxmt55M6T5t/2CKIanDkiyFohRPPCl2pVSS+ke6ctT SKDU= X-Received: by 2002:adf:ea0f:0:b0:33e:7ae6:6f4a with SMTP id q15-20020adfea0f000000b0033e7ae66f4amr5993630wrm.23.1710230090697; Tue, 12 Mar 2024 00:54:50 -0700 (PDT) Received: from linaro.. ([102.35.208.160]) by smtp.gmail.com with ESMTPSA id u12-20020a5d6acc000000b0033e7a499deasm6108795wrw.109.2024.03.12.00.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 00:54:50 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Alexandre Iooss , Pierrick Bouvier , Mahmoud Mandour , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Subject: [PATCH v2 0/5] TCG plugins new inline operations Date: Tue, 12 Mar 2024 11:54:23 +0400 Message-Id: <20240312075428.244210-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::434; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x434.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. 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). 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 | 130 ++++++++++++- plugins/qemu-plugins.symbols | 2 + 8 files changed, 635 insertions(+), 59 deletions(-)