diff mbox series

aarch64: Update bits/hwcap.h for Linux 4.15.

Message ID 5A5CA700.90604@arm.com
State New
Headers show
Series aarch64: Update bits/hwcap.h for Linux 4.15. | expand

Commit Message

Szabolcs Nagy Jan. 15, 2018, 1:05 p.m. UTC
Define new HWCAP bits and add their name to dl-procinfo.c following
the linux definitions. Synchronizing with v4.15-rc8 version of linux,
these are not expected to change before the 4.15 release.

(Will commit this tomorrow unless there are complaints.)

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

	* sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h (HWCAP_SHA3): Define.
	(HWCAP_SM3, HWCAP_SM4, HWCAP_ASIMDDP, HWCAP_SHA512, HWCAP_SVE): Define.
	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c
	(_dl_aarch64_cap_flags): Update.
	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
	(_DL_HWCAP_COUNT): Update.

Comments

Alan Hayward Jan. 15, 2018, 4:57 p.m. UTC | #1
> On 15 Jan 2018, at 13:05, Szabolcs Nagy <Szabolcs.Nagy@arm.com> wrote:

> 

> Define new HWCAP bits and add their name to dl-procinfo.c following

> the linux definitions. Synchronizing with v4.15-rc8 version of linux,

> these are not expected to change before the 4.15 release.

> 

> (Will commit this tomorrow unless there are complaints.)

> 

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

> 

> 	* sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h (HWCAP_SHA3): Define.

> 	(HWCAP_SM3, HWCAP_SM4, HWCAP_ASIMDDP, HWCAP_SHA512, HWCAP_SVE): Define.

> 	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c

> 	(_dl_aarch64_cap_flags): Update.

> 	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h

> 	(_DL_HWCAP_COUNT): Update.

> <hwcap.diff>


Quickly comparing the the patch I had attempt myself….

I think the 16 here needs updating:
PROCINFO_CLASS const char _dl_aarch64_cap_flags[16][10]

And this needs updating too:
#define _DL_HWCAP_LAST 15


Alan.
Szabolcs Nagy Jan. 15, 2018, 5:17 p.m. UTC | #2
On 15/01/18 16:57, Alan Hayward wrote:
>> On 15 Jan 2018, at 13:05, Szabolcs Nagy <Szabolcs.Nagy@arm.com> wrote:
>>
>> Define new HWCAP bits and add their name to dl-procinfo.c following
>> the linux definitions. Synchronizing with v4.15-rc8 version of linux,
>> these are not expected to change before the 4.15 release.
>>
>> (Will commit this tomorrow unless there are complaints.)
>>
>> 2018-01-15  Szabolcs Nagy  <szabolcs.nagy@arm.com>
>>
>> 	* sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h (HWCAP_SHA3): Define.
>> 	(HWCAP_SM3, HWCAP_SM4, HWCAP_ASIMDDP, HWCAP_SHA512, HWCAP_SVE): Define.
>> 	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c
>> 	(_dl_aarch64_cap_flags): Update.
>> 	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
>> 	(_DL_HWCAP_COUNT): Update.
>> <hwcap.diff>
> 
> Quickly comparing the the patch I had attempt myself….
> 
> I think the 16 here needs updating:
> PROCINFO_CLASS const char _dl_aarch64_cap_flags[16][10]
> 

thanks for catching this.
(i'll change the code so it's less dangerous:
only one macro should be updated)

> And this needs updating too:
> #define _DL_HWCAP_LAST 15

i will remove this macro.
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
index 5a101562e7..569eb07f17 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
@@ -38,3 +38,9 @@ 
 #define HWCAP_FCMA		(1 << 14)
 #define HWCAP_LRCPC		(1 << 15)
 #define HWCAP_DCPOP		(1 << 16)
+#define HWCAP_SHA3		(1 << 17)
+#define HWCAP_SM3		(1 << 18)
+#define HWCAP_SM4		(1 << 19)
+#define HWCAP_ASIMDDP		(1 << 20)
+#define HWCAP_SHA512		(1 << 21)
+#define HWCAP_SVE		(1 << 22)
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c
index 67d7fd6f35..a4787ccf91 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c
@@ -65,7 +65,7 @@  PROCINFO_CLASS const char _dl_aarch64_cap_flags[16][10]
 /* Matches the names in arch/arm64/kernel/cpuinfo.c of Linux.  */
 = { "fp", "asimd", "evtstrm", "aes", "pmull", "sha1", "sha2", "crc32",
     "atomics", "fphp", "asimdhp", "cpuid", "asimdrdm", "jscvt", "fcma",
-    "lrcpc" }
+    "lrcpc", "dcpop", "sha3", "sm3", "sm4", "asimddp", "sha512", "sve" }
 #endif
 #if !defined SHARED || defined PROCINFO_DECL
 ;
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
index dae5e10449..3987934760 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
@@ -28,7 +28,7 @@ 
 #define _dl_procinfo(type, word) -1
 
 /* Number of HWCAP bits set.  */
-#define _DL_HWCAP_COUNT 16
+#define _DL_HWCAP_COUNT 23
 
 /* HWCAP_CPUID should be available by default to influence IFUNC as well as
    library search.  */