From patchwork Tue Mar 28 12:26:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 667856 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp1623414wrt; Tue, 28 Mar 2023 05:27:12 -0700 (PDT) X-Google-Smtp-Source: AKy350ZGu/PY/xgVZrT1QoeXkOeoq4DVyyu82PY46q3uI1K3zsRvggowqJtKVYzOPb9k4dUS7OvP X-Received: by 2002:a05:6214:f67:b0:5ac:e837:4401 with SMTP id iy7-20020a0562140f6700b005ace8374401mr29145771qvb.18.1680006432445; Tue, 28 Mar 2023 05:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680006432; cv=none; d=google.com; s=arc-20160816; b=uBg9M7eyb8NR4VFw9CaXBmm+7nWKPATbZVX+OLHZ8ENLzSj6YtV+o6dHzqR6BkZw1J 6Uk71uvLuddAhw+FWoaTz3ORPIcQMx0iT3zFstxSItJZzoXo97fW6AZUm3OkFWC25aPg AopklpPZJtj1wh5EvlYYkT2BmF5PIH8G3lGQUew1lgrtR/qHII8JfC5rafOMHNQm4XII jjCPph3Vpjg616yAOqFhBqmrX8l0T7Q2lxs1i5fsLw1xytXdN9wIc4YlpGv2bMrIvjVK 7jsCA4lrFyR6TOQEkzkTfR1dJp6neeQVi0lr5NV7THVD/6/H5m+mVCHNfJnLseL14PVW mFwQ== 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:to:from :dkim-signature; bh=kg5Dvw5prHKKRU2ljQI9Ayrsxu4xuY3RkI/AjCPe4UI=; b=Dh8nX1/x/PNNJB+RRuIwteIiiMR+BNdE9ZeYUoCZt59kjfdshC9eQmAPYFrXleaGzv BQXTZJ14nkI5c8kohkykcK19yMCZruRVbNIFlGg426shMBfoKR2JS5t/JtXBddYecaRN Otxi5xM42yL3dP8ahS4t2jPRyc9XX4EjsPi4OCP5qzh/Kfwyio9xQVYg0gXiazHqow6t 2KSwGJRav5azal9JH6tFPVBqrVmrwaerDLsmEScMnK+sEeh9IeCLvkeR1LNG5WRyGTF2 lyss9W3wvkwQEgQ29435g8zid/halU+jwFSJT4P1vWYcRGaXbc8TUp6+w/TzENvaXGhx mWpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="FD/hT6YE"; 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 s16-20020a05620a255000b00745d53ed94esi20732529qko.145.2023.03.28.05.27.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Mar 2023 05:27:12 -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="FD/hT6YE"; 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 1ph8PS-00077N-4t; Tue, 28 Mar 2023 08:26: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 1ph8PQ-00076p-4I for qemu-devel@nongnu.org; Tue, 28 Mar 2023 08:26:40 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ph8PO-0004g1-Db for qemu-devel@nongnu.org; Tue, 28 Mar 2023 08:26:39 -0400 Received: by mail-wm1-x329.google.com with SMTP id l15-20020a05600c4f0f00b003ef6d684102so3992415wmq.3 for ; Tue, 28 Mar 2023 05:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680006397; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=kg5Dvw5prHKKRU2ljQI9Ayrsxu4xuY3RkI/AjCPe4UI=; b=FD/hT6YE2RwKCFKGNkMpCqvemSe6klINbwek4QuGXvuUFM+kvMdHoLOiPBQdlXvnR7 rF0P+o5gveLm3mbT7r518cRZdem2iUZ2NAf6zIrRYe9/0oLwQjGaddYuAVVH/19kNXyV NKIxVrlwsg0j4U6uO/BgHC8RcT344kbTZ+ho+DNyEn3hqH8VQFRAurX7eL2hql61xfJi lb24AtXiYko/2+NbgTEkbV3FI8FdDbuk+uzCGytK+vPjRdPQnY5RQWIZ8+2IaFaGitIW Rxx5doOyXmBz546p/eonzU2D3QtwSET9z1bvHr9PK0ZIpqbE5UrhBv8P+Jhrb0M1rq8B +pVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680006397; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kg5Dvw5prHKKRU2ljQI9Ayrsxu4xuY3RkI/AjCPe4UI=; b=FBJfOnYs+g9uqRUikV681rCc8vJqhfTLqr8Y1PPi/ZU06iBmgdjj//f8DyFOjIB0Qt R0E7G8NIHeagy/gCTHQqK1dvifTzDCu8YzjJEIiRcWKFdYRWzd+cjsbJiACeVLx3nBpP 6sL8QUM54KoYI4PbyNx1TlJvzS3MIZF7pXA6oEjvP4g9oAb9TVnSZfjdRTVqFVnq5ybZ XzWBSO272NiXawRLxqriiPWTmjv5S7kTmSwFQDgAdOQLy4zsihY0XaUO31BjQI9osR/k /SfI0A/qwPmKgNibfX0VkftJSZB1y6TLXoGzaiFt5E3Plu/3Ypx0d7r1o/Xvtk0SLuWD em9g== X-Gm-Message-State: AO0yUKUF9lWxfMV53DmvuYJODjOdCh2i9RlrO/YCHisRGZRvpes6E+Df m3fX/5w53JbxRX06vzywbL4oD6DaWJYjvRvFApY= X-Received: by 2002:a05:600c:1d10:b0:3ee:f807:bcf2 with SMTP id l16-20020a05600c1d1000b003eef807bcf2mr11465507wms.3.1680006396856; Tue, 28 Mar 2023 05:26:36 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id m21-20020a7bcb95000000b003eeb1d6a470sm14993414wmi.13.2023.03.28.05.26.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 05:26:36 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 1/1] target/arm/gdbstub: Only advertise M-profile features if TCG available Date: Tue, 28 Mar 2023 13:26:34 +0100 Message-Id: <20230328122634.2154949-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230328122634.2154949-1-peter.maydell@linaro.org> References: <20230328122634.2154949-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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: Philippe Mathieu-Daudé Cortex-M profile is only emulable from TCG accelerator. Restrict the GDBstub features to its availability in order to avoid a link error when TCG is not enabled: Undefined symbols for architecture arm64: "_arm_v7m_get_sp_ptr", referenced from: _m_sysreg_get in target_arm_gdbstub.c.o "_arm_v7m_mrs_control", referenced from: _arm_gdb_get_m_systemreg in target_arm_gdbstub.c.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Fixes: 7d8b28b8b5 ("target/arm: Implement gdbstub m-profile systemreg and secext") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Message-id: 20230322142902.69511-3-philmd@linaro.org [PMM: add #include since I cherry-picked this patch from the series] Signed-off-by: Peter Maydell --- target/arm/gdbstub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index 3bd86cee979..13fbe9b0d7e 100644 --- a/target/arm/gdbstub.c +++ b/target/arm/gdbstub.c @@ -21,6 +21,7 @@ #include "cpu.h" #include "exec/gdbstub.h" #include "gdbstub/helpers.h" +#include "sysemu/tcg.h" #include "internals.h" #include "cpregs.h" @@ -553,7 +554,7 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) 2, "arm-vfp-sysregs.xml", 0); } } - if (cpu_isar_feature(aa32_mve, cpu)) { + if (cpu_isar_feature(aa32_mve, cpu) && tcg_enabled()) { gdb_register_coprocessor(cs, mve_gdb_get_reg, mve_gdb_set_reg, 1, "arm-m-profile-mve.xml", 0); } @@ -561,7 +562,7 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) arm_gen_dynamic_sysreg_xml(cs, cs->gdb_num_regs), "system-registers.xml", 0); - if (arm_feature(env, ARM_FEATURE_M)) { + if (arm_feature(env, ARM_FEATURE_M) && tcg_enabled()) { gdb_register_coprocessor(cs, arm_gdb_get_m_systemreg, arm_gdb_set_m_systemreg, arm_gen_dynamic_m_systemreg_xml(cs, cs->gdb_num_regs),