From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CWTrAn/x/2i2dgwAWB0awg (envelope-from ) for ; Mon, 27 Oct 2025 18:26:07 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=AcN0F5R1; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id F18B51E057; Mon, 27 Oct 2025 18:26:06 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 75E401E057 for ; Mon, 27 Oct 2025 18:26:06 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DEF313858C54 for ; Mon, 27 Oct 2025 22:26:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEF313858C54 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=AcN0F5R1 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 704853858D20 for ; Mon, 27 Oct 2025 22:25:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 704853858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 704853858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::330 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1761603930; cv=none; b=is63BNezzHwdUURWwJGm+ZmiUyq95q7iEaigoo3vTfSnPsPqqH58bD7ANA/NVP9uorvQYbudkm10dPk6+UhhA3yg2jGrvzc33tsYOcCK1NBjNupOXL1VK2fiWcp+XvCoHyV40WtDeNyTbtkaP8nt1aJhR/TO3XUpwRpqzqVeq0U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1761603930; c=relaxed/simple; bh=zc/7BfT9pQCjGOrqQw1TO5cWxY4HAH/ThT08WI8USo4=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=CgaxQlvZU2SLKLta7BFl2avRu/AmO1u0rTUXV61rgqfynf8HiR42gRElM1Sc5STicLt1zCIVNqBvmiZ4SQ15RN1aCUbi571qNyRLdrAnqUw7v2oO++rnMnmnd8NFYyr4vVgRwDbvjJzWEiBD5JEHExe4t0ttENEy58LtynCPH6Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 704853858D20 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4711b95226dso65092915e9.0 for ; Mon, 27 Oct 2025 15:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761603929; x=1762208729; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/Z3+NaV2rgoJpgtx+GkQ3TMvnOr8kw2krC+Dpqpzyjo=; b=AcN0F5R15/efkBqwO2tsoL80Z97R15ZBotnSHzlTbmyrqbiuSreylX3OsfSSwqQuzz OaQ0MBW9xiKuQEj4938u4DCXyzV84GwlMsyvFgf1vS/TJbFuQP0NvC8cenZKr0A+tHG8 p6MkKba/hl4o8NyDgirAVny0dDTyoPt0Ma0moJAu5ZPthHZwTrPUt1gn/TcJJaosOdv5 Je55HDrKdBam240gYknvPfok2ba9Izy2eHtC2DpzkfvcwHvsEi0ey1qzbVlHoUl0GIyy OdIU5ZCaUarAn8ZQgcWx8UiBREM8EE/MtzMAfB/iLj1sZsPm7pAEyhZGx9OOxWiHkQTF cDBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761603929; x=1762208729; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/Z3+NaV2rgoJpgtx+GkQ3TMvnOr8kw2krC+Dpqpzyjo=; b=SBOC/YfxO1VjUruTsk4o6ddkJTnlx0/YlNwaDleHkbJJ4B3z67NDxW/4xQpzWUBXIN lgxjNHwZCmo3uVN9ipAt9c4oXmQu6L3djWIQ1HfhQGuPx+5AvM8Xx8pA2/idpW/X/NUg ZcZFwtZ0V7gr5RpdpT9ub/MfYMCI5gPdWsylfNlDZRnS8b4Txnc621ItgtOG/vNuaGQt Tanx8Gh66WFDojtUbqVeGMGyhipistLBaQ+1nS9SVsPlTyJM7RlpDN0ueGHD2HNN1yoT ytt38T8DPzkl6g1WWyMI1NNnAEaMqOugCitOn+BntvU1AoRFOW9Irroze9js/6f8nzS+ U8CQ== X-Forwarded-Encrypted: i=1; AJvYcCV//rDXMRjfBHYnRG2j9zOWQ3fjP6z0FXOMMKOGQe7snLaJZ++m0p6PjYMq2zMKcGusSpESJKDQYATw8Q==@sourceware.org X-Gm-Message-State: AOJu0Yy+FE1VIwWqg2i7EVHPCPi/BkOZNkBAFRWFozHXGTM0ZUdQOpE1 MnV7m5xL8Va8pjDRf5xoGZHGVn3N1ordsrNYkokSdiwMcavtO4pO88yD X-Gm-Gg: ASbGncvdbtmNNhltbYAIrJpgBwB14IrnzUEsDoxoF2YwrQTbBWCD5d8b0bkXfa7VT59 kPHnVIVzEYiq01IDMsF9x799bSqsG6vp8ph+icpYLLw9Z2YevyNTiQ+C4TLIOwh8enE5CwESi9I UediiuoSKfu4M8MxOI28rxjz+ByGavaiWFghoOw+kBMqMU0M+R/wQ7ljtGK8zS/p2YnR14icRpe rBenBE7bKQPcq0SS0u3u0IMruvoN57IPrLjX3ZanHf+/pmk8IVFoDx4s1TONxv+WB72r+OLYzRb 6d0sVtsOmIbjJsL4rjo33BRA5kWo19POnHmgeSVEJgOma2UiG+BJcEb44o152N5UmKYWTXHLF94 nDDEDJCs6pNrcV44m3fCq3tdVzHnmhtACzJtzzKxGlVFvitLPk67QiS+KAScg13/a2lKxNwakKd XSWYIKCGrkqHpIQ5732VVPDEg= X-Google-Smtp-Source: AGHT+IFyeJMWxh9zgJVfYDTTX5ZlBAACDkR4id8xk92NwKF/7CMv/dKxA50092NuZYx1vX1CCDO8vw== X-Received: by 2002:a05:6000:2912:b0:427:376:2f81 with SMTP id ffacd0b85a97d-429a7e4ebc2mr1252810f8f.5.1761603929029; Mon, 27 Oct 2025 15:25:29 -0700 (PDT) Received: from [192.168.0.38] ([86.12.216.189]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952df3c7sm16329405f8f.40.2025.10.27.15.25.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Oct 2025 15:25:27 -0700 (PDT) Message-ID: <09843fcb-22d7-43f8-9eca-aea4e98b268f@gmail.com> Date: Mon, 27 Oct 2025 22:25:26 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 3/6] gdb/aarch64: signal frame support for fpmr Content-Language: en-US To: Ezra.Sitorus@arm.com, gdb-patches@sourceware.org Cc: thiago.bauermann@linaro.org References: <20251021150300.59860-1-Ezra.Sitorus@arm.com> <20251021150300.59860-4-Ezra.Sitorus@arm.com> From: Luis In-Reply-To: <20251021150300.59860-4-Ezra.Sitorus@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 21/10/2025 16:02, Ezra.Sitorus@arm.com wrote: > From: Ezra Sitorus > > Add support for FPMR in signal frames and restore contents of FPMR. > --- > Changes from v1->v2: > * Addressed comments/whitespace/formatting issues. > * gdb/arch/aarch64.h: operator() takes fpmr into account now. > * Defined HWCAP2_FPMR in gdb/arch/aarch64.h > > Changes from v2-v3: > * Formatting fixes. > * Moved initialisation of fpmr variables closer to where they are used. > > Ezra > > gdb/aarch64-linux-tdep.c | 34 ++++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > > diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c > index 10b44d978af..5346ae39eda 100644 > --- a/gdb/aarch64-linux-tdep.c > +++ b/gdb/aarch64-linux-tdep.c > @@ -167,6 +167,7 @@ > #define AARCH64_TPIDR2_MAGIC 0x54504902 > #define AARCH64_ZT_MAGIC 0x5a544e01 > #define AARCH64_GCS_MAGIC 0x47435300 > +#define AARCH64_FPMR_MAGIC 0x46504d52 > > /* Defines for the extra_context that follows an AARCH64_EXTRA_MAGIC. */ > #define AARCH64_EXTRA_DATAP_OFFSET 8 > @@ -213,6 +214,9 @@ > /* features_enabled value offset in the GCS signal frame context. */ > #define AARCH64_GCS_CONTEXT_FEATURES_ENABLED_OFFSET 16 > > +/* FPMR constants. */ > +#define AARCH64_FPMR_OFFSET 8 > + > /* Holds information about the signal frame. */ > struct aarch64_linux_sigframe > { > @@ -260,6 +264,12 @@ struct aarch64_linux_sigframe > uint64_t gcspr; > /* Flags indicating which GCS features are enabled for the thread. */ > uint64_t gcs_features_enabled; > + > + /* True if we have an FPMR entry in the signal context, false otherwise. */ > + bool fpmr_available = false; > + /* FPMR value. */ > + CORE_ADDR fpmr = 0; > + > }; > > /* Read an aarch64_ctx, returning the magic value, and setting *SIZE to the > @@ -576,6 +586,22 @@ aarch64_linux_read_signal_frame_info (const frame_info_ptr &this_frame, > section += size; > break; > } > + case AARCH64_FPMR_MAGIC: > + { > + gdb_byte buf[8]; > + if (target_read_memory (section + AARCH64_FPMR_OFFSET, > + buf, 8) != 0) > + { > + warning (_("Failed to read the FPMR section address from the" > + " signal frame context.")); > + section += size; > + break; > + } > + signal_frame.fpmr = extract_unsigned_integer (buf, 8, byte_order); > + signal_frame.fpmr_available = true; > + section += size; > + break; > + } > case AARCH64_EXTRA_MAGIC: > { > /* Extra is always the last valid section in reserved and points to > @@ -739,6 +765,13 @@ aarch64_linux_sigframe_init (const struct tramp_frame *self, > } > } > > + /* Handle FPMR. */ > + if (tdep->has_fpmr () && signal_frame.fpmr_available != 0) > + { > + trad_frame_set_reg_value (this_cache, tdep->fpmr_regnum, > + signal_frame.fpmr); > + } > + > /* Restore the tpidr2 register, if the target supports it and if there is > an entry for it. */ > if (signal_frame.tpidr2_section != 0 && tdep->has_tls () > @@ -791,6 +824,7 @@ aarch64_linux_sigframe_prev_arch (const frame_info_ptr &this_frame, > aarch64_features features = aarch64_features_from_target_desc (tdesc); > features.vq = sve_vq_from_vl (signal_frame.vl); > features.svq = (uint8_t) sve_vq_from_vl (signal_frame.svl); > + features.fpmr = signal_frame.fpmr_available; > > struct gdbarch_info info; > info.bfd_arch_info = bfd_lookup_arch (bfd_arch_aarch64, bfd_mach_aarch64); This is OK. Thanks! Approved-By: Luis Machado