From patchwork Mon Mar 17 14:28:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 874162 Delivered-To: patch@linaro.org Received: by 2002:a5d:4308:0:b0:38f:210b:807b with SMTP id h8csp2022158wrq; Mon, 17 Mar 2025 07:30:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVVR2Z7eowWPa+XwORAWUqQ5cH1oGOHY0YxwbppVh0OMmjzBgSsJ7NSxGPF+d3iyAz0h6Oyww==@linaro.org X-Google-Smtp-Source: AGHT+IHLzqpZpgIWB5I3DBOrDbJpT5tY4rJltlt9JmD0+rpFntg0bGj62cB3jTMB7AYV/kZXtths X-Received: by 2002:a05:6122:91c:b0:523:a88b:9ac5 with SMTP id 71dfb90a1353d-524499d5a99mr7310468e0c.9.1742221815677; Mon, 17 Mar 2025 07:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742221815; cv=none; d=google.com; s=arc-20240605; b=cA8OnHRRDW6ANReVlixEwNAUgm+ss635FU52QsB6p0qJi6duOrvgGcw7IhLer+hZ1N FQBS06gWsz4bEqzacVWTYr4o4o9lirIwNREI2nMW2STAAWW+Lf2BqSdPIVFEWLyVOP0b ikLd81+pIPLZuQ7pJ8liHs9kuhlcMBhF9swIp+Ph4iv3LdVcSl314igXwHuhGl3UHZ7/ 2wZL47Psr14VKiFwxcW6AfzSaUuHFxa7krXdqGjaeldgf4F+g7vkUN+JKsYHjWBvDRXv t/vogedbZ/v4XbSjEM9t8Ge4qirHW68p1UrgBGJpQMp7pOfhEIKqPZMntjFyyj5GqLPP aXtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=tYj3G1szAGFvKi0B3MWQ+0XMe12lN1gxPElsZir29Jg=; fh=eyEuquAXhs1vmZUPjEH0aJ7/MxU8Wg+XCwMDrwDuehg=; b=ThOctv5aijlL/OZOHPfPJm1zVhbVJYDLxC5FfUq/PPxWP/1RuoUEOfVxt2KdMEg3wd t+g4DM31FmgK1KoWFkBXuP/p8coqssWf9l3S/M0Q1lP7q/iIw/8cFTeEQGPwmXKLnZz4 MMvncBBX9MQPwGdsllhvyTJIDJDcX7dRXTKzpRBt9dHgaIZAfZcwli0233R126qLamSt sr62DuTE3VDS2MWiN+g9/1yAQpQ8GHBWCHHQS/5l4qdhNornGxbcxr1FDG9I54cAJmtm IGQvGIO0XrTZbxh9vQ2XfBSjEWENhaH1nG7c1ttcQ/U2J34N0A3ZKGmtziK0JsU/Q6Nf 93og==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b3XIUzhU; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-5243a5a1b8asi2877037e0c.100.2025.03.17.07.30.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Mar 2025 07:30:15 -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=b3XIUzhU; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tuBSV-0000pS-9S; Mon, 17 Mar 2025 10:28:51 -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 1tuBSD-0000dm-9q for qemu-devel@nongnu.org; Mon, 17 Mar 2025 10:28:33 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tuBSA-0001BN-FB for qemu-devel@nongnu.org; Mon, 17 Mar 2025 10:28:33 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43d07ca6a80so10349415e9.1 for ; Mon, 17 Mar 2025 07:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742221707; x=1742826507; darn=nongnu.org; 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=tYj3G1szAGFvKi0B3MWQ+0XMe12lN1gxPElsZir29Jg=; b=b3XIUzhUe0vQRqU+ffWKcVh4kDU4rMY4cf0/8+JNq3VTxOTB7MWCAHrGxKRPx4vQx1 EkHPCRDbFmGScneDxVq+ZLRlUeThYtpDRJdQ8OMhgMfLJQ44un/UjUuteDucl3YJo6lv ooDJuaIozPXtGdjZOHTUQugX7zo1fpm8DH4SYekbi7PxVoSHuoRHwaXJDFolyhcHahFy Z0XwgJ+wYWEodJY6hZIGt8/u8YE0ILIbSMWCJbmXTYnDm16cn/l2i+Lp9KH8snurLNre WbNvLvwMKTvDYjjPYuAukdgt+YmKuE77NrY5kBilIPX3urrpC89BY4TXQl8f47og+C/I 2bgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742221707; x=1742826507; 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=tYj3G1szAGFvKi0B3MWQ+0XMe12lN1gxPElsZir29Jg=; b=Zv05KYYg+M1e5slErzph0cgofLSm/hgqsPAtCTR7CkqYlj0JAamMVHUrfZEh5r+twZ owEgVXjEo4eICSBGqRmKbtzEZSNTkBpGOMOvp7wHQOvcjfK85EBIjr8Ww+db1qnraQtz 836y0Thtz+3c6aD/cSwKApII2U/z5+VBBIKwl+4/WlD4YF/y2rGmalPB/d/x2e/lfpRu A9bIocwyVfc6BrSDhpkyAE9ynIydrKizsXUPYIbBblEV/7nyTXhHufJgZkRsD/g0Ky1O InJbY0Uk0hGtsSfJLxmfe1u29QHMSPaLj08TrHVvjs3pFq1Z8Kk9VM/4fcOR1qMAWsqv IYtA== X-Forwarded-Encrypted: i=1; AJvYcCVY1jjXy/r/yS9xUdHwKt7tnXr8YnSzm/3/WCXpsrwdt2qn9l8PYlmptjhOSL04TD5hBOhbyYdM6ESb@nongnu.org X-Gm-Message-State: AOJu0YwH7pZDijmu8aInFw48ut6PVAZ1b9j6nLK92IrvTrmEv3i7Ed6E 4JPj7m85WUbQL3NwWorfr4TkRGpgrJL3JwjC7jN29fHhliQliO6CZT+eKnsRRui/po5QLfrR2go M X-Gm-Gg: ASbGncupPqzVnxlWbsa1os6rJpPCVj9m8W5nEksBWuX4mE4JvCmp9AOumYZTi9/+UDl uDy3/BW4e03lVTYgyvA1tc0M1jBfJ3PTJY5Ng8WfnxZXXw1wGrm1SdUWm+yKOt1FKPNVk4PpRqV ezEXqngKUPGM7kBwBlUHtq8Ywsmy4B/XKtZSDfuDJoaPtbSn3o4bMqygbVZwjQkG4ODNKqbYHsD bLUUHA3oRIKW56Cr/DcwmL/lNLzS0IgS9NXcx55K4mxnF17wgtZqQNQOqElxGPbaGNwUZs+GR65 Ii38Xv7+fBZF/y+4l4ObokFNZDPqY+9dNNjogfjjDuyYuSwbjGI= X-Received: by 2002:a05:600c:3146:b0:43d:db5:7b1a with SMTP id 5b1f17b1804b1-43d1ecb33b0mr126241885e9.12.1742221707629; Mon, 17 Mar 2025 07:28:27 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d1fe60ad4sm107914985e9.29.2025.03.17.07.28.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Mar 2025 07:28:26 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-10.1 6/9] target/arm: Present AArch64 gdbstub based on ARM_FEATURE_AARCH64 Date: Mon, 17 Mar 2025 14:28:16 +0000 Message-ID: <20250317142819.900029-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250317142819.900029-1-peter.maydell@linaro.org> References: <20250317142819.900029-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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 Currently we provide an AArch64 gdbstub for CPUs which are TYPE_AARCH64_CPU, and an AArch32 gdbstub for those which are only TYPE_ARM_CPU. This mostly does the right thing, except in the corner case of KVM with -cpu host,aarch64=off. That produces a CPU which is TYPE_AARCH64_CPU but which has ARM_FEATURE_AARCH64 removed and which to the guest is in AArch32 mode. Now we have moved all the handling of AArch64-vs-AArch32 gdbstub behaviour into TYPE_ARM_CPU we can change the condition we use for whether to select the AArch64 gdbstub to look at ARM_FEATURE_AARCH64. This will mean that we now correctly provide an AArch32 gdbstub for aarch64=off CPUs. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- target/arm/internals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index a14c269fa5a..a18d87fa28b 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1694,7 +1694,7 @@ void aarch64_add_sme_properties(Object *obj); /* Return true if the gdbstub is presenting an AArch64 CPU */ static inline bool arm_gdbstub_is_aarch64(ARMCPU *cpu) { - return object_dynamic_cast(OBJECT(cpu), TYPE_AARCH64_CPU); + return arm_feature(&cpu->env, ARM_FEATURE_AARCH64); } /* Read the CONTROL register as the MRS instruction would. */