From patchwork Thu Jun 6 03:29:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 801969 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp96230wro; Wed, 5 Jun 2024 20:29:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUCHqRgfvgfWY2HxDKPOdTazzhtwKS8DIU8Xlf/ysJ84InQs96KMOokC3wGszdexjnqyBFsouXYOAagXMoaP7J2 X-Google-Smtp-Source: AGHT+IF4MI4JMsOoGX9WFiM5e/VnUe3qNgx98rRj6loSEdrsB8nOnRMxsaxftdv6loNVGGIwFgbe X-Received: by 2002:a05:6214:21e4:b0:6ab:9c77:c32c with SMTP id 6a1803df08f44-6b04bfeaeb9mr27005896d6.10.1717644594810; Wed, 05 Jun 2024 20:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717644594; cv=none; d=google.com; s=arc-20160816; b=CiOr7PtdCdQ2fDrot3h2CTKZDF6UzdekYK4JpKKhmJ6gb5ynQH/2iXbofhbbxs+ZsP K/hBlyXWZEQxhfBP/B53NvCWmghL7ss887k+gzKc2wgb+OjM6whRXrcePdm+ixqO7q0K 83pKLmA4/Rldi/+dZiWpIpCIQskzupynhwSu1LvPWL0EoETaBneoyYOU2ty4NsBWWP4B JizYsKhJPipHgFwnPr55QmhaQt6erdmpuEYDidqBYMVm8O+b16shZ8gtLqjcv399W+E4 Fic0Mz0C4ZLfIz1XRT0Gt3Oe9tbkK6UjIIn2MQp409qy99htYzZ0I70/rWSyxOikaMST sCWw== 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:cc:to:from:dkim-signature; bh=yAhR3pNp27v16bA5nOHMXZRb+BlQPJ5i0gki3Nov2RY=; fh=DfUxOGz7MnM49MBgqH5VPROGi+97fYtPWhcEZCG1Y5Q=; b=1LrtJ6CqPnaUElUhf56ZLjPVmAXdBFGN0Q/QgxkRAyyja5qxWnDXb6WK7tIV70jd1n ZVWE+sPRcKm4sG4OKCSgycCGc85kD+hsHQwr7613chdCFzL0ee6scpTtFV2rgJ2lSR7n g0JYbwz69MSjEj9QlFCfSTC332M+mkzEqP3Bklxe21KUnLthaDd86yZ9dax/p3M25106 KsXajHscd2liV4gLuMUBlQGEcN0GSvmi3OTEpeP1ccojdAmCQjr2BT1bnSRh2rPrR7AD 1Mbv2M0bLwvGJBhJVpgwS9XWr0gKeEXee5TrLnoUURu5rG5HW2S28quKduzdRxGqEkYD AOtg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VpwnyseQ; 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 6a1803df08f44-6b04f998060si5422636d6.343.2024.06.05.20.29.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Jun 2024 20:29:54 -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=VpwnyseQ; 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 1sF3ol-0003Vr-Km; Wed, 05 Jun 2024 23:29:35 -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 1sF3ok-0003Vc-AI for qemu-devel@nongnu.org; Wed, 05 Jun 2024 23:29:34 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sF3of-0003m3-CQ for qemu-devel@nongnu.org; Wed, 05 Jun 2024 23:29:31 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-681bc7f50d0so1150636a12.0 for ; Wed, 05 Jun 2024 20:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717644568; x=1718249368; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=yAhR3pNp27v16bA5nOHMXZRb+BlQPJ5i0gki3Nov2RY=; b=VpwnyseQ6A6sitwyP7Pbp9DZffVpbL3P1J5bEG0H7lHZne1w1ehjYJH9Mc/K/BX9sm bKksvw9nZHhXf6mn88V+RlLY8k0lKQoXcWGgynzoGR09B+YAtZQ3y36+cLMRCFsQbnly b9mqN9oOqNvFifLyq5r6q9gy38dLz5jctS49Wh0DAwt65YVe9TzuqrdY+nvmYxev4PBB +/Q+yA8XT7uRkgZdGzQTDczNvG8KdyBictIu7wx8iPm5XmQJuhn+/76mmD9oVqQI4AX4 LkmBzNSuu87KQpJYvu522U1/f3BtaaXbNC0UXfsnxezkeCI1t99d+HGuh80NIy3FI4tG zC7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717644568; x=1718249368; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yAhR3pNp27v16bA5nOHMXZRb+BlQPJ5i0gki3Nov2RY=; b=SPpHUL+zxQOycRhiasqZuz5mLJzoYOlLPNxWjjkgmyTUDPXUbKME88ip10g2O3HcON tVEgzkRTM3DjDNSoCaWbRjaDVJPWUNU/JcEe3b4AjOKi6ZV55EY6b3x+xEfMSk+YtldZ Th0ltcTDkXgAN9V/10ik2Kbv88Yj/ADR9UE8OxurpLx5g52rawzTyRYZpypzJpnliOdD R9UDBuE1dfXKSjSCpB6iugAq427HbHIFznF2gdT2R4u4XeBS2LVpcrAMUKRR4piblt5E pvi6GBE625ORJZ2m6tMISKVdOF3YBlt7FGGKpdsWcj1qJuQTgOmVUqQojgSmj376V5Mc /t0g== X-Gm-Message-State: AOJu0Ywu+BS4ZnplPQY8yeqdYqmN96DH3zXJryVMFy8GGrd5nb+HJnWW Hq+8momIymffAXV7vGqQpXvYRcJGHM1VEiyhN7e68Hjt19X/Mp7bGKTThaNNy4SUc0WWGp8t1R8 7 X-Received: by 2002:a17:90a:9a8:b0:2b9:fc72:547e with SMTP id 98e67ed59e1d1-2c2999d8736mr1971559a91.18.1717644567806; Wed, 05 Jun 2024 20:29:27 -0700 (PDT) Received: from stoup.. ([71.212.132.216]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c254a76729sm4826265a91.0.2024.06.05.20.29.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 20:29:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, alex.bennee@linaro.org Subject: [PATCH v2 0/9] plugins: Use unwind info for special gdb registers Date: Wed, 5 Jun 2024 20:29:17 -0700 Message-Id: <20240606032926.83599-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::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This is an attempt to fix https://gitlab.com/qemu-project/qemu/-/issues/2208 ("PC is not updated for each instruction in TCG plugins") I have only updated target/{i386,arm} so far, but basically all targets need updating for the new callbacks. Extra points to anyone who sees how to avoid the extra code duplication. :-) r~ Richard Henderson (9): tcg: Introduce INDEX_op_plugin_pc accel/tcg: Set CPUState.plugin_ra before all plugin callbacks accel/tcg: Return the TranslationBlock from cpu_unwind_state_data plugins: Introduce TCGCPUOps callbacks for mid-tb register reads target/i386: Split out gdb-internal.h target/i386: Introduce cpu_compute_eflags_ccop target/i386: Implement TCGCPUOps for plugin register reads target/arm: Add aarch64_tcg_ops target/arm: Implement TCGCPUOps for plugin register reads include/exec/cpu-common.h | 9 +++-- include/hw/core/cpu.h | 4 +- include/hw/core/tcg-cpu-ops.h | 14 +++++++ include/tcg/tcg-op-common.h | 1 + include/tcg/tcg-opc.h | 1 + target/arm/internals.h | 8 +++- target/i386/cpu.h | 2 + target/i386/gdb-internal.h | 65 +++++++++++++++++++++++++++++++ accel/tcg/plugin-gen.c | 49 +++++++++++++++++++++--- accel/tcg/translate-all.c | 9 +++-- plugins/api.c | 36 +++++++++++++++++- target/arm/cpu.c | 40 ++++++++++++++++++- target/arm/cpu64.c | 55 ++++++++++++++++++++++++++ target/arm/tcg/cpu-v7m.c | 2 + target/i386/gdbstub.c | 1 + target/i386/helper.c | 6 ++- target/i386/tcg/cc_helper.c | 10 +++++ target/i386/tcg/tcg-cpu.c | 72 +++++++++++++++++++++++++++-------- tcg/tcg-op.c | 5 +++ tcg/tcg.c | 10 +++++ 20 files changed, 360 insertions(+), 39 deletions(-) create mode 100644 target/i386/gdb-internal.h