From patchwork Tue Apr 16 04:06:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 789201 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:dcf:b0:346:15ad:a2a with SMTP id dw15csp104581wrb; Mon, 15 Apr 2024 21:06:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXLoGPoIKFhKu+Ubijj5ZEu7Xo8Ht1XzCcfou13yO5S5WtK3H7dVnvjK2XfOG0cfBYmxNJnDp8cn7i3PWDCuCc+ X-Google-Smtp-Source: AGHT+IERZseYHIIzvgtbzwyP8l3WU16YYtJnDBC6qO8Lft+xseS2XjGYytmJO4Bn4PfWqgEWxf9V X-Received: by 2002:a05:6102:3f52:b0:47b:809b:16a2 with SMTP id l18-20020a0561023f5200b0047b809b16a2mr3888950vsv.34.1713240396592; Mon, 15 Apr 2024 21:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713240396; cv=none; d=google.com; s=arc-20160816; b=NCF9Rd1meGntAFJfg2l7oqfYCB+bNoick3qWqYapqC9fyWdIlWV7whRuGEGr+4F9Gv s7xjel0gpPAZcIkyWbRZV1MSJWB6v+pf8G8xP7U0ite1fp4x9tixitJa3y/oSEw9K8dV qxNyGvlbMjU2Noytf1cv4N7bDdl7P0szdSkm07BSEvt1f1sgXozQFlSzXggp3URVH5UP Tciw6EV3VNY/e1FFiZmw0uCIAl8F2y8oeRoeebPbLaFq53V8ihkQaKG7tNUCwHL94zL0 Tg0J692u8ZmpxT0EhXSSrDBsi/q+NxwF9n1JVxaqAJ30Z9wTROvT3UWhtZCav7iKqRi3 Rxsg== 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=PR3CJUUo2/VGKB2RGbMarxktvJK4SxiTMKyT7dvFViA=; fh=HGMLmPLDRBgS2M2DmRioi6Q+pUL3jqoEM8UtJkY6Dtg=; b=GvKSdjuuHqJUKPKSN2EFVkImeChog6NTEKTPcES+9tq2K2CYE2HeIljK53qABUsT+f MkFMKA88tqOBgoBXVvb+fEZGFlYKn5nc6jwgVj9Ew+tXz+nr8PVtEwPF65icxdUiD/dQ LC2gnHSJ6G9cFE0HXmEIXjB4ZKCHg/yJMQ3PGQy8KrA/tHcP1t8FYWUFWTg6SUAL+0x5 mZ3QTz4rdHuFgmXGuHoP6pJhZe7A0if2RXp5hMPpLRlsO0ggicA6bdYbrnbAx4XROqg8 8mbmnLZ7VJLdcgGQIrkTV++V8sxOBfTFj2t5sldClKhnpA+rXsg+P+VGyw4q4hrnPIO1 Q5mQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a9kATrHL; 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 pc32-20020a05620a842000b0078ee09107c2si4591524qkn.786.2024.04.15.21.06.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Apr 2024 21:06:36 -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=a9kATrHL; 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 1rwa5G-0007ko-U6; Tue, 16 Apr 2024 00:06:14 -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 1rwa5G-0007kX-0h for qemu-devel@nongnu.org; Tue, 16 Apr 2024 00:06:14 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rwa5E-00079M-Bh for qemu-devel@nongnu.org; Tue, 16 Apr 2024 00:06:13 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1e424bd30fbso30660475ad.0 for ; Mon, 15 Apr 2024 21:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713240371; x=1713845171; 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=PR3CJUUo2/VGKB2RGbMarxktvJK4SxiTMKyT7dvFViA=; b=a9kATrHLxQbwqaTS0CBnaGFiDv/30/L4miY5zwQT28cpRfp/sNzpi/UDR4menPtcz9 r99pDBpfrun/6Ina355rmJgWq2eLlE2dg4/aubIdbjLV5V0VJ//QiEXrGfp8whtGAUKS ID60WxBSdmg1lagUI3xAuk7Vr+YOR54rjfctEjZSm24VeRoBq5kTWAEkW54+TOYdb+1L Rk0oPp7VkVhFU3uSEVxv+tgYFp7uIO+pGKCJNW90oDLGKduC+dtfoVITJKzOtiB6NMc+ 6YsR5YrMegW1ehKWG06tucztFL5aRaXv+5+ZBk9CijprMneiaar3eGn+BkPcGQATeFGK ItRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713240371; x=1713845171; 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=PR3CJUUo2/VGKB2RGbMarxktvJK4SxiTMKyT7dvFViA=; b=C7ql3PLJGU0GCrI9EwbCkPzCKkJwuHSgHf2NV/3AeAyEZTcg9z78oToy1+l1KtJ67B G9I0yg1Hj5A2KxbV2deNyW8lpMvPvLdRurnuIaHpUhsTi/dw3kwojrvgo7Wy39LW1VvY mgTzHE+Bh4JHuZ/9j4NA3kxbTIbZ33QzPdOsjlrvTTHuVyKQHLgvLUu/GO+eXRUPVcM0 mDdt7ADIfTyUhS9UctFWf7ZiAuF/VxoRba9pUgRzBJeNnC+u/gklLJmf3fkCHCyDURcd 4gfXRKelxdSV5ds0NEa61diaUqFxxJWr51PT6rolAslctRWySrHr8hNm1S2Plv4LD3rG QImg== X-Gm-Message-State: AOJu0YxVRDaCNH18q0M6cjtrlfAF05MISKeIPrsre2UuEcmp8fCHVq5j +QvaJj46/OK/SWaky/AOa5IXmRAwpCy+cGvVBDhHEGLjX/f9eJh9zUQKbWiYFRW6ZRjHmLhN6J3 / X-Received: by 2002:a17:902:e786:b0:1e6:3494:61fc with SMTP id cp6-20020a170902e78600b001e6349461fcmr6334476plb.0.1713240371009; Mon, 15 Apr 2024 21:06:11 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id l1-20020a170902f68100b001e3e244e5c0sm8694439plg.78.2024.04.15.21.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 21:06:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org Subject: [PATCH 0/7] plugins: Use unwind info for special gdb registers Date: Mon, 15 Apr 2024 21:06:02 -0700 Message-Id: <20240416040609.1313605-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::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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: 20240404230611.21231-1-richard.henderson@linaro.org ("[PATCH v2 00/21] Rewrite plugin code generation") 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 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 (7): 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 include/exec/cpu-common.h | 9 +++-- include/hw/core/cpu.h | 1 + include/hw/core/tcg-cpu-ops.h | 13 +++++++ include/tcg/tcg-op-common.h | 1 + include/tcg/tcg-opc.h | 1 + target/i386/cpu.h | 2 + target/i386/gdb-internal.h | 65 +++++++++++++++++++++++++++++++ accel/tcg/plugin-gen.c | 50 +++++++++++++++++++++--- accel/tcg/translate-all.c | 9 +++-- plugins/api.c | 36 +++++++++++++++++- 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 +++++ 16 files changed, 258 insertions(+), 33 deletions(-) create mode 100644 target/i386/gdb-internal.h