From nobody Tue Nov 26 09:26:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709184376; cv=none; d=zohomail.com; s=zohoarc; b=kHBUNw202rdNnEELn6Ik+d/Ph4Bz6aFDCztgDqaiJZVNO9x+oShgyb6gkmF/0Moo8KhzklNbDqIvgKUcbaYr8tGoknqrKrHsJLSQtxiaxKUiMYj6ZeQxVsgOyt/YTjp0EpSFhhBVVRar4hnx+uc/I0cKLjZkSTW0LQC2CPL/xb4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709184376; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wPVNOJfP9AetgNRAiGgypd7Btd6VXu2RDR6kPX3cnbY=; b=ho6+jEIL9MF41qJgTKiS7+b4GH3HWqNqyaPrGIC+LJWHKF5s+tdt23JphVYqrtG/avcGV6uNNFTnM1iJWGvU9OCwG+2qOsYLigfUv5NTRMscqdlNf8mS9kYYCTEWN1ZbZoNN/0BdeGzfw3qkZR6w4UZG7SFrP2cZQNseEe5KdFY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709184376816689.1623974941805; Wed, 28 Feb 2024 21:26:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfYvk-0002z9-LV; Thu, 29 Feb 2024 00:26:04 -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 1rfYvj-0002yo-IL for qemu-devel@nongnu.org; Thu, 29 Feb 2024 00:26:03 -0500 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 1rfYvh-00061l-Sg for qemu-devel@nongnu.org; Thu, 29 Feb 2024 00:26:03 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-33dc3fe739aso938403f8f.0 for ; Wed, 28 Feb 2024 21:26:01 -0800 (PST) Received: from linaro.. ([102.35.208.160]) by smtp.gmail.com with ESMTPSA id e14-20020adffc4e000000b0033dfa7ecd33sm660241wrs.61.2024.02.28.21.25.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 21:25:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709184360; x=1709789160; 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=wPVNOJfP9AetgNRAiGgypd7Btd6VXu2RDR6kPX3cnbY=; b=lbJLKAG4fKyrq5lOFdbIC0KqmaSYbuc4TkqDb/jJYljrBUbyNFKG50+WjD0SnoHePr QFK/CuloX4kSYpY+hvfCqmttyozLpViiTDMieU+DVU/dD6IXOg14az9qKMTjugys0S0o LRNgD+ZYyQuatQFESo+tjG1OCKkHu8ziBgUKmJ14X7KaCtzAKUDXy1y1T8WBsDO4AvTV LSfYete6JSrWE6ORoRMEB/02ZbIfT7+HVrfjKX2FJy2GqI84K7rNgRaDQwU95D/g4ds5 ZusCuwO8sW1n4ICNvBEBxTbrY28pQ8VGjUk6IpwOZ3mJkDpZ1O9YhkR54Tz7naKKyKit M7Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709184360; x=1709789160; 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=wPVNOJfP9AetgNRAiGgypd7Btd6VXu2RDR6kPX3cnbY=; b=MprtoumSJRdShCyDvrnoxm6oNVOqW0EJhjaTTkxZnF1aJXusZh6Jv4Z+d/ADcb222B Ra3Wrd3nm1zeAXJyEQV2a4a2RogX27LK2r8aBHhRXDigByH++1AWrl/Or822STZHwxMV cbr4iYVSvCtdScf5JKgEIRBlv5klArBUQcRCmwbxH0XcscTYAnYH1XlsSe6zXxm/T6ib r0D56Dkf1p4WfuBS22knQgm2NHTStfyFbtX0cL+EM8WJ68fkZYeSjeE2ZFfIloKnWbR8 WbS9z75qkAlpQjLPLq+YHqDrKasr5Uy+m0ysfXEOX+xdMOpmpc5aZqS/4kX2viHyZI8I 1+0Q== X-Gm-Message-State: AOJu0Ywyte+gembh2vQKl7YvN3AxgUxrF/YsMuqkyeZdjh6jnpdSb3jS LIp3wM+Mk0f5PBYSDo527QZW9u9GWPh00WbsEI0vzB9x2/thLBIwMhf4yJBEz9zNHdmh1fQIvY6 QXeo= X-Google-Smtp-Source: AGHT+IFDxjqa/QIONM8xZInv+rM8hwSqNVAvDCULvwymMGZWUcLAU/qvdQF3RSaSteACsJqTipGLrw== X-Received: by 2002:adf:8b5a:0:b0:33d:119e:2ca1 with SMTP id v26-20020adf8b5a000000b0033d119e2ca1mr630694wra.5.1709184359774; Wed, 28 Feb 2024 21:25:59 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Mahmoud Mandour , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Pierrick Bouvier , Richard Henderson , Marcel Apfelbaum , Paolo Bonzini , Alexandre Iooss Subject: [PATCH v6 12/12] plugins: cleanup codepath for previous inline operation Date: Thu, 29 Feb 2024 09:25:06 +0400 Message-ID: <20240229052506.933222-13-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240229052506.933222-1-pierrick.bouvier@linaro.org> References: <20240229052506.933222-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709184378628100007 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- plugins/plugin.h | 5 ----- accel/tcg/plugin-gen.c | 13 ++++--------- plugins/core.c | 29 ++++------------------------- 3 files changed, 8 insertions(+), 39 deletions(-) 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 { =20 struct qemu_plugin_ctx *plugin_id_to_ctx_locked(qemu_plugin_id_t id); =20 -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_plug= in_dyn_cb *cb, TCGOp *begin_op, TCGOp *op, int *unused) { - char *ptr =3D cb->userp; - size_t elem_size =3D 0; - size_t offset =3D 0; - if (!ptr) { - /* use inline entry */ - ptr =3D cb->inline_insn.entry.score->data->data; - elem_size =3D g_array_get_element_size(cb->inline_insn.entry.score= ->data); - offset =3D cb->inline_insn.entry.offset; - } + char *ptr =3D cb->inline_insn.entry.score->data->data; + size_t elem_size =3D g_array_get_element_size( + cb->inline_insn.entry.score->data); + size_t offset =3D cb->inline_insn.entry.offset; =20 op =3D copy_ld_i32(&begin_op, op); op =3D 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(GA= rray **arr) return &g_array_index(cbs, struct qemu_plugin_dyn_cb, cbs->len - 1); } =20 -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 =3D plugin_get_dyn_cb(arr); - dyn_cb->userp =3D ptr; - dyn_cb->type =3D PLUGIN_CB_INLINE; - dyn_cb->rw =3D rw; - dyn_cb->inline_insn.op =3D op; - dyn_cb->inline_insn.imm =3D 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) =20 void exec_inline_op(struct qemu_plugin_dyn_cb *cb, int cpu_index) { - char *ptr =3D cb->userp; - size_t elem_size =3D 0; - size_t offset =3D 0; - if (!ptr) { - /* use inline entry */ - ptr =3D cb->inline_insn.entry.score->data->data; - elem_size =3D g_array_get_element_size(cb->inline_insn.entry.score= ->data); - offset =3D cb->inline_insn.entry.offset; - } + char *ptr =3D cb->inline_insn.entry.score->data->data; + size_t elem_size =3D g_array_get_element_size( + cb->inline_insn.entry.score->data); + size_t offset =3D cb->inline_insn.entry.offset; uint64_t *val =3D (uint64_t *)(ptr + offset + cpu_index * elem_size); =20 switch (cb->inline_insn.op) { --=20 2.43.0