Patchwork Add Aarch64 SVE defines

login
register
mail settings
Submitter Alan Hayward
Date Dec. 8, 2017, 2:59 p.m.
Message ID <526853D2-E90B-4206-89B9-D9AAF33D2448@arm.com>
Download mbox | patch
Permalink /patch/24826/
State New
Headers show

Comments

Alan Hayward - Dec. 8, 2017, 2:59 p.m.
This patch adds Aarch64 SVE specific defines to glibc.

The Linux kernel changes for Aarch64 SVE have recently been pulled
into the head:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c9b012e5f4a1d01dfa8abc6318211a67ba7d5db2
Although not due to be in a kernel release until early 2018, we'd
like to make sure any glibc changes are ready for a similar time.

I haven't run any testsuites as the changes are should not effect them.

Is this ok?


Thanks,
Alan.


2017-12-08  Alan Hayward  <alan.hayward@arm.com>

	* elf/elf.h: Add NT_ARM_SVE.
	* sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h: Add HWCAP_SVE.


 elf/elf.h                                    | 2 ++
 sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h | 1 +
 2 files changed, 3 insertions(+)
Szabolcs Nagy - Dec. 12, 2017, 7:02 p.m.
On 08/12/17 14:59, Alan Hayward wrote:
> This patch adds Aarch64 SVE specific defines to glibc.
> 
> The Linux kernel changes for Aarch64 SVE have recently been pulled
> into the head:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c9b012e5f4a1d01dfa8abc6318211a67ba7d5db2
> Although not due to be in a kernel release until early 2018, we'd
> like to make sure any glibc changes are ready for a similar time.
> 
> I haven't run any testsuites as the changes are should not effect them.
> 
> Is this ok?
> 
> 
> Thanks,
> Alan.
> 
> 
> 2017-12-08  Alan Hayward  <alan.hayward@arm.com>
> 
> 	* elf/elf.h: Add NT_ARM_SVE.
> 	* sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h: Add HWCAP_SVE.
> 

nowadays these files need to be updated as well:

sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c

glibc release is in february so we have more time,
ideally we would wait for the kernel release.
Szabolcs Nagy - Jan. 11, 2018, 5:37 p.m.
On 08/12/17 14:59, Alan Hayward wrote:
> This patch adds Aarch64 SVE specific defines to glibc.
...
> 
> 2017-12-08  Alan Hayward  <alan.hayward@arm.com>
> 
> 	* elf/elf.h: Add NT_ARM_SVE.
> 	* sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h: Add HWCAP_SVE.

i plan to apply the elf.h part of this patch
and then do the hwcap.h update separately.
Alan Hayward - Jan. 12, 2018, 9:38 a.m.
> On 11 Jan 2018, at 17:37, Szabolcs Nagy <Szabolcs.Nagy@arm.com> wrote:

> 

> On 08/12/17 14:59, Alan Hayward wrote:

>> This patch adds Aarch64 SVE specific defines to glibc.

> ...

>> 

>> 2017-12-08  Alan Hayward  <alan.hayward@arm.com>

>> 

>> 	* elf/elf.h: Add NT_ARM_SVE.

>> 	* sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h: Add HWCAP_SVE.

> 

> i plan to apply the elf.h part of this patch

> and then do the hwcap.h update separately.

> 


Thanks for that!

I took a look at the dl-procinfo.c and it looked simple enough, but haven’t had
the time test to write the patch. Also, I wasn’t sure the best way to test the code
(Didn’t seem anything relevant in the test suite and I’m not sure how to use libc
to access the changes directly).


Alan.

Patch

diff --git a/elf/elf.h b/elf/elf.h
index 01a43ce9ac..e54a529d51 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -795,6 +795,8 @@  typedef struct
 #define NT_ARM_HW_BREAK        0x402           /* ARM hardware breakpoint registers */
 #define NT_ARM_HW_WATCH        0x403           /* ARM hardware watchpoint registers */
 #define NT_ARM_SYSTEM_CALL     0x404   /* ARM system call number */
+#define NT_ARM_SVE     0x405           /* ARM Scalable Vector Extension
+                                          registers */

 /* Legal values for the note segment descriptor types for object files.  */

diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
index e46bb69118..255ddf0581 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
@@ -38,3 +38,4 @@ 
 #define HWCAP_FCMA             (1 << 14)
 #define HWCAP_LRCPC            (1 << 15)
 #define HWCAP_DCPOP            (1 << 16)
+#define HWCAP_SVE              (1 << 22)