From patchwork Wed May 15 20:23:34 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: 797002 Delivered-To: patch@linaro.org Received: by 2002:a5d:452e:0:b0:34e:ceec:bfcd with SMTP id j14csp3164281wra; Wed, 15 May 2024 13:25:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU6A0h0nkwksUMVW6g8RMsaRQStX3iDrh+HML8dCdiC2VwbUZVG6QdvPHcaqUIcKlI7JyyC0oqPdm6LZJTcP6ga X-Google-Smtp-Source: AGHT+IEliKTY3qOBwT7+XlToni/xc3JHt+7s0Fb77QEOEtolkENly3yCNvNk8tO2G6ecSeYeLc+D X-Received: by 2002:a05:620a:2205:b0:792:c14e:d1cd with SMTP id af79cd13be357-792c75775cemr1729439785a.15.1715804725386; Wed, 15 May 2024 13:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715804725; cv=none; d=google.com; s=arc-20160816; b=KZ2syIVvcCsy3w3EWqtV3+EIhcPrGMmvTfZaCIdZdKCIzZwMceGxtbCDIXliSXemuT FqgVwBpNm6P7lzNu2C8jaTC6tnYpzVf5+W47feeq5PXqAX/EAEKArdPH/Y3bHmQ1Nqkm rK0nkxS97mkaTd+VScaJmqCDyh5ddD8luCyDldcCE3tPK/ytY03hGtrmPlDc+pbM1qi5 SCDoRpoGfiup/d5p4nXYoyef3jKZKcFcoBrd7KPDrbQc1LFi2zgf7pi6h3zCSCfeum8X 8De++ykEmDpRxEZMdXrQTEGrDJwGPHhNUTVfUzzSmEZMImzNAesSlBp7qnvGsfssJ5bD IfkA== 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=8l+Ilv7VeF5QKcYGINL5nyqXVwuf6cAItY3C7pcDDws=; fh=ahP8Qp0dn4zGVUGmV4kNOqRf/7GS2jpWEgP4Mrekis4=; b=LVuGDyEGf/ovXyGd6+X8TE27ajz+69IdzkNeM7BufLOBPLQU2gjmBjniCIisyuMSZx 8c9PomlmU8KZAHgF2G/aq/dhJUPI/hREuHFVMNBk/XA4ficYNwuEmezsPMEbHxS1kgyr rPnP3b3yVEZg2S+Hzwf/fHaKdadDqN4LbVct3g4iMsFbQPO+Ajt1D7j/qRSLyOn9vQ4m 3iyyyOM5e0t6rY6/gA3iuPECU0b25aA5wEIPI8vDUsZlUfY1Y1kwTksom+3iyaPodk6v G6yCWryz+MrMisnPuoRe2TvEti+UxZDZjqddjf5+GNYXFJfzuw/Ksc9Di9CKMK+dghYM CsKw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="steeKQp/"; 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 af79cd13be357-792bf3382b6si1453959985a.407.2024.05.15.13.25.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2024 13:25:25 -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="steeKQp/"; 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 1s7LAE-00018i-N3; Wed, 15 May 2024 16:23:50 -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 1s7LA9-00013a-M2 for qemu-devel@nongnu.org; Wed, 15 May 2024 16:23:45 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7LA7-0004G5-UE for qemu-devel@nongnu.org; Wed, 15 May 2024 16:23:45 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-572e48f91e9so2509827a12.0 for ; Wed, 15 May 2024 13:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715804622; x=1716409422; 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=8l+Ilv7VeF5QKcYGINL5nyqXVwuf6cAItY3C7pcDDws=; b=steeKQp/CCMOGhq6nLyft1ja6a6ZcRt1WPXBhamG6OgzNqGa2xROzr6UaBO49X3WTF IU6oTo7/j/nPDQ1H33zVcqiGo/+LJ5dmlCIxGgxP1XEnkNnE0rV5vneuQjOCZbd17HvW TJ7KaH2RhhbSf3604eeEz7azZfR2ZKgL/cwGfhtThT1B9qafndVeLuBo4+0U5bOgarBB 4fQBuH64jGZFSqPsgvuZHqy1J8za+iF+Qll3J2RAsXap3mqhQx8EP3OlHk3yRVzA4uzN ZiROYXDUBMJ6z6W85driB37h1tbe3vjA+UbdIjeCNd8jH00PIgJWW7TiIDIv+X1qstb1 MR5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715804622; x=1716409422; 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=8l+Ilv7VeF5QKcYGINL5nyqXVwuf6cAItY3C7pcDDws=; b=Ls/XcL+odStm8LNmuvgDwAp8C0fjgXERYWTAddf0zsDXMahGvATGSUj1DV0yBgdOjh DC3RxmnHz0fEFI7i2UINT5LqTI6wzhUNfdvzjDr9D2Yao/kGWgaye7AoIOOrBU3j4Rd/ OpmqtAXPJwlxfgFEvwsLXXZWtzra0euz4BQApapmdRjYtxzZN+WyNFumB/E8h8asZeFt wVWwunISD3MeS51iXsuHZcG+UjsVz2MFTznRC7/+GEfeHdSMN8QZI8y6I2tLdAL5S0X6 exRL039OcDSEZmtpuSRUUYq86LX5q9SCx2/vHgwEeR+VtCne/2qQgkn1gGiZeO8B9BED Il9A== X-Gm-Message-State: AOJu0YzTtpKCn+eO1XMu3mGNhUgftkJvwOjA/9R6/ouWmHrXx3jkOzQ3 0fkopb6ZL9fW4AORDxEY/3DakHbLw3mop/VtZOYm21/jhQoQe4meztF4aSHkUnM= X-Received: by 2002:a17:906:3618:b0:a59:9c14:a774 with SMTP id a640c23a62f3a-a5a2d680d90mr1119373766b.74.1715804622457; Wed, 15 May 2024 13:23:42 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17892450sm904940366b.63.2024.05.15.13.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 13:23:40 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id BC65B5FA2D; Wed, 15 May 2024 21:23:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , "Michael S . Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 11/11] plugins: remove op from qemu_plugin_inline_cb Date: Wed, 15 May 2024 21:23:34 +0100 Message-Id: <20240515202334.710324-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240515202334.710324-1-alex.bennee@linaro.org> References: <20240515202334.710324-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.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 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 This field is not needed as the callback type already holds this information. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20240502211522.346467-10-pierrick.bouvier@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Alex Bennée Message-Id: <20240514174253.694591-12-alex.bennee@linaro.org> diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index 98d27dded9..796fc13706 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -83,7 +83,6 @@ struct qemu_plugin_regular_cb { struct qemu_plugin_inline_cb { qemu_plugin_u64 entry; - enum qemu_plugin_op op; uint64_t imm; enum qemu_plugin_mem_rw rw; }; diff --git a/plugins/plugin.h b/plugins/plugin.h index 80d5daa917..30e2299a54 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -108,7 +108,9 @@ void plugin_register_vcpu_mem_cb(GArray **arr, enum qemu_plugin_mem_rw rw, void *udata); -void exec_inline_op(struct qemu_plugin_inline_cb *cb, int cpu_index); +void exec_inline_op(enum plugin_dyn_cb_type type, + struct qemu_plugin_inline_cb *cb, + int cpu_index); int plugin_num_vcpus(void); diff --git a/plugins/core.c b/plugins/core.c index 1c85edc5e5..0726bc7f25 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -338,7 +338,6 @@ void plugin_register_inline_op_on_entry(GArray **arr, struct qemu_plugin_inline_cb inline_cb = { .rw = rw, .entry = entry, - .op = op, .imm = imm }; dyn_cb = plugin_get_dyn_cb(arr); dyn_cb->type = op_to_cb_type(op); @@ -557,7 +556,9 @@ void qemu_plugin_flush_cb(void) plugin_cb__simple(QEMU_PLUGIN_EV_FLUSH); } -void exec_inline_op(struct qemu_plugin_inline_cb *cb, int cpu_index) +void exec_inline_op(enum plugin_dyn_cb_type type, + struct qemu_plugin_inline_cb *cb, + int cpu_index) { char *ptr = cb->entry.score->data->data; size_t elem_size = g_array_get_element_size( @@ -565,11 +566,11 @@ void exec_inline_op(struct qemu_plugin_inline_cb *cb, int cpu_index) size_t offset = cb->entry.offset; uint64_t *val = (uint64_t *)(ptr + offset + cpu_index * elem_size); - switch (cb->op) { - case QEMU_PLUGIN_INLINE_ADD_U64: + switch (type) { + case PLUGIN_CB_INLINE_ADD_U64: *val += cb->imm; break; - case QEMU_PLUGIN_INLINE_STORE_U64: + case PLUGIN_CB_INLINE_STORE_U64: *val = cb->imm; break; default: @@ -601,7 +602,7 @@ void qemu_plugin_vcpu_mem_cb(CPUState *cpu, uint64_t vaddr, case PLUGIN_CB_INLINE_ADD_U64: case PLUGIN_CB_INLINE_STORE_U64: if (rw && cb->inline_insn.rw) { - exec_inline_op(&cb->inline_insn, cpu->cpu_index); + exec_inline_op(cb->type, &cb->inline_insn, cpu->cpu_index); } break; default: