From patchwork Wed Apr 24 23:30:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 791582 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1106011wrq; Wed, 24 Apr 2024 16:32:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWCoWRA6kCW+Omzt3IGrY+w0tPmNrlllVf5sGT3gAUicpGNMyqhQvE4oCamOxemKVFJGVfEKCySR2w7YWKxefmL X-Google-Smtp-Source: AGHT+IEe7ZzgxmSMtBcIht6sT7Nz0NIT6aGlhkUopn6QbbwI+eEuN3t6/ULQFqdl9Hja85J3cNdN X-Received: by 2002:a05:690c:f12:b0:61a:b548:93a8 with SMTP id dc18-20020a05690c0f1200b0061ab54893a8mr4613900ywb.1.1714001536110; Wed, 24 Apr 2024 16:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714001536; cv=none; d=google.com; s=arc-20160816; b=oASiELoVnCRDzsvuhChy6LfjMoLAregIj+oDRZICBCOMUISu90hiDKIN3NlAEWJP36 scLmTPi9J8blIXKthQM1i+8GRxYsEKBC1pQ3kpJCFqs9tMQ5oxWK+iYXnhijaq/1Elvj SgrC2GUTg154Yf08NW65/0nRjnIh+oFZojZhEtxDbgR6UvQe479LaQWDqut9fAMX5+Gh +jwcVjp0sYgYvus3ZSOcsanHb2jKqjXgkifV2aGPPjmUvsnbYsGx5YF3ytcQITkDIx+d YECFRjJ1+kYKB/FczMcglLGf2NZT/MpjV4tdpFgjXudAhg/rUPO7auSNMlJgVclETg1i u07w== 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:message-id:date:subject:to:from:dkim-signature; bh=wMGnRSLzMfjPcAWv+gJ2QDXKCclkbKeAZ+VbEIoyrQE=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=h1KHPS+vsaKkcOmKWpVxubF2us8XH1trIi+6WNdU7m6T90/U78e4bNuFoh8awy47Y8 5t0TSBwoLB4wDsPl9QQ6+G1cY6kxzeFV3varQGclyZXu3T8q6DHMgZNeH7B27EGttGrG ZFMmR9Y2RnEVh5zghByUdaDJvDVtIB8qfvkVMuT3JTzyeG4jbUA0tQS9ZpBr9uN9Yxz7 pKkEzE0YDfv9MhZdOyg70Kjky3ivTfVqWh7emGGEFZ6xTPqpqpqPcDQnkhy7kLFkK1g6 ppDPs4kURqsJgafSW7aQVFvICI+2n3kqE+1u7avs5eOlNzhqsIghNrCnvAe23M1KUrF8 S/rw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="xUi/nIQv"; 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 cc23-20020a05622a411700b0043a1a757722si2950289qtb.381.2024.04.24.16.32.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 16:32:16 -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="xUi/nIQv"; 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 1rzm5V-0005lZ-Ti; Wed, 24 Apr 2024 19:31:42 -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 1rzm5Q-0005iP-PH for qemu-devel@nongnu.org; Wed, 24 Apr 2024 19:31:38 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzm5O-0003Ma-RY for qemu-devel@nongnu.org; Wed, 24 Apr 2024 19:31:36 -0400 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-2abf9305afcso346688a91.1 for ; Wed, 24 Apr 2024 16:31:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714001493; x=1714606293; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=wMGnRSLzMfjPcAWv+gJ2QDXKCclkbKeAZ+VbEIoyrQE=; b=xUi/nIQvn8MkDY6Nu3QxP2CCumO3PSoLJPXuxZYYMeF0i5xGc5rnaz2xh3MTv8e9vZ MTg0sgpCQ8yqrNoQJz673mlDtNlkeVGMC/Vcz/1jNHkl6ic9cDzMmj9pmZ7dh6ua8yHo LBYREg7nDpjM4bFf78/Oyg9T/liORKJP480ZhNvQaSxhgNU87aexQznLgaIt3utBvOWl dWpQrOqDlaybGz1hZ5ppypTS4e15VC60nVDOEa4FX40CZf+PApLkGhy/kd9gToDQZ2jt WwLtvZlIJX2AzDxi4kNB8Hk/mesXKIQRW6C7A4y3LDV+n5vtIBngALv6nxiByYIZ+CEu QpOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714001493; x=1714606293; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wMGnRSLzMfjPcAWv+gJ2QDXKCclkbKeAZ+VbEIoyrQE=; b=syH3gxqHkVaXMMGbccHX6ux2EiCjS0QWKKPPT+dlyUCGxdh5IPaquwarM2bJWVZinM FZ+rvl8n8kxXmHDsw4XaX0UO69tR5hEPmPAUDshtqBayhJ8Hh+wvd+kpaZ0bkKoeszom PgO5fKayzXIJOCPN/MHwbgO1fg9gJ+08LdEZwR/p5H5QXZ2CWSRHOjf6N1ddO5bRnZGx ts52s9yzRhzDC9qOXQm8Up5Qj7BpFWZT6ySVfhnZdGmzzC9kq2tCTptOQUYphZaecZsH FCjENIpZBo3IRhblUM6vurUtEa4rFK5OGk4LTn+3a3xtVCCvirddn5Pl+jYLWVBNZny1 c2Qw== X-Gm-Message-State: AOJu0Yy8+4Luo3BHPsaIrqh1yDC5WH+yTVGUcQcH8raGafc2w87IYpha xcHXxKWoORj8rb7AI3AEvlJccHJYQsTsL0LsH5t6c5z/3LSwwUClSo1FmP6vTM8fzoKFMdKa7yO + X-Received: by 2002:a17:90a:7142:b0:2a5:d313:4d3f with SMTP id g2-20020a17090a714200b002a5d3134d3fmr4405103pjs.34.1714001493152; Wed, 24 Apr 2024 16:31:33 -0700 (PDT) Received: from stoup.. ([156.19.246.23]) by smtp.gmail.com with ESMTPSA id z24-20020a17090abd9800b002a56b3931dfsm11737859pjr.49.2024.04.24.16.31.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 16:31:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 00/33] accel/tcg: Improve disassembly for target and plugin Date: Wed, 24 Apr 2024 16:30:58 -0700 Message-Id: <20240424233131.988727-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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 Based-on: 20240424230224.941028-1-richard.henderson@linaro.org ("[PATCH v3 00/20] Rewrite plugin code generation") Rebase only. Reviews required for: 04-accel-tcg-Reorg-translator_ld.patch 06-accel-tcg-Record-mmio-bytes-during-translation.patch 07-accel-tcg-Record-when-translator_fake_ldb-is-used.patch 08-accel-tcg-Record-DisasContextBase-in-tcg_ctx-for-.patch 09-plugins-Copy-memory-in-qemu_plugin_insn_data.patch 10-accel-tcg-Implement-translator_st.patch 11-plugins-Use-translator_st-for-qemu_plugin_insn_da.patch 12-plugins-Read-mem_only-directly-from-TB-cflags.patch 13-plugins-Use-DisasContextBase-for-qemu_plugin_insn.patch 15-plugins-Merge-alloc_tcg_plugin_context-into-plugi.patch 18-disas-Split-disas.c.patch 19-disas-Use-translator_st-to-get-disassembly-data.patch 21-target-s390x-Fix-translator_fake_ld-length.patch 22-target-s390x-Disassemble-EXECUTEd-instructions.patch 23-target-hexagon-Use-translator_ldl-in-pkt_crosses_.patch 29-target-riscv-Use-translator_ld-for-everything.patch 32-target-s390x-Use-translator_lduw-in-get_next_pc.patch r~ Philippe Mathieu-Daudé (1): accel/tcg: Remove cpu_ldsb_code / cpu_ldsw_code Richard Henderson (32): accel/tcg: Use vaddr in translator_ld* accel/tcg: Hide in_same_page outside of a target-specific context accel/tcg: Pass DisasContextBase to translator_fake_ldb accel/tcg: Reorg translator_ld* accel/tcg: Cap the translation block when we encounter mmio accel/tcg: Record mmio bytes during translation accel/tcg: Record when translator_fake_ldb is used accel/tcg: Record DisasContextBase in tcg_ctx for plugins plugins: Copy memory in qemu_plugin_insn_data accel/tcg: Implement translator_st plugins: Use translator_st for qemu_plugin_insn_data plugins: Read mem_only directly from TB cflags plugins: Use DisasContextBase for qemu_plugin_insn_haddr plugins: Use DisasContextBase for qemu_plugin_tb_vaddr plugins: Merge alloc_tcg_plugin_context into plugin_gen_tb_start accel/tcg: Provide default implementation of disas_log accel/tcg: Return bool from TranslatorOps.disas_log disas: Split disas.c disas: Use translator_st to get disassembly data accel/tcg: Introduce translator_fake_ld target/s390x: Fix translator_fake_ld length target/s390x: Disassemble EXECUTEd instructions target/hexagon: Use translator_ldl in pkt_crosses_page target/microblaze: Use translator_ldl target/i386: Use translator_ldub for everything target/avr: Use translator_lduw target/cris: Use translator_ld* in cris_fetch target/cris: Use cris_fetch in translate_v10.c.inc target/riscv: Use translator_ld* for everything target/rx: Use translator_ld* target/xtensa: Use translator_ldub in xtensa_insn_len target/s390x: Use translator_lduw in get_next_pc disas/disas-internal.h | 4 + include/disas/disas.h | 9 +- include/exec/cpu_ldst.h | 10 - include/exec/plugin-gen.h | 7 +- include/exec/translator.h | 71 +++++-- include/qemu/plugin.h | 22 +- include/qemu/qemu-plugin.h | 15 +- include/qemu/typedefs.h | 1 + include/tcg/tcg.h | 1 + accel/tcg/plugin-gen.c | 63 +++--- accel/tcg/translator.c | 331 +++++++++++++++++++----------- contrib/plugins/execlog.c | 5 +- contrib/plugins/howvec.c | 4 +- disas/disas-common.c | 103 ++++++++++ disas/disas-host.c | 129 ++++++++++++ disas/disas-mon.c | 15 ++ disas/disas-target.c | 99 +++++++++ disas/disas.c | 337 ------------------------------- disas/objdump.c | 37 ++++ plugins/api.c | 57 ++++-- target/alpha/translate.c | 9 - target/arm/tcg/translate-a64.c | 11 - target/arm/tcg/translate.c | 12 -- target/avr/translate.c | 11 +- target/cris/translate.c | 37 +--- target/hexagon/translate.c | 11 +- target/hppa/translate.c | 21 +- target/i386/tcg/translate.c | 19 +- target/loongarch/tcg/translate.c | 8 - target/m68k/translate.c | 9 - target/microblaze/translate.c | 11 +- target/mips/tcg/translate.c | 9 - target/openrisc/translate.c | 11 - target/ppc/translate.c | 9 - target/riscv/translate.c | 24 +-- target/rx/translate.c | 35 ++-- target/s390x/tcg/translate.c | 26 ++- target/sh4/translate.c | 9 - target/sparc/translate.c | 9 - target/tricore/translate.c | 9 - target/xtensa/translate.c | 12 +- tcg/tcg.c | 12 -- target/cris/translate_v10.c.inc | 30 +-- disas/meson.build | 8 +- 44 files changed, 818 insertions(+), 864 deletions(-) create mode 100644 disas/disas-common.c create mode 100644 disas/disas-host.c create mode 100644 disas/disas-target.c delete mode 100644 disas/disas.c create mode 100644 disas/objdump.c