From nobody Wed Feb 11 05:35:44 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1679495362; cv=none; d=zohomail.com; s=zohoarc; b=JM4907lgiiSRMlrO5vpVppGMZru/8OwfBjpoNOx3db9E15FREPyqNpirmL8OkskvcR98JTP15kLqkkmSPBr24Bf/Mdyea6xrJLqHq0jMK+FpKvURLrBlvq5i7PNwUzR9NE7jxkH4hzFILNmdJqm5YGCQopTS4IMOwJEd98M9zBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679495362; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pLFkci5O5POjG1PMHDhT+XDLlH/l0geR+447mWScQDk=; b=KiEgLKXRg2PLIZ/d7++wIBibL1mcn9NseqbQTdz1swUIFRZTQorcck5TpIDLUb5pdvaJyNLPFazm26pQWMOt/UqC8/j08GtDVHjllleaU3F3+U+Zr0X9oosGKXV+hjYpyLua5Uiqgl8Szavjv6F0WaVL//tv947x6SWHwGh+7fk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1679495362085538.6770191683026; Wed, 22 Mar 2023 07:29:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pezSk-0003v2-N9; Wed, 22 Mar 2023 10:29: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 1pezSi-0003u4-Ps for qemu-devel@nongnu.org; Wed, 22 Mar 2023 10:29:12 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pezSh-0001yc-7V for qemu-devel@nongnu.org; Wed, 22 Mar 2023 10:29:12 -0400 Received: by mail-wm1-x332.google.com with SMTP id o32so5282731wms.1 for ; Wed, 22 Mar 2023 07:29:10 -0700 (PDT) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t20-20020a1c7714000000b003ee10fb56ebsm7663702wmi.9.2023.03.22.07.29.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 22 Mar 2023 07:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679495349; 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=pLFkci5O5POjG1PMHDhT+XDLlH/l0geR+447mWScQDk=; b=alSKek3LPWOHgay97/CzlKC9spc9UixiqfVKFDxE9Ka6LmHCazYLWjy0u2WArnjy4A snSEs9KGeo5jYiNnu/bvA1gt/PIeFeKSRC8g80SYgv6jz8AM1+VgBkApwrLJxTHP1EDc D/ohryWMFhmMrh8AroCKLY1A00qVDc6q8UxUYvzJmCddnUZRbekBC4FpdVWIHBuB6k4k Z4+OR0Ea7yMgHHpTsB38k5zumExdMqV7+xRHocWR/8Qz+htUIjQ6V8gqzSRlDziE0R6b encIMQl3NUN+RlqG+eOGco1r3cwmzDYn2Cmsu5XXoH6tyAkRbeOv8lhStQDaL8Iuxifg PHoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679495349; 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=pLFkci5O5POjG1PMHDhT+XDLlH/l0geR+447mWScQDk=; b=uNMNJ6pGoCLIJAq9RMO5EkSL4dccIicvJf/oRePK4RtPlUIz1/kJrG2XCZY9R/O0Nv 6gE/wdaYHtnV83LJCXjFfkdLibkURcnL6YW52bxk1Hh25L7P/tELgjU2O4zAUfVl5hhj vq9IM1GAyYQWpbUmtniy8zYh96q9/Hqz02F0NlEjFm31V4xH23Lxrf1pjx7uSTp6Nx/E QHbOIMK1orSyveP1joqWY9IUx/CPgbLaNnwgM9yFjlnoT/4Af1wcRisjzUrBdAfQB4pi Agu/dVmI3jxqtdo3JXatjfcg4IuAV3PUDRrN2z9P5ssOYdrJj/dK2hAM5FBWXNcILePc 1jZw== X-Gm-Message-State: AO0yUKUttgQ6uVkfAQeumRgzH4t+vp8TwzBFMYxTmWm+HUFSbdGyGO3V wC0ybjiTpWvqRCx4L7dte/WkBKKdkUHnnBxIq8oXew== X-Google-Smtp-Source: AK7set/TEtWYodEj7mvlXjissILsMDYIJkxN+mmdpj16er+8xbe55i7H0xPZfuZswfJlVAVGoPReBQ== X-Received: by 2002:a1c:c901:0:b0:3e2:201a:5bcc with SMTP id f1-20020a1cc901000000b003e2201a5bccmr5565990wmb.33.1679495349629; Wed, 22 Mar 2023 07:29:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-8.0 1/2] target/arm/gdbstub: Restrict aarch64_gdb_get_pauth_reg() to CONFIG_TCG Date: Wed, 22 Mar 2023 15:29:01 +0100 Message-Id: <20230322142902.69511-2-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1679495362455100001 aarch64_gdb_get_pauth_reg() -- although disabled since commit 5787d17a42 ("target/arm: Don't advertise aarch64-pauth.xml to gdb") is still compiled in. It calls pauth_ptr_mask() which is located in target/arm/tcg/pauth_helper.c, a TCG specific helper. Restrict aarch64_gdb_get_pauth_reg() to TCG to avoid a linking error when TCG is not enabled: Undefined symbols for architecture arm64: "_pauth_ptr_mask", referenced from: _aarch64_gdb_get_pauth_reg in target_arm_gdbstub64.c.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invoc= ation) Fixes: e995d5cce4 ("target/arm: Implement gdbstub pauth extension") Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/gdbstub.c | 3 ++- target/arm/gdbstub64.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index 3bd86cee97..655369dc74 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" =20 @@ -526,7 +527,7 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) * crash if they see this XML from QEMU; disable it for the 8.0 * release, pending a better solution. */ - if (isar_feature_aa64_pauth(&cpu->isar)) { + if (isar_feature_aa64_pauth(&cpu->isar) && tcg_enabled()) { gdb_register_coprocessor(cs, aarch64_gdb_get_pauth_reg, aarch64_gdb_set_pauth_reg, 4, "aarch64-pauth.xml", 0); diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c index ec1e07f139..3bb0923cbf 100644 --- a/target/arm/gdbstub64.c +++ b/target/arm/gdbstub64.c @@ -210,6 +210,8 @@ int aarch64_gdb_set_sve_reg(CPUARMState *env, uint8_t *= buf, int reg) return 0; } =20 +#ifdef CONFIG_TCG + int aarch64_gdb_get_pauth_reg(CPUARMState *env, GByteArray *buf, int reg) { switch (reg) { @@ -244,6 +246,8 @@ int aarch64_gdb_set_pauth_reg(CPUARMState *env, uint8_t= *buf, int reg) return 0; } =20 +#endif + static void output_vector_union_type(GString *s, int reg_width, const char *name) { --=20 2.38.1 From nobody Wed Feb 11 05:35:44 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1679495390; cv=none; d=zohomail.com; s=zohoarc; b=FkSmaBowg3ku4vhIDq3wMQM7pTmMyfF/DUcQXqKvZtSwHP/U3o9/yQyH94BJaPCSmSVSiJUuDiM31sqBawTwHhwNDaNdO3IuXa+Lp0qgNE8dr/+IDntbftlEqhNsaVqSmeWVe3MzQE8WP9FvntyMxfNpj5lyqOojMZJ3z0pLtSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679495390; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZgolkMT8PMDnGL6LNTapds6VAVWk4DJsX2jjIB/I6WQ=; b=CfsxDvQneLqxX4jQxjMeu7Zva5NgcQ+OT4c4X9XQVj+O+DU9itqBgu5D4rE9FD8pdgHgxJw8MMAkDK8UpL9gvB0m8SE14Sp5vZ8duY5w807mQG6C8u8doG7px9r33YvUChrsaEaaA/QSqmnRFz6dONqaKWfzTJhXU3jjcfsLYbo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1679495390155777.5662344121034; Wed, 22 Mar 2023 07:29:50 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: AK7set/f1Jel4PEN1VyFB9P8enoVl10ChOSVBQdVpWFUdeoDNxx7XTbquwuEjbpwJcmOJnX0B+fIkw== 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1679495390533100003 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 invoc= ation) Fixes: 7d8b28b8b5 ("target/arm: Implement gdbstub m-profile systemreg and s= ecext") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- 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_re= gs), "system-registers.xml", 0); =20 - 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), --=20 2.38.1