From nobody Tue Nov 26 09:50:06 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=1709736501; cv=none; d=zohomail.com; s=zohoarc; b=D4HELNfeqwPXnIbrQw1502s3Tt5PWUQeagbSx0FxXMY7K7Iv2z+X1racVvHqV/lqTO7reh3DHry8zoQzhPBjupmey57x9GPtujYg1/1XZVs/BsA+j5Nc9ScyBZmbUrHBxdL76u6N9Wa1MAyyM1BN/Czu+mfncFd/iuhXxH/R7+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709736501; h=Content-Type: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=CqDhKj9Df0B4Sja/HzIC1euLpFVBt6pAPlBKW6M2zkc=; b=dIHiaTmUpIrrUo4LOvmJkYvEh2w5AF9S/WATDMeVfjd8v8y9ebaGq0g/9GiPL3Fy9AfLYGGSXopTHzGd4nnkYaBHcQ73dwa2x7WZuBEYQ7vZu6ni9WQULnhT/6bYEnEv3/mLq1RY8C3GmK7RYHoy/MzUf6z36R+2zfZGiq5sN3s= 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 1709736501653506.0350838525801; Wed, 6 Mar 2024 06:48:21 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IFkLq+AqT+M+PUMa0e8K1Zd+mFBOiYG+QtM7+4MIMJYG0L1rOI5bR2r68BEpuGd41qa4ac2GQ== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , 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 Content-Type: text/plain; charset="utf-8" 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::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709736503647100003 From: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Pierrick Bouvier Message-Id: <20240304130036.124418-13-pierrick.bouvier@linaro.org> Signed-off-by: Alex Benn=C3=A9e 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 { =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.39.2