From nobody Wed May 29 08:29:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1616009384; cv=none; d=zohomail.com; s=zohoarc; b=f/6mi+JChPe0cMQVZfXKgxd/fB+5hcqsQUUpJz8Oeontb69RWrB/W/SCPvDV02cGFSujdlWiMMQdZmQX3UiD1nnR28TAOcwVO82sRvSUo2NtlkKKh+azvbZy765C7c6WxRp6mPfBMMwvgxmxoQDkhIJmGGhUqj+zKZcwNpU/B6k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616009384; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xxZZ8Z9SsIU7VdGO3iSsl2kVjHmPi2TcIztXzkMIbLU=; b=dGbEs0uDe2EOrlnsuKuR6WI5MJ3iS7js1P9plT6h3sol0nlxMpf9Je+ZSOrpmzSSMFFsD3oNsXZWtxsZiw4/YI4bZ+AkzHjjtfsmlQucCJDdQSPs5LFu33Swu8xe6j/YAOT5SuEo0RwDzaizavADHRbr09rwqq9Yv2IyEe1v9Rc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161600938462754.50839281921094; Wed, 17 Mar 2021 12:29:44 -0700 (PDT) Received: from localhost ([::1]:56550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMbrT-0005fU-Fk for importer@patchew.org; Wed, 17 Mar 2021 15:29:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMbZv-00062L-Bl for qemu-devel@nongnu.org; Wed, 17 Mar 2021 15:11:35 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:43820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMbZt-00084j-JH for qemu-devel@nongnu.org; Wed, 17 Mar 2021 15:11:35 -0400 Received: by mail-pj1-x1036.google.com with SMTP id mz6-20020a17090b3786b02900c16cb41d63so1869080pjb.2 for ; Wed, 17 Mar 2021 12:11:32 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id i20sm19077870pgg.65.2021.03.17.12.11.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 12:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xxZZ8Z9SsIU7VdGO3iSsl2kVjHmPi2TcIztXzkMIbLU=; b=Ubw8Vq/h34OL0PXXhZ7+w5lZ8SUTxXp8w12c6frtAnJ7MO4+8+NTI4p2HN0xQ9xiOm /0FhhN6CI7JF+gOXXjKDM5iNc4F1B3wwg0AzJG0ZWAij0zRuVhW/yByjq041AbCLdCW/ e9x3B7SKOIEvqJ8F56xFX+kXcCkIS83/9nNzMDXwTaH71B0csYDgC3xIAPePMFuxFJGL 7/iLwD0Gq87Dbu2WyTVU7JDNK8ivL5Fn8NLl2+4TOaQk1hajjJSSWbZafBn5Ph0pYm2X xt6t2MLNg+6XcwaKiCuJ2JK/OxJeOb6vImZtNG7Ew638PNq9dm1Rf/cIq7TUdjRbaEH8 wCjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xxZZ8Z9SsIU7VdGO3iSsl2kVjHmPi2TcIztXzkMIbLU=; b=dUig1XZa07OM/pUomIUKBSZ/+qljNBnj0DGBENpA9TRfuza8WxZYH2bK5z0C56URhx 3MWKc7PJstS9I+aoAEnqYMMqRNWwklXDxhug8ON76ExV0mYoKv9a0cDpMMwvVdVRtFF3 h6PduVmPmM/eqwNmusL6lXli1COATA6ZNP9fMGsmcJEpoK3lyZ8GbMSV14swt0PaqYf7 P53c2S149Zw3HHQdHJGZbkTwDqmrdZ45oogMwfGtI08i47oBD+7UThc2KLockhvSChIc 3q5mnWldrZoMCjYqsCYcRuGg1JcGlvKGOYMgpdTB/qE58N17djHmjEtB8cIj+zfuBSQU ly4w== X-Gm-Message-State: AOAM532fSfuGPFSr+8S4hoVgG1n/Gqf+Ux4bwtFTNwwBIwzwJBq3xP6g Hb7Nzm8/m8mFkR1mvhbGldnjaELgpofUlw== X-Google-Smtp-Source: ABdhPJwV4CRLdDR8skXq6AD2w2ifLgrPlesHfYbv8O57wckwqBS07Imrirw5byXDltTe+oTRjjpokA== X-Received: by 2002:a17:902:d4cc:b029:e4:9cd9:f189 with SMTP id o12-20020a170902d4ccb02900e49cd9f189mr6014754plg.53.1616008290581; Wed, 17 Mar 2021 12:11:30 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH 1/2] plugins: Update qemu-plugins.symbols to match qemu-plugins.h Date: Wed, 17 Mar 2021 19:11:14 +0000 Message-Id: <20210317191115.1445-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.29.2.windows.3 In-Reply-To: <20210317191115.1445-1-luoyonggang@gmail.com> References: <20210317191115.1445-1-luoyonggang@gmail.com> 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=2607:f8b0:4864:20::1036; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1036.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, FREEMAIL_FROM=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yonggang Luo , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Reorder the function symbols that consistence with qemu-plugins.h Signed-off-by: Yonggang Luo --- plugins/qemu-plugins.symbols | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols index 4bdb381f48..a0ac1df62a 100644 --- a/plugins/qemu-plugins.symbols +++ b/plugins/qemu-plugins.symbols @@ -5,35 +5,34 @@ qemu_plugin_register_vcpu_exit_cb; qemu_plugin_register_vcpu_idle_cb; qemu_plugin_register_vcpu_resume_cb; - qemu_plugin_register_vcpu_insn_exec_cb; - qemu_plugin_register_vcpu_insn_exec_inline; - qemu_plugin_register_vcpu_mem_cb; - qemu_plugin_register_vcpu_mem_haddr_cb; - qemu_plugin_register_vcpu_mem_inline; - qemu_plugin_ram_addr_from_host; qemu_plugin_register_vcpu_tb_trans_cb; qemu_plugin_register_vcpu_tb_exec_cb; qemu_plugin_register_vcpu_tb_exec_inline; - qemu_plugin_register_flush_cb; - qemu_plugin_register_vcpu_syscall_cb; - qemu_plugin_register_vcpu_syscall_ret_cb; - qemu_plugin_register_atexit_cb; + qemu_plugin_register_vcpu_insn_exec_cb; + qemu_plugin_register_vcpu_insn_exec_inline; qemu_plugin_tb_n_insns; - qemu_plugin_tb_get_insn; qemu_plugin_tb_vaddr; + qemu_plugin_tb_get_insn; qemu_plugin_insn_data; qemu_plugin_insn_size; qemu_plugin_insn_vaddr; qemu_plugin_insn_haddr; - qemu_plugin_insn_disas; qemu_plugin_mem_size_shift; qemu_plugin_mem_is_sign_extended; qemu_plugin_mem_is_big_endian; qemu_plugin_mem_is_store; qemu_plugin_get_hwaddr; qemu_plugin_hwaddr_is_io; - qemu_plugin_hwaddr_to_raddr; + qemu_plugin_hwaddr_phys_addr; + qemu_plugin_hwaddr_device_name; + qemu_plugin_register_vcpu_mem_cb; + qemu_plugin_register_vcpu_mem_inline; + qemu_plugin_register_vcpu_syscall_cb; + qemu_plugin_register_vcpu_syscall_ret_cb; + qemu_plugin_insn_disas; qemu_plugin_vcpu_for_each; + qemu_plugin_register_flush_cb; + qemu_plugin_register_atexit_cb; qemu_plugin_n_vcpus; qemu_plugin_n_max_vcpus; qemu_plugin_outs; --=20 2.29.2.windows.3 From nobody Wed May 29 08:29:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1616008908; cv=none; d=zohomail.com; s=zohoarc; b=XSfdwrTs4Gfu+ujS1iRHb2jurNRSs/SWO0rBBGth0ko3RkFGwr7H9SNDULNS9uFZ/mKob8tr2LwtINgmCjRgyxWkN7Nkq3NlP1TtE1PJBkey4xOXOH8ha1BdiPBYDGPuLeRtYMQRpza0UAXT8gh6T0+Iq+rTScEMPbmIf5cSHm4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616008908; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3G9dJhhPVQ4RWufG4KKiXsuOdNnoDJci4dv2haWZIFM=; b=axECa/cgGS5uPFibIJGyHWk84+NUMZw8jmkxUIId6O9ITmkQnrnfjDvyS/2C83DnrX2R+1EQtXGm+SSWZqIYbkdaExNQNaPbkuR1TyG+MquiiOJXdCSpfSL+rAb94yK0KKwZNVJ99YV6mjOkZJkjgoJprlS4qjwYDaxKl9ncilE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616008908014533.6945607529333; Wed, 17 Mar 2021 12:21:48 -0700 (PDT) Received: from localhost ([::1]:35666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMbjm-0005RG-Tl for importer@patchew.org; Wed, 17 Mar 2021 15:21:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMbZx-00066J-EJ for qemu-devel@nongnu.org; Wed, 17 Mar 2021 15:11:37 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:41712) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMbZu-00084q-8X for qemu-devel@nongnu.org; Wed, 17 Mar 2021 15:11:37 -0400 Received: by mail-pj1-x1029.google.com with SMTP id nh23-20020a17090b3657b02900c0d5e235a8so1888097pjb.0 for ; Wed, 17 Mar 2021 12:11:33 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id i20sm19077870pgg.65.2021.03.17.12.11.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 12:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3G9dJhhPVQ4RWufG4KKiXsuOdNnoDJci4dv2haWZIFM=; b=jYDJruSmI9FXZDZHgXKbmxOBCw5h+oeohU1b1cdc/gdedq/R7aHdOmM/HCUY5qpGk2 kPL0MGix4EYsMBtD2O8WK/RjGfF7HIkmtJPYeyJCntP4XKmXhbdj8W2leteneG80RQGH ugTVq8z42ukaO+Z8EmISUc4fosohcVQLgSv+5X/V1vGP7RkeY9Dx9xtz7FsbNii48NtY ijNs4t2QekmjcIIwZAu9hdCuDEaUDvmQXiDYr37s86Herd+XR5UeS7lW22Rdqq88Bbwz bLMbHKULq4QaS2czttKjzTXwMysz+GgkFG3Hu1EX38m1I0UUngUwqj9UP5CT8PD4OEFs 4H7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3G9dJhhPVQ4RWufG4KKiXsuOdNnoDJci4dv2haWZIFM=; b=l0XSKCY9sHQe7G/JdY4+S11V5ZuVE05MJVsWMbblHc765VPn7Kkvbyv6rp0YFmgFVU yHAJQVNoPWTycoCg/GVc2DpDgeuaBWJX7bOZaRI+N1EFvr97O1cSTk1DXOR5J0zl6REb rPa98CXjz/jNi5DJQ4CK5bILR3hbk+If5yl7LF9H6bhyCJEVzHCf4zrqlkKt8i6Yq26X 0H8WtSSF9hAnlqEbho6ylgKnSCTYK3/Jg+sCv00I6YuuhooR3jslRY+1eIG+rF0I+7y5 t6aodJXp/bT9RWupSNpefGwufWqZJO3aPOVEmA7PU6N0QYlYtI0diMUYSUzhtUZOU6QG CHyg== X-Gm-Message-State: AOAM530wCbcd3bt1nqX4DJgLnW3XpTztgYRzk63UeAWUlRAEpjDwm1nR p0iztuYAQc/kN7F16napy7ufzUE0KrVB8A== X-Google-Smtp-Source: ABdhPJzmynju2JifUloUQePErLUnB0u4mkYE960oPLIHcWYKMG0OoLmajsMfZDFiUcxoAMFE8XEL/A== X-Received: by 2002:a17:902:8a97:b029:e6:aa6b:92f1 with SMTP id p23-20020a1709028a97b02900e6aa6b92f1mr6036059plo.64.1616008292343; Wed, 17 Mar 2021 12:11:32 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH 2/2] plugins: Move all typedef and type declaration to the front of the qemu-plugin.h Date: Wed, 17 Mar 2021 19:11:15 +0000 Message-Id: <20210317191115.1445-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.29.2.windows.3 In-Reply-To: <20210317191115.1445-1-luoyonggang@gmail.com> References: <20210317191115.1445-1-luoyonggang@gmail.com> 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=2607:f8b0:4864:20::1029; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1029.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, FREEMAIL_FROM=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yonggang Luo , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Yonggang Luo --- include/qemu/qemu-plugin.h | 187 ++++++++++++++++++------------------- 1 file changed, 92 insertions(+), 95 deletions(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 97cdfd7761..2cb17f3051 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -81,27 +81,6 @@ typedef struct qemu_info_t { }; } qemu_info_t; =20 -/** - * qemu_plugin_install() - Install a plugin - * @id: this plugin's opaque ID - * @info: a block describing some details about the guest - * @argc: number of arguments - * @argv: array of arguments (@argc elements) - * - * All plugins must export this symbol which is called when the plugin - * is first loaded. Calling qemu_plugin_uninstall() from this function - * is a bug. - * - * Note: @info is only live during the call. Copy any information we - * want to keep. @argv remains valid throughout the lifetime of the - * loaded plugin. - * - * Return: 0 on successful loading, !0 for an error. - */ -QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, - const qemu_info_t *info, - int argc, char **argv); - /** * typedef qemu_plugin_simple_cb_t - simple callback * @id: the unique qemu_plugin_id_t @@ -135,6 +114,98 @@ typedef void (*qemu_plugin_vcpu_simple_cb_t)(qemu_plug= in_id_t id, typedef void (*qemu_plugin_vcpu_udata_cb_t)(unsigned int vcpu_index, void *userdata); =20 +/** struct qemu_plugin_tb - Opaque handle for a translation block */ +struct qemu_plugin_tb; +/** struct qemu_plugin_insn - Opaque handle for a translated instruction */ +struct qemu_plugin_insn; + +/** + * enum qemu_plugin_cb_flags - type of callback + * + * @QEMU_PLUGIN_CB_NO_REGS: callback does not access the CPU's regs + * @QEMU_PLUGIN_CB_R_REGS: callback reads the CPU's regs + * @QEMU_PLUGIN_CB_RW_REGS: callback reads and writes the CPU's regs + * + * Note: currently unused, plugins cannot read or change system + * register state. + */ +enum qemu_plugin_cb_flags { + QEMU_PLUGIN_CB_NO_REGS, + QEMU_PLUGIN_CB_R_REGS, + QEMU_PLUGIN_CB_RW_REGS, +}; + +enum qemu_plugin_mem_rw { + QEMU_PLUGIN_MEM_R =3D 1, + QEMU_PLUGIN_MEM_W, + QEMU_PLUGIN_MEM_RW, +}; + +/** + * typedef qemu_plugin_vcpu_tb_trans_cb_t - translation callback + * @id: unique plugin id + * @tb: opaque handle used for querying and instrumenting a block. + */ +typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(qemu_plugin_id_t id, + struct qemu_plugin_tb *tb); + +/** + * enum qemu_plugin_op - describes an inline op + * + * @QEMU_PLUGIN_INLINE_ADD_U64: add an immediate value uint64_t + * + * Note: currently only a single inline op is supported. + */ + +enum qemu_plugin_op { + QEMU_PLUGIN_INLINE_ADD_U64, +}; + +/** + * typedef qemu_plugin_meminfo_t - opaque memory transaction handle + * + * This can be further queried using the qemu_plugin_mem_* query + * functions. + */ +typedef uint32_t qemu_plugin_meminfo_t; +/** struct qemu_plugin_hwaddr - opaque hw address handle */ +struct qemu_plugin_hwaddr; + +typedef void +(*qemu_plugin_vcpu_mem_cb_t)(unsigned int vcpu_index, + qemu_plugin_meminfo_t info, uint64_t vaddr, + void *userdata); + +typedef void +(*qemu_plugin_vcpu_syscall_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_in= dex, + int64_t num, uint64_t a1, uint64_t a2, + uint64_t a3, uint64_t a4, uint64_t a5, + uint64_t a6, uint64_t a7, uint64_t a8); +typedef void +(*qemu_plugin_vcpu_syscall_ret_cb_t)(qemu_plugin_id_t id, unsigned int vcp= u_idx, + int64_t num, int64_t ret); + +/** + * qemu_plugin_install() - Install a plugin + * @id: this plugin's opaque ID + * @info: a block describing some details about the guest + * @argc: number of arguments + * @argv: array of arguments (@argc elements) + * + * All plugins must export this symbol which is called when the plugin + * is first loaded. Calling qemu_plugin_uninstall() from this function + * is a bug. + * + * Note: @info is only live during the call. Copy any information we + * want to keep. @argv remains valid throughout the lifetime of the + * loaded plugin. + * + * Return: 0 on successful loading, !0 for an error. + */ +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv); + /** * qemu_plugin_uninstall() - Uninstall a plugin * @id: this plugin's opaque ID @@ -205,41 +276,6 @@ void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_= t id, void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); =20 -/** struct qemu_plugin_tb - Opaque handle for a translation block */ -struct qemu_plugin_tb; -/** struct qemu_plugin_insn - Opaque handle for a translated instruction */ -struct qemu_plugin_insn; - -/** - * enum qemu_plugin_cb_flags - type of callback - * - * @QEMU_PLUGIN_CB_NO_REGS: callback does not access the CPU's regs - * @QEMU_PLUGIN_CB_R_REGS: callback reads the CPU's regs - * @QEMU_PLUGIN_CB_RW_REGS: callback reads and writes the CPU's regs - * - * Note: currently unused, plugins cannot read or change system - * register state. - */ -enum qemu_plugin_cb_flags { - QEMU_PLUGIN_CB_NO_REGS, - QEMU_PLUGIN_CB_R_REGS, - QEMU_PLUGIN_CB_RW_REGS, -}; - -enum qemu_plugin_mem_rw { - QEMU_PLUGIN_MEM_R =3D 1, - QEMU_PLUGIN_MEM_W, - QEMU_PLUGIN_MEM_RW, -}; - -/** - * typedef qemu_plugin_vcpu_tb_trans_cb_t - translation callback - * @id: unique plugin id - * @tb: opaque handle used for querying and instrumenting a block. - */ -typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(qemu_plugin_id_t id, - struct qemu_plugin_tb *tb); - /** * qemu_plugin_register_vcpu_tb_trans_cb() - register a translate cb * @id: plugin ID @@ -269,18 +305,6 @@ void qemu_plugin_register_vcpu_tb_exec_cb(struct qemu_= plugin_tb *tb, enum qemu_plugin_cb_flags flags, void *userdata); =20 -/** - * enum qemu_plugin_op - describes an inline op - * - * @QEMU_PLUGIN_INLINE_ADD_U64: add an immediate value uint64_t - * - * Note: currently only a single inline op is supported. - */ - -enum qemu_plugin_op { - QEMU_PLUGIN_INLINE_ADD_U64, -}; - /** * qemu_plugin_register_vcpu_tb_exec_inline() - execution inline op * @tb: the opaque qemu_plugin_tb handle for the translation @@ -393,16 +417,6 @@ uint64_t qemu_plugin_insn_vaddr(const struct qemu_plug= in_insn *insn); */ void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn); =20 -/** - * typedef qemu_plugin_meminfo_t - opaque memory transaction handle - * - * This can be further queried using the qemu_plugin_mem_* query - * functions. - */ -typedef uint32_t qemu_plugin_meminfo_t; -/** struct qemu_plugin_hwaddr - opaque hw address handle */ -struct qemu_plugin_hwaddr; - /** * qemu_plugin_mem_size_shift() - get size of access * @info: opaque memory transaction handle @@ -480,11 +494,6 @@ uint64_t qemu_plugin_hwaddr_phys_addr(const struct qem= u_plugin_hwaddr *haddr); */ const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr= *h); =20 -typedef void -(*qemu_plugin_vcpu_mem_cb_t)(unsigned int vcpu_index, - qemu_plugin_meminfo_t info, uint64_t vaddr, - void *userdata); - void qemu_plugin_register_vcpu_mem_cb(struct qemu_plugin_insn *insn, qemu_plugin_vcpu_mem_cb_t cb, enum qemu_plugin_cb_flags flags, @@ -496,21 +505,9 @@ void qemu_plugin_register_vcpu_mem_inline(struct qemu_= plugin_insn *insn, enum qemu_plugin_op op, void *pt= r, uint64_t imm); =20 - - -typedef void -(*qemu_plugin_vcpu_syscall_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_in= dex, - int64_t num, uint64_t a1, uint64_t a2, - uint64_t a3, uint64_t a4, uint64_t a5, - uint64_t a6, uint64_t a7, uint64_t a8); - void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_syscall_cb_t cb= ); =20 -typedef void -(*qemu_plugin_vcpu_syscall_ret_cb_t)(qemu_plugin_id_t id, unsigned int vcp= u_idx, - int64_t num, int64_t ret); - void qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_syscall_ret_cb_t= cb); --=20 2.29.2.windows.3