public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] aarch64: Revert the change of the __reserved member of mcontext_t
@ 2018-01-23 14:35 Szabolcs Nagy
  2018-01-23 15:17 ` Florian Weimer
  0 siblings, 1 reply; 6+ messages in thread
From: Szabolcs Nagy @ 2018-01-23 14:35 UTC (permalink / raw)
  To: GNU C Library; +Cc: nd, Marcus Shawcroft, Joseph Myers, Romain Naour

[-- Attachment #1: Type: text/plain, Size: 981 bytes --]

The uc_mcontext.__reserved member of ucontext_t is a user visible API,
that should not be changed, because this is the only way to access cpu
states of various extensions of linux asm/sigcontext.h, it does not
violate namespace rules either, so revert this part of the commit

commit 4fa9b3bfe6759c82beb4b043a54a3598ca467289
Commit:     Joseph Myers <joseph@codesourcery.com>

    Fix mcontext_t sigcontext namespace (bug 21457).

(In principle the user can type cast &uc_mcontext to struct sigcontext*
to use the linux sigcontext fields, but that's not the existing practice
since mcontext_t used to be a typedef of struct sigcontext.)

I plan to commit this soon for 2.27 and backport it to 2.26 if there are
no comments.

2018-01-23  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h (__glibc_reserved1):
	Rename to __reserved and add comment.
	* sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym (__glibc_reserved1):
	Rename to __reserved.

[-- Attachment #2: mcontext.diff --]
[-- Type: text/x-patch, Size: 1456 bytes --]

diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h b/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
index fe72fdd265..f1b3ab59e2 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
@@ -56,7 +56,11 @@ typedef struct
     unsigned long long int __ctx(sp);
     unsigned long long int __ctx(pc);
     unsigned long long int __ctx(pstate);
-    unsigned char __glibc_reserved1[4096] __attribute__ ((__aligned__ (16)));
+    /* This field contains extension records for additional processor
+       state such as the FP/SIMD state.  It has to match the definition
+       of the corresponding field in the sigcontext struct, see the
+       arch/arm64/include/uapi/asm/sigcontext.h linux header for details.  */
+    unsigned char __reserved[4096] __attribute__ ((__aligned__ (16)));
   } mcontext_t;
 
 /* Userlevel context.  */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym b/sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym
index 479bdda5c6..ab3930c173 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym
+++ b/sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym
@@ -38,7 +38,7 @@ oX0				mcontext (regs)
 oSP				mcontext (sp)
 oPC				mcontext (pc)
 oPSTATE				mcontext (pstate)
-oEXTENSION                      mcontext (__glibc_reserved1)
+oEXTENSION                      mcontext (__reserved)
 
 #define fpsimd_context(member)  offsetof (struct fpsimd_context, member)
 

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

* Re: [PATCH] aarch64: Revert the change of the __reserved member of mcontext_t
  2018-01-23 14:35 [PATCH] aarch64: Revert the change of the __reserved member of mcontext_t Szabolcs Nagy
@ 2018-01-23 15:17 ` Florian Weimer
  2018-01-24 11:56   ` Szabolcs Nagy
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Weimer @ 2018-01-23 15:17 UTC (permalink / raw)
  To: Szabolcs Nagy, GNU C Library
  Cc: nd, Marcus Shawcroft, Joseph Myers, Romain Naour

On 01/23/2018 03:35 PM, Szabolcs Nagy wrote:
> The uc_mcontext.__reserved member of ucontext_t is a user visible API,
> that should not be changed, because this is the only way to access cpu
> states of various extensions of linux asm/sigcontext.h, it does not
> violate namespace rules either, so revert this part of the commit
> 
> commit 4fa9b3bfe6759c82beb4b043a54a3598ca467289
> Commit:     Joseph Myers<joseph@codesourcery.com>
> 
>      Fix mcontext_t sigcontext namespace (bug 21457).
> 
> (In principle the user can type cast &uc_mcontext to struct sigcontext*
> to use the linux sigcontext fields, but that's not the existing practice
> since mcontext_t used to be a typedef of struct sigcontext.)
> 
> I plan to commit this soon for 2.27 and backport it to 2.26 if there are
> no comments.

I think this is the right thing to do, but unfortunately, this 
back-and-forth is a bit painful.

Thanks,
Florian

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

* Re: [PATCH] aarch64: Revert the change of the __reserved member of mcontext_t
  2018-01-23 15:17 ` Florian Weimer
@ 2018-01-24 11:56   ` Szabolcs Nagy
  2018-01-24 21:36     ` Romain Naour
  2018-01-26 17:07     ` Szabolcs Nagy
  0 siblings, 2 replies; 6+ messages in thread
From: Szabolcs Nagy @ 2018-01-24 11:56 UTC (permalink / raw)
  To: Florian Weimer, GNU C Library
  Cc: nd, Marcus Shawcroft, Joseph Myers, Romain Naour

On 23/01/18 15:16, Florian Weimer wrote:
> On 01/23/2018 03:35 PM, Szabolcs Nagy wrote:
>> The uc_mcontext.__reserved member of ucontext_t is a user visible API,
>> that should not be changed, because this is the only way to access cpu
>> states of various extensions of linux asm/sigcontext.h, it does not
>> violate namespace rules either, so revert this part of the commit
>>
>> commit 4fa9b3bfe6759c82beb4b043a54a3598ca467289
>> Commit:     Joseph Myers<joseph@codesourcery.com>
>>
>>      Fix mcontext_t sigcontext namespace (bug 21457).
>>
>> (In principle the user can type cast &uc_mcontext to struct sigcontext*
>> to use the linux sigcontext fields, but that's not the existing practice
>> since mcontext_t used to be a typedef of struct sigcontext.)
>>
>> I plan to commit this soon for 2.27 and backport it to 2.26 if there are
>> no comments.
> 
> I think this is the right thing to do, but unfortunately, this back-and-forth is a bit painful.
> 

ok, i opened bug 22742 because it's a user visible change.

committed now on 2.27 (will backport it in a day or two).

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

* Re: [PATCH] aarch64: Revert the change of the __reserved member of mcontext_t
  2018-01-24 11:56   ` Szabolcs Nagy
@ 2018-01-24 21:36     ` Romain Naour
  2018-01-26 17:07     ` Szabolcs Nagy
  1 sibling, 0 replies; 6+ messages in thread
From: Romain Naour @ 2018-01-24 21:36 UTC (permalink / raw)
  To: Szabolcs Nagy, Florian Weimer, GNU C Library
  Cc: nd, Marcus Shawcroft, Joseph Myers

Hi Nagy,

Le 24/01/2018 à 12:55, Szabolcs Nagy a écrit :
> On 23/01/18 15:16, Florian Weimer wrote:
>> On 01/23/2018 03:35 PM, Szabolcs Nagy wrote:
>>> The uc_mcontext.__reserved member of ucontext_t is a user visible API,
>>> that should not be changed, because this is the only way to access cpu
>>> states of various extensions of linux asm/sigcontext.h, it does not
>>> violate namespace rules either, so revert this part of the commit
>>>
>>> commit 4fa9b3bfe6759c82beb4b043a54a3598ca467289
>>> Commit:     Joseph Myers<joseph@codesourcery.com>
>>>
>>>      Fix mcontext_t sigcontext namespace (bug 21457).
>>>
>>> (In principle the user can type cast &uc_mcontext to struct sigcontext*
>>> to use the linux sigcontext fields, but that's not the existing practice
>>> since mcontext_t used to be a typedef of struct sigcontext.)
>>>
>>> I plan to commit this soon for 2.27 and backport it to 2.26 if there are
>>> no comments.
>>
>> I think this is the right thing to do, but unfortunately, this back-and-forth is a bit painful.
>>
> 
> ok, i opened bug 22742 because it's a user visible change.
> 
> committed now on 2.27 (will backport it in a day or two).
> 

Thanks for the fix.

Best regards,
Romain

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

* Re: [PATCH] aarch64: Revert the change of the __reserved member of mcontext_t
  2018-01-24 11:56   ` Szabolcs Nagy
  2018-01-24 21:36     ` Romain Naour
@ 2018-01-26 17:07     ` Szabolcs Nagy
  2018-01-26 17:07       ` Florian Weimer
  1 sibling, 1 reply; 6+ messages in thread
From: Szabolcs Nagy @ 2018-01-26 17:07 UTC (permalink / raw)
  To: Florian Weimer, GNU C Library
  Cc: nd, Marcus Shawcroft, Joseph Myers, Romain Naour

On 24/01/18 11:55, Szabolcs Nagy wrote:
> On 23/01/18 15:16, Florian Weimer wrote:
>> On 01/23/2018 03:35 PM, Szabolcs Nagy wrote:
>>> The uc_mcontext.__reserved member of ucontext_t is a user visible API,
>>> that should not be changed, because this is the only way to access cpu
>>> states of various extensions of linux asm/sigcontext.h, it does not
>>> violate namespace rules either, so revert this part of the commit
>>>
>>> commit 4fa9b3bfe6759c82beb4b043a54a3598ca467289
>>> Commit:     Joseph Myers<joseph@codesourcery.com>
>>>
>>>       Fix mcontext_t sigcontext namespace (bug 21457).
>>>
>>> (In principle the user can type cast &uc_mcontext to struct sigcontext*
>>> to use the linux sigcontext fields, but that's not the existing practice
>>> since mcontext_t used to be a typedef of struct sigcontext.)
>>>
>>> I plan to commit this soon for 2.27 and backport it to 2.26 if there are
>>> no comments.
>>
>> I think this is the right thing to do, but unfortunately, this back-and-forth is a bit painful.
>>
> 
> ok, i opened bug 22742 because it's a user visible change.
> 
> committed now on 2.27 (will backport it in a day or two).
> 

the problematic commit is not present in 2.26, so
this is not a 2.26 regression, i'm not sure how i
missed that (i checked the git log of 2.26 branch
several times).

so there is no user visible api break, sorry for the noise.

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

* Re: [PATCH] aarch64: Revert the change of the __reserved member of mcontext_t
  2018-01-26 17:07     ` Szabolcs Nagy
@ 2018-01-26 17:07       ` Florian Weimer
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Weimer @ 2018-01-26 17:07 UTC (permalink / raw)
  To: Szabolcs Nagy, GNU C Library
  Cc: nd, Marcus Shawcroft, Joseph Myers, Romain Naour

On 01/26/2018 04:02 PM, Szabolcs Nagy wrote:
> On 24/01/18 11:55, Szabolcs Nagy wrote:
>> On 23/01/18 15:16, Florian Weimer wrote:
>>> On 01/23/2018 03:35 PM, Szabolcs Nagy wrote:
>>>> The uc_mcontext.__reserved member of ucontext_t is a user visible API,
>>>> that should not be changed, because this is the only way to access cpu
>>>> states of various extensions of linux asm/sigcontext.h, it does not
>>>> violate namespace rules either, so revert this part of the commit
>>>>
>>>> commit 4fa9b3bfe6759c82beb4b043a54a3598ca467289
>>>> Commit:     Joseph Myers<joseph@codesourcery.com>
>>>>
>>>>       Fix mcontext_t sigcontext namespace (bug 21457).
>>>>
>>>> (In principle the user can type cast &uc_mcontext to struct sigcontext*
>>>> to use the linux sigcontext fields, but that's not the existing 
>>>> practice
>>>> since mcontext_t used to be a typedef of struct sigcontext.)
>>>>
>>>> I plan to commit this soon for 2.27 and backport it to 2.26 if there 
>>>> are
>>>> no comments.
>>>
>>> I think this is the right thing to do, but unfortunately, this 
>>> back-and-forth is a bit painful.
>>>
>>
>> ok, i opened bug 22742 because it's a user visible change.
>>
>> committed now on 2.27 (will backport it in a day or two).
>>
> 
> the problematic commit is not present in 2.26, so
> this is not a 2.26 regression, i'm not sure how i
> missed that (i checked the git log of 2.26 branch
> several times).
> 
> so there is no user visible api break, sorry for the noise.

Right, my mistake.  Thanks for fixing master!

Florian

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

end of thread, other threads:[~2018-01-26 15:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23 14:35 [PATCH] aarch64: Revert the change of the __reserved member of mcontext_t Szabolcs Nagy
2018-01-23 15:17 ` Florian Weimer
2018-01-24 11:56   ` Szabolcs Nagy
2018-01-24 21:36     ` Romain Naour
2018-01-26 17:07     ` Szabolcs Nagy
2018-01-26 17:07       ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).