unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Add AArch64 HWCAPs from Linux 5.0
@ 2019-03-18 21:30 Joseph Myers
  2019-03-19  9:51 ` Szabolcs Nagy
  0 siblings, 1 reply; 5+ messages in thread
From: Joseph Myers @ 2019-03-18 21:30 UTC (permalink / raw)
  To: libc-alpha

This patch adds new AArch64 HWCAPs from Linux 5.0 to the AArch64
bits/hwcap.h and dl-procinfo.c.

Tested (compilation only) with build-many-glibcs.py for
aarch64-linux-gnu.

2019-03-18  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h (HWCAP_SB): New
	macro.
	(HWCAP_PACA): Likewise.
	(HWCAP_PACG): Likewise.
	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c (_DL_HWCAP_COUNT):
	Increase to 32.
	(_dl_aarch64_cap_flags): Add new entries for new HWCAPs.

diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
index 9a395c597f..5f50623953 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
@@ -51,3 +51,6 @@
 #define HWCAP_ILRCPC		(1 << 26)
 #define HWCAP_FLAGM		(1 << 27)
 #define HWCAP_SSBS		(1 << 28)
+#define HWCAP_SB		(1 << 29)
+#define HWCAP_PACA		(1 << 30)
+#define HWCAP_PACG		(1UL << 31)
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c
index 30ee7c8176..97cf16fc2d 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c
@@ -57,7 +57,7 @@ PROCINFO_CLASS struct cpu_features _dl_aarch64_cpu_features
 #endif
 
 /* Number of HWCAP bits set.  */
-#define _DL_HWCAP_COUNT 29
+#define _DL_HWCAP_COUNT 32
 
 #if !defined PROCINFO_DECL && defined SHARED
   ._dl_aarch64_cap_flags
@@ -69,7 +69,8 @@ PROCINFO_CLASS const char _dl_aarch64_cap_flags[_DL_HWCAP_COUNT][10]
 = { "fp", "asimd", "evtstrm", "aes", "pmull", "sha1", "sha2", "crc32",
     "atomics", "fphp", "asimdhp", "cpuid", "asimdrdm", "jscvt", "fcma",
     "lrcpc", "dcpop", "sha3", "sm3", "sm4", "asimddp", "sha512", "sve",
-    "asimdfhm", "dit", "uscat", "ilrcpc", "flagm", "ssbs" }
+    "asimdfhm", "dit", "uscat", "ilrcpc", "flagm", "ssbs", "sb", "paca",
+    "pacg" }
 #endif
 #if !defined SHARED || defined PROCINFO_DECL
 ;

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: Add AArch64 HWCAPs from Linux 5.0
  2019-03-18 21:30 Add AArch64 HWCAPs from Linux 5.0 Joseph Myers
@ 2019-03-19  9:51 ` Szabolcs Nagy
  2019-03-19 14:34   ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: Szabolcs Nagy @ 2019-03-19  9:51 UTC (permalink / raw)
  To: Joseph Myers, libc-alpha@sourceware.org; +Cc: nd

On 18/03/2019 21:30, Joseph Myers wrote:
> This patch adds new AArch64 HWCAPs from Linux 5.0 to the AArch64
> bits/hwcap.h and dl-procinfo.c.
> 
> Tested (compilation only) with build-many-glibcs.py for
> aarch64-linux-gnu.
> 
> 2019-03-18  Joseph Myers  <joseph@codesourcery.com>
> 
> 	* sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h (HWCAP_SB): New
> 	macro.
> 	(HWCAP_PACA): Likewise.
> 	(HWCAP_PACG): Likewise.
> 	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c (_DL_HWCAP_COUNT):
> 	Increase to 32.
> 	(_dl_aarch64_cap_flags): Add new entries for new HWCAPs.

This is OK.
thanks.

> diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
> index 9a395c597f..5f50623953 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
> +++ b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
> @@ -51,3 +51,6 @@
>  #define HWCAP_ILRCPC		(1 << 26)
>  #define HWCAP_FLAGM		(1 << 27)
>  #define HWCAP_SSBS		(1 << 28)
> +#define HWCAP_SB		(1 << 29)
> +#define HWCAP_PACA		(1 << 30)
> +#define HWCAP_PACG		(1UL << 31)

Note: we ran out of 32bit hwcaps, so further flags here
would not be compatible with ilp32 auxv.

the plan is to introduce hwcap2 and keep adding flags
there, however that will require a change in ifunc
resolver abi if we want to pass down hwcap2.
i will try to come up with a fix for that in this
release cycle.

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

* Re: Add AArch64 HWCAPs from Linux 5.0
  2019-03-19  9:51 ` Szabolcs Nagy
@ 2019-03-19 14:34   ` Florian Weimer
  2019-03-19 16:03     ` Szabolcs Nagy
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2019-03-19 14:34 UTC (permalink / raw)
  To: Szabolcs Nagy; +Cc: Joseph Myers, libc-alpha@sourceware.org, nd

* Szabolcs Nagy:

>> diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
>> b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
>> index 9a395c597f..5f50623953 100644
>> --- a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
>> +++ b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
>> @@ -51,3 +51,6 @@
>>  #define HWCAP_ILRCPC		(1 << 26)
>>  #define HWCAP_FLAGM		(1 << 27)
>>  #define HWCAP_SSBS		(1 << 28)
>> +#define HWCAP_SB		(1 << 29)
>> +#define HWCAP_PACA		(1 << 30)
>> +#define HWCAP_PACG		(1UL << 31)
>
> Note: we ran out of 32bit hwcaps, so further flags here
> would not be compatible with ilp32 auxv.
>
> the plan is to introduce hwcap2 and keep adding flags
> there, however that will require a change in ifunc
> resolver abi if we want to pass down hwcap2.
> i will try to come up with a fix for that in this
> release cycle.

Yuck.  The last bit should have been used for indicating that
additional IFUNC resolver information is available. 8-(

Is there still a way to fix this without requiring additional ABI
symbols?

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

* Re: Add AArch64 HWCAPs from Linux 5.0
  2019-03-19 14:34   ` Florian Weimer
@ 2019-03-19 16:03     ` Szabolcs Nagy
  2019-03-19 16:07       ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: Szabolcs Nagy @ 2019-03-19 16:03 UTC (permalink / raw)
  To: Florian Weimer; +Cc: nd, Joseph Myers, libc-alpha@sourceware.org

On 19/03/2019 14:34, Florian Weimer wrote:
> * Szabolcs Nagy:
> 
>>> diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
>>> b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
>>> index 9a395c597f..5f50623953 100644
>>> --- a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
>>> +++ b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
>>> @@ -51,3 +51,6 @@
>>>  #define HWCAP_ILRCPC		(1 << 26)
>>>  #define HWCAP_FLAGM		(1 << 27)
>>>  #define HWCAP_SSBS		(1 << 28)
>>> +#define HWCAP_SB		(1 << 29)
>>> +#define HWCAP_PACA		(1 << 30)
>>> +#define HWCAP_PACG		(1UL << 31)
>>
>> Note: we ran out of 32bit hwcaps, so further flags here
>> would not be compatible with ilp32 auxv.
>>
>> the plan is to introduce hwcap2 and keep adding flags
>> there, however that will require a change in ifunc
>> resolver abi if we want to pass down hwcap2.
>> i will try to come up with a fix for that in this
>> release cycle.
> 
> Yuck.  The last bit should have been used for indicating that
> additional IFUNC resolver information is available. 8-(

the ilp32 port passes uint64_t hwcap to the resolver currently
so the top 32bit can be used by glibc to signal the presence
of additional arguments to the resolver (this should work for
both lp64 and ilp32) however i havent worked out yet what
the additional argument should be (so it's extensible reasonably
in the future).

> 
> Is there still a way to fix this without requiring additional ABI
> symbols?
> 


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

* Re: Add AArch64 HWCAPs from Linux 5.0
  2019-03-19 16:03     ` Szabolcs Nagy
@ 2019-03-19 16:07       ` Florian Weimer
  0 siblings, 0 replies; 5+ messages in thread
From: Florian Weimer @ 2019-03-19 16:07 UTC (permalink / raw)
  To: Szabolcs Nagy; +Cc: nd, Joseph Myers, libc-alpha@sourceware.org

* Szabolcs Nagy:

> the ilp32 port passes uint64_t hwcap to the resolver currently
> so the top 32bit can be used by glibc to signal the presence
> of additional arguments to the resolver (this should work for
> both lp64 and ilp32) however i havent worked out yet what
> the additional argument should be (so it's extensible reasonably
> in the future).

It could be a pointer to a struct with the struct size as the first
member.  That's really simple and could work on other architectures,
too.

Or we could delay IFUNC resolvers after other relocations, so that
IFUNC resolvers can use arbitrary data symbols from the dynamic loader
because all data relocations have been processed before they run.
Then we won't have to add additional IFUNC resolver arguments ever
again, and can use the regular ABI maintenance to deal with
compatibility issues.

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

end of thread, other threads:[~2019-03-19 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-18 21:30 Add AArch64 HWCAPs from Linux 5.0 Joseph Myers
2019-03-19  9:51 ` Szabolcs Nagy
2019-03-19 14:34   ` Florian Weimer
2019-03-19 16:03     ` Szabolcs Nagy
2019-03-19 16: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).