From patchwork Wed Mar 6 14:40:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 778313 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:47:b0:33e:474f:8c56 with SMTP id k7csp327487wrx; Wed, 6 Mar 2024 06:48:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW0CIH3hXFljqQhliCQDwlMYGAOtmRO+9ULhDgjEQjCSdcTiAvEWprLwHCI7TCi47pUkg6vEQlVVcGRFE/Nm6gj X-Google-Smtp-Source: AGHT+IH0oCyDAebu9nsJ9Md6qcwzvkzR7KLrxcN4bBiF2QeHvlifW1QbjshIqNm0oQGYXtxm6Tvh X-Received: by 2002:a0c:e18f:0:b0:68f:cbfa:6876 with SMTP id p15-20020a0ce18f000000b0068fcbfa6876mr6040941qvl.38.1709736501199; Wed, 06 Mar 2024 06:48:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709736501; cv=none; d=google.com; s=arc-20160816; b=oAuakXflrQv4IsQgJELGvcf9HkupQugIymu4OJ6RV4A4994hKlOot9I+5Bsd3DO0p0 ILBIjCqt6s1Xo2ReH1oArXGDTKcxDiPJA7VJ8hF0Co9rBQuHj+jjTi9yBcoLZslxVYfs /vq/9xqzpNgbG+YqVlo7+txZscEeeZ1c+LwO+INMHiEOOQG1FVkJNarD8+IsEfIE9un9 h4GXW7/l30qwHgi74INf5mRmRvrdqtlRURdcbcQWnzpnIjrIGlP+Z4aWArFcW/0rur3Q VviY6ry9G2TDeHf5fGAdjJQAJKPW20SKIpoQ3LwGbYUz9HjIYvC68oz/MVjlQ+Hw3AKL SZYA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CqDhKj9Df0B4Sja/HzIC1euLpFVBt6pAPlBKW6M2zkc=; fh=OVYocnyG7mUUuZjZN0fXL99tAh6d6HUvqDMF3aaSrz0=; b=EFj7wonXjeMlCvkdZSVTa6hFLkm08zTjgiiD1VUrFzc8Ut0zUhtq9yjAtrNAp/1WoP mN5pimyFkC4KBFBzpTKyeH7DUUL3azChUaRN95IX32cEysf76B4iD4y/xi7fhXz6VhUd cra32nthlP6Fgrp2+PFhVx3bo9RNY+lrV2LrtxKYZcAmvVYYZD/d9J8ot56TXS6vDmCS elFJDf6U2HNO1D/fnzHTDYI3f4ekXuhXo2z9gF0hjm2WW61qaRj8i2jXkZSwGA9At1Az JixzahS2ONZo/VQP7u/VZiSFVYRnIrGyUxYtFCFLf8wc5vvIYiw3DPef7+3fj3sT3Fad 44NA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hJu9GrDu; 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 g7-20020a0562140ac700b0068fe8212b87si15759333qvi.563.2024.03.06.06.48.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Mar 2024 06:48:21 -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=hJu9GrDu; 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 1rhsSI-0008Lc-LF; Wed, 06 Mar 2024 09:41:14 -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 1rhsSB-0007t0-G8 for qemu-devel@nongnu.org; Wed, 06 Mar 2024 09:41:08 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhsS6-0001Vu-9z for qemu-devel@nongnu.org; Wed, 06 Mar 2024 09:41:07 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-33d6f26ff33so767610f8f.0 for ; Wed, 06 Mar 2024 06:41:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709736059; x=1710340859; 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=CqDhKj9Df0B4Sja/HzIC1euLpFVBt6pAPlBKW6M2zkc=; b=hJu9GrDuHq2jnkNxhqdGl8eEbUJ6Z7Zxs3Uzk0/GGXVOpwy+A7dyESlruH8H5yGpbz KaceDbjNt1ETN6a8e08iYYkqs8WS1asnmBmmCQbLRaodPi6HgMYH3UwjOAaJom1uaWoi PnXif2/D8qs93yW3cgDVmUkEIIn3NoqPq9Cmui4ZybjWPeFPAYKcZDWbGeaejPkknZi1 KlsaB3koqqB4TQnaNLrVpTuYJ5oa0FyDROtrJyjbX8MqYjZeHN2VBHo51kX78Hxy9BIM RgRSbQkzN4Mlg7QtEv4Kuh59opDfhHVvMdoiEtn32r1xEGut+/8BOqH4bpDaz+nWGVxd OH/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709736059; x=1710340859; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CqDhKj9Df0B4Sja/HzIC1euLpFVBt6pAPlBKW6M2zkc=; b=xAXo91PwtVWuqNuwdT7k/EVfLWnNubPwHcidFMeqZa9rHXdq6IuzOkf17dES72wgd9 JTTiVlVRSg8SmjhIEiRHnABGNo6vmFlvN1u/hwNNgIbFHa2qrFzrSVPMOWbTZEtZhHsP xtg6ui8K+VCxyMv195UXadgaGVfA7tvhiD6zdoqt8BDc/eX8xkRzoLDJgX2fsi3vP0W9 Hct5gWxQjWtvftIE6vBUMrUaGfYqT8Ry46JhTqbiS2qu1fgMTSSpDfYY8RWX2Im1Z/dA MFNi4twPARA/J6atyz+v+GBBiYbIcp1alN6tfRnYQMZ4VbcmgheXr5ncQQNjLQVFuvIC +kRg== X-Gm-Message-State: AOJu0Yw0HKgJIKgUIRHsnX6D+zpxZMcSD8HQ+TB08L3JXIW4u+NJGSeK OPRwoUJp18d6MP5zTEtIhUiiZTyMXOkuV05O00osNuCiBKuOAvaLCqkZIRBOkBM= X-Received: by 2002:adf:e385:0:b0:33e:4b3c:787b with SMTP id e5-20020adfe385000000b0033e4b3c787bmr3312819wrm.26.1709736059104; Wed, 06 Mar 2024 06:40:59 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id u20-20020adfcb14000000b0033b7ce8b496sm17645566wrh.108.2024.03.06.06.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 06:40:56 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D0A385F9ED; Wed, 6 Mar 2024 14:40:43 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Paolo Bonzini , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 25/29] plugins: cleanup codepath for previous inline operation Date: Wed, 6 Mar 2024 14:40:37 +0000 Message-Id: <20240306144041.3787188-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240306144041.3787188-1-alex.bennee@linaro.org> References: <20240306144041.3787188-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.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 From: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Pierrick Bouvier Message-Id: <20240304130036.124418-13-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240305121005.3528075-26-alex.bennee@linaro.org> diff --git a/plugins/plugin.h b/plugins/plugin.h index f6fa10a0f56..7c34f23cfcb 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -68,11 +68,6 @@ struct qemu_plugin_ctx { struct qemu_plugin_ctx *plugin_id_to_ctx_locked(qemu_plugin_id_t id); -void plugin_register_inline_op(GArray **arr, - enum qemu_plugin_mem_rw rw, - enum qemu_plugin_op op, void *ptr, - uint64_t imm); - void plugin_register_inline_op_on_entry(GArray **arr, enum qemu_plugin_mem_rw rw, enum qemu_plugin_op op, diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 47e05ec6347..8028786c7bb 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -440,15 +440,10 @@ static TCGOp *append_inline_cb(const struct qemu_plugin_dyn_cb *cb, TCGOp *begin_op, TCGOp *op, int *unused) { - char *ptr = cb->userp; - size_t elem_size = 0; - size_t offset = 0; - if (!ptr) { - /* use inline entry */ - ptr = cb->inline_insn.entry.score->data->data; - elem_size = g_array_get_element_size(cb->inline_insn.entry.score->data); - offset = cb->inline_insn.entry.offset; - } + char *ptr = cb->inline_insn.entry.score->data->data; + size_t elem_size = g_array_get_element_size( + cb->inline_insn.entry.score->data); + size_t offset = cb->inline_insn.entry.offset; op = copy_ld_i32(&begin_op, op); op = copy_mul_i32(&begin_op, op, elem_size); diff --git a/plugins/core.c b/plugins/core.c index 7852590da88..11ca20e6267 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -316,22 +316,6 @@ static struct qemu_plugin_dyn_cb *plugin_get_dyn_cb(GArray **arr) return &g_array_index(cbs, struct qemu_plugin_dyn_cb, cbs->len - 1); } -void plugin_register_inline_op(GArray **arr, - enum qemu_plugin_mem_rw rw, - enum qemu_plugin_op op, - void *ptr, - uint64_t imm) -{ - struct qemu_plugin_dyn_cb *dyn_cb; - - dyn_cb = plugin_get_dyn_cb(arr); - dyn_cb->userp = ptr; - dyn_cb->type = PLUGIN_CB_INLINE; - dyn_cb->rw = rw; - dyn_cb->inline_insn.op = op; - dyn_cb->inline_insn.imm = imm; -} - void plugin_register_inline_op_on_entry(GArray **arr, enum qemu_plugin_mem_rw rw, enum qemu_plugin_op op, @@ -494,15 +478,10 @@ void qemu_plugin_flush_cb(void) void exec_inline_op(struct qemu_plugin_dyn_cb *cb, int cpu_index) { - char *ptr = cb->userp; - size_t elem_size = 0; - size_t offset = 0; - if (!ptr) { - /* use inline entry */ - ptr = cb->inline_insn.entry.score->data->data; - elem_size = g_array_get_element_size(cb->inline_insn.entry.score->data); - offset = cb->inline_insn.entry.offset; - } + char *ptr = cb->inline_insn.entry.score->data->data; + size_t elem_size = g_array_get_element_size( + cb->inline_insn.entry.score->data); + size_t offset = cb->inline_insn.entry.offset; uint64_t *val = (uint64_t *)(ptr + offset + cpu_index * elem_size); switch (cb->inline_insn.op) {