Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] GDB: aarch64: Use GCS features to calculate hash of struct aarch64_features
@ 2025-09-17  1:03 Thiago Jung Bauermann
  2025-09-17  2:50 ` Joel Brobecker
  2025-09-17 17:42 ` Luis
  0 siblings, 2 replies; 7+ messages in thread
From: Thiago Jung Bauermann @ 2025-09-17  1:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: Luis, Joel Brobecker

Luis noticed that when adding the gcs and gcs_linux members to struct
aarch64_features in my Guarded Control Stack patch series, I neglected to
modify struct hash<aarch64_features>::operator() to take them into account
when computing its hash.

This can cause GDB to use the wrong aarch64_features object during a
debugging session.

Regression tested on aarch64-linux-gnu.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33440
Suggested-by: Luis <luis.machado.foss@gmail.com>
---

This should also be backported to the branch. Unfortunately I'm not able
to set the target milestone in Bugzilla.

 gdb/arch/aarch64.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gdb/arch/aarch64.h b/gdb/arch/aarch64.h
index 679d845df74e..0fcdba7fb7d6 100644
--- a/gdb/arch/aarch64.h
+++ b/gdb/arch/aarch64.h
@@ -94,6 +94,10 @@ namespace std
 
       /* SME2 feature.  */
       h = h << 1 | features.sme2;
+
+      h = h << 1 | features.gcs;
+      h = h << 1 | features.gcs_linux;
+
       return h;
     }
   };

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] GDB: aarch64: Use GCS features to calculate hash of struct aarch64_features
  2025-09-17  1:03 [PATCH] GDB: aarch64: Use GCS features to calculate hash of struct aarch64_features Thiago Jung Bauermann
@ 2025-09-17  2:50 ` Joel Brobecker
  2025-09-17 14:02   ` Tom Tromey
  2025-09-17 17:42 ` Luis
  1 sibling, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2025-09-17  2:50 UTC (permalink / raw)
  To: Thiago Jung Bauermann; +Cc: gdb-patches, Luis, Joel Brobecker

> This should also be backported to the branch.

Agreed.

> Unfortunately I'm not able
> to set the target milestone in Bugzilla.

That seems surprising to me. Are there limitations to who can change
that field? Or would that be considered a bug?

In the meantime, I set the target milestone.

> 
>  gdb/arch/aarch64.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/gdb/arch/aarch64.h b/gdb/arch/aarch64.h
> index 679d845df74e..0fcdba7fb7d6 100644
> --- a/gdb/arch/aarch64.h
> +++ b/gdb/arch/aarch64.h
> @@ -94,6 +94,10 @@ namespace std
>  
>        /* SME2 feature.  */
>        h = h << 1 | features.sme2;
> +
> +      h = h << 1 | features.gcs;
> +      h = h << 1 | features.gcs_linux;
> +
>        return h;
>      }
>    };

-- 
Joel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] GDB: aarch64: Use GCS features to calculate hash of struct aarch64_features
  2025-09-17  2:50 ` Joel Brobecker
@ 2025-09-17 14:02   ` Tom Tromey
  2025-09-17 20:06     ` Thiago Jung Bauermann
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2025-09-17 14:02 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Thiago Jung Bauermann, gdb-patches, Luis

Joel> That seems surprising to me. Are there limitations to who can change
Joel> that field? Or would that be considered a bug?

I don't know the answer but I do know that if you log in using your
sourceware address you'll have more privileges.

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] GDB: aarch64: Use GCS features to calculate hash of struct aarch64_features
  2025-09-17  1:03 [PATCH] GDB: aarch64: Use GCS features to calculate hash of struct aarch64_features Thiago Jung Bauermann
  2025-09-17  2:50 ` Joel Brobecker
@ 2025-09-17 17:42 ` Luis
  2025-09-17 19:58   ` Thiago Jung Bauermann
  1 sibling, 1 reply; 7+ messages in thread
From: Luis @ 2025-09-17 17:42 UTC (permalink / raw)
  To: Thiago Jung Bauermann, gdb-patches; +Cc: Joel Brobecker

Hi!

On 17/09/2025 02:03, Thiago Jung Bauermann wrote:
> Luis noticed that when adding the gcs and gcs_linux members to struct
> aarch64_features in my Guarded Control Stack patch series, I neglected to
> modify struct hash<aarch64_features>::operator() to take them into account
> when computing its hash.
> 
> This can cause GDB to use the wrong aarch64_features object during a
> debugging session.
> 
> Regression tested on aarch64-linux-gnu.
> 
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33440
> Suggested-by: Luis <luis.machado.foss@gmail.com>
> ---
> 
> This should also be backported to the branch. Unfortunately I'm not able
> to set the target milestone in Bugzilla.
> 
>   gdb/arch/aarch64.h | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/gdb/arch/aarch64.h b/gdb/arch/aarch64.h
> index 679d845df74e..0fcdba7fb7d6 100644
> --- a/gdb/arch/aarch64.h
> +++ b/gdb/arch/aarch64.h
> @@ -94,6 +94,10 @@ namespace std
>   
>         /* SME2 feature.  */
>         h = h << 1 | features.sme2;
> +
> +      h = h << 1 | features.gcs;
> +      h = h << 1 | features.gcs_linux;
> +
>         return h;
>       }
>     };

Thanks for the patch, this is OK for both master and the branch.

Approved-By: Luis Machado <luis.machado.foss@gmail.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] GDB: aarch64: Use GCS features to calculate hash of struct aarch64_features
  2025-09-17 17:42 ` Luis
@ 2025-09-17 19:58   ` Thiago Jung Bauermann
  0 siblings, 0 replies; 7+ messages in thread
From: Thiago Jung Bauermann @ 2025-09-17 19:58 UTC (permalink / raw)
  To: Luis; +Cc: gdb-patches, Joel Brobecker

Luis <luis.machado.foss@gmail.com> writes:

> Hi!
>
> On 17/09/2025 02:03, Thiago Jung Bauermann wrote:
>> Luis noticed that when adding the gcs and gcs_linux members to struct
>> aarch64_features in my Guarded Control Stack patch series, I neglected to
>> modify struct hash<aarch64_features>::operator() to take them into account
>> when computing its hash.
>> This can cause GDB to use the wrong aarch64_features object during a
>> debugging session.
>> Regression tested on aarch64-linux-gnu.
>> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33440
>> Suggested-by: Luis <luis.machado.foss@gmail.com>
>> ---
>> This should also be backported to the branch. Unfortunately I'm not able
>> to set the target milestone in Bugzilla.
>>   gdb/arch/aarch64.h | 4 ++++
>>   1 file changed, 4 insertions(+)
>> diff --git a/gdb/arch/aarch64.h b/gdb/arch/aarch64.h
>> index 679d845df74e..0fcdba7fb7d6 100644
>> --- a/gdb/arch/aarch64.h
>> +++ b/gdb/arch/aarch64.h
>> @@ -94,6 +94,10 @@ namespace std
>>           /* SME2 feature.  */
>>         h = h << 1 | features.sme2;
>> +
>> +      h = h << 1 | features.gcs;
>> +      h = h << 1 | features.gcs_linux;
>> +
>>         return h;
>>       }
>>     };
>
> Thanks for the patch, this is OK for both master and the branch.
>
> Approved-By: Luis Machado <luis.machado.foss@gmail.com>

Thanks! Pushed to the main branch as commit 86e6907244c8, and to
gdb-17-branch as commit 4a21648ec38b.

-- 
Thiago

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] GDB: aarch64: Use GCS features to calculate hash of struct aarch64_features
  2025-09-17 14:02   ` Tom Tromey
@ 2025-09-17 20:06     ` Thiago Jung Bauermann
  2025-09-17 20:54       ` Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Thiago Jung Bauermann @ 2025-09-17 20:06 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Joel Brobecker, gdb-patches, Luis

Tom Tromey <tom@tromey.com> writes:

> Joel> That seems surprising to me. Are there limitations to who can change
> Joel> that field? Or would that be considered a bug?
>
> I don't know the answer but I do know that if you log in using your
> sourceware address you'll have more privileges.

Ah, I wasn't aware of that. I used my Linaro address for the bugzilla
account. I'll request an account with the sourceware address then.

FYI I also can't change the Assignee field.

-- 
Thiago

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] GDB: aarch64: Use GCS features to calculate hash of struct aarch64_features
  2025-09-17 20:06     ` Thiago Jung Bauermann
@ 2025-09-17 20:54       ` Joel Brobecker
  0 siblings, 0 replies; 7+ messages in thread
From: Joel Brobecker @ 2025-09-17 20:54 UTC (permalink / raw)
  To: Thiago Jung Bauermann; +Cc: Tom Tromey, Joel Brobecker, gdb-patches, Luis

> Ah, I wasn't aware of that. I used my Linaro address for the bugzilla
> account. I'll request an account with the sourceware address then.

I would maybe ask overseers first. I use my adacore email address
when logging to Bugzilla, and I have no problem changing those fields.

-- 
Joel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-09-17 20:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-17  1:03 [PATCH] GDB: aarch64: Use GCS features to calculate hash of struct aarch64_features Thiago Jung Bauermann
2025-09-17  2:50 ` Joel Brobecker
2025-09-17 14:02   ` Tom Tromey
2025-09-17 20:06     ` Thiago Jung Bauermann
2025-09-17 20:54       ` Joel Brobecker
2025-09-17 17:42 ` Luis
2025-09-17 19:58   ` Thiago Jung Bauermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox