From patchwork Wed Mar 22 14:29:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 665896 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp183438wrt; Wed, 22 Mar 2023 07:29:49 -0700 (PDT) X-Google-Smtp-Source: AK7set8e/tA31G0vJ7k02/IPTMJswOZtn6WjJDrhNIH5sH3RBba/9HsXfZ2Buwwz7aJw2ZYWyQLo X-Received: by 2002:a05:622a:1042:b0:3bf:c86b:3d2f with SMTP id f2-20020a05622a104200b003bfc86b3d2fmr6323256qte.51.1679495389669; Wed, 22 Mar 2023 07:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679495389; cv=none; d=google.com; s=arc-20160816; b=aw9SfVhytfwOR1pITwVun4fT4jdhZV/uyMr57rdWvnrIY5GotsbZM++KAR0bdwjcv2 8uETSkofytaXhlm7bbGGjwzJTsCnklUQ4r4qG6Bq/287v+azkyRDD1uttMGK2zF2hVxF v57Sr0ZQEdGar5xvpeo6Cp6IE2tQJB6KzqcFf0PWKxX8di9/lPW88C6prvLwRsme5wv4 mqvYJjjzw5kHBtCsbtj2uebLAPfpY5EplPDICI/lvoixP89LjqZ+XW/xwX/+QPB7vvjd AF0BUOBPsW8+NkrLW3VZuAqRUTkPbajxrjz7hAI2R8Wr8xrHUJ16irttyrRQstH+VruJ oVcw== 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:cc:to :from:dkim-signature; bh=ZgolkMT8PMDnGL6LNTapds6VAVWk4DJsX2jjIB/I6WQ=; b=H5vL1kv0wFFXq4DYLd8daipdX46ffFCP81WEMcdgoqPO71GwSoiB7KOrFa8QXqs7gB Hal5aZbahwmqzIEw6JxIvBJTaNIOMk9VFaEHV+/7t0gX5FKHyMs8/FRnXNnyM97aYDV1 4CHezo89mg1GcV1l56lpZnLsF4AEgWpWUI70kxw6TnPx6OVPE9sLMlqqe23g7kOROXty KGCKILxLzEbl6WWwKmuKez0z+C6O/b11KB2fC5+xScmqnHi39naZ8rv6tDJsQ5F/srlf YR8mO0ayXha+UpWnOjBO1VOFNHgZZ5swRNRhpXouT8ONR7JhfDZ2dssHMsELpI6wvLS9 kHeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LP2p3qVf; 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 z70-20020a376549000000b0074695ed789esi4353548qkb.589.2023.03.22.07.29.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Mar 2023 07:29:49 -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=LP2p3qVf; 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 1pezSp-0003yB-Cq; Wed, 22 Mar 2023 10:29:19 -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 1pezSn-0003wc-Tf for qemu-devel@nongnu.org; Wed, 22 Mar 2023 10:29:17 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pezSm-00020A-4p for qemu-devel@nongnu.org; Wed, 22 Mar 2023 10:29:17 -0400 Received: by mail-wm1-x333.google.com with SMTP id m35so11670597wms.4 for ; Wed, 22 Mar 2023 07:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679495354; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZgolkMT8PMDnGL6LNTapds6VAVWk4DJsX2jjIB/I6WQ=; b=LP2p3qVfMxVxXcZIq+YLF5GKgjZAUvfQyvARZOAVyhjsi5tPB4A+DRnxBT0+qEgDds /AJ470NbnOrs2wnTkRIoEtuE68VWkK0hpVU1/zzmsP0HZrNTVqLMQAUCqf52vKeWtrje IKfQC9yhLeKdog0/ztD4YDQa17Vk3gN+ECaDUEWPeMLCxLNLsCSg9nFLVYwN0mDD6L8Q gMDGzQgo0SNpm/3VEscyXsrpXQCVirxP9LsJQvg20VR/KhRFk8yHl385l3kTdbYk2srS Im2O9yGKTp/b3R2M3SEr2oVSYleGlrvsCJrU3AG0HpzSOmOW4xwIjcSPuRlvf3l4PwgD IbIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679495354; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZgolkMT8PMDnGL6LNTapds6VAVWk4DJsX2jjIB/I6WQ=; b=AvVYoN2yxmpmvIpW/0YPOp++3ZVZcBkzl7JoC2zt4isKBY0zfKmKhzJ5sjsFDR8A3g 24jyX4gsTLJyXAeLRnNcPU0BvK9HMxsd79pZWZVyHWbgx09iVqr4TLHKD394weqfNkmO UjEXgCClMeYp1E60Zak5RjSKziFQpysarnkUdSshgciedU6gH0Yw24/BiniTPhpRbAZA gKkbEnPqpIZlkUesH27y3wJVbHzaVlyTPjKx4ONeSasqUevsRfX3LXiVuGc42atcl25G kOvIUIjdbi2wG/4cHqR3GqiBa3xzkkT3sEC+cs/axZ0LjzUtdZjqP18PgppzAhH34Fem aOag== X-Gm-Message-State: AO0yUKV2JqzkUub5tHGJuXrFDYVHepqCjPF+cVf9c7K2t+rZsqxD11QX vISGwQ1yrBaNl+M6TBVioTHSHvAMaHaIUCfY/Y9KSQ== X-Received: by 2002:a05:600c:cc5:b0:3ed:2346:44bd with SMTP id fk5-20020a05600c0cc500b003ed234644bdmr1893510wmb.19.1679495354633; Wed, 22 Mar 2023 07:29:14 -0700 (PDT) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id p13-20020a7bcc8d000000b003ee1acdb036sm6775207wma.17.2023.03.22.07.29.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 22 Mar 2023 07:29:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Richard Henderson Cc: Peter Maydell , Fabiano Rosas , Claudio Fontana , qemu-arm@nongnu.org, =?utf-8?q?Philippe?= =?utf-8?q?_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-8.0 2/2] target/arm/gdbstub: Only advertise M-profile features if TCG available Date: Wed, 22 Mar 2023 15:29:02 +0100 Message-Id: <20230322142902.69511-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230322142902.69511-1-philmd@linaro.org> References: <20230322142902.69511-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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 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 --- target/arm/gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index 655369dc74..2986ed6fc8 100644 --- a/target/arm/gdbstub.c +++ b/target/arm/gdbstub.c @@ -554,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); } @@ -562,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),