2017-06-23 21:20:11

by Richard Henderson

[permalink] [raw]
Subject: [PATCH 0/3] Updates for Alpha

(1) Wire up the new syscalls.
(2) Fix a build error causing ld to report out-of-range branches.
(3) Fix a build error for the EV6 assembler.

Suggestions on a better way to implement the second patch within
the Kbuild infrastructure are welcomed.


r~


Richard Henderson (3):
alpha: Update for new syscalls
alpha: Package string routines together
alpha: Fix typo in ev6-copy_user.S

arch/alpha/include/asm/unistd.h | 2 +-
arch/alpha/include/uapi/asm/unistd.h | 14 ++++++++++++++
arch/alpha/kernel/systbls.S | 9 +++++++++
arch/alpha/lib/Makefile | 22 ++++++++++++++++------
arch/alpha/lib/copy_user.S | 2 +-
arch/alpha/lib/ev6-copy_user.S | 7 ++++---
6 files changed, 45 insertions(+), 11 deletions(-)

--
2.9.4


2017-06-23 21:20:14

by Richard Henderson

[permalink] [raw]
Subject: [PATCH 3/3] alpha: Fix typo in ev6-copy_user.S

Patch 8525023121de4848b5f0a7d867ffeadbc477774d introduced a typo.

That said, the identity AND insns added by that patch are more
clearly written as MOV. At the same time, re-schedule the ev6
version so that the first dispatch can execute in parallel.

Signed-off-by: Richard Henderson <[email protected]>
---
arch/alpha/lib/copy_user.S | 2 +-
arch/alpha/lib/ev6-copy_user.S | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/alpha/lib/copy_user.S b/arch/alpha/lib/copy_user.S
index 159f1b7..c277a1a 100644
--- a/arch/alpha/lib/copy_user.S
+++ b/arch/alpha/lib/copy_user.S
@@ -34,7 +34,7 @@
.ent __copy_user
__copy_user:
.prologue 0
- and $18,$18,$0
+ mov $18,$0
and $16,7,$3
beq $0,$35
beq $3,$36
diff --git a/arch/alpha/lib/ev6-copy_user.S b/arch/alpha/lib/ev6-copy_user.S
index 35e6710..954ca03 100644
--- a/arch/alpha/lib/ev6-copy_user.S
+++ b/arch/alpha/lib/ev6-copy_user.S
@@ -45,9 +45,10 @@
# Pipeline info: Slotting & Comments
__copy_user:
.prologue 0
- andq $18, $18, $0
- subq $18, 32, $1 # .. E .. .. : Is this going to be a small copy?
- beq $0, $zerolength # U .. .. .. : U L U L
+ mov $18, $0 # .. .. .. E
+ subq $18, 32, $1 # .. .. E. .. : Is this going to be a small copy?
+ nop # .. E .. ..
+ beq $18, $zerolength # U .. .. .. : U L U L

and $16,7,$3 # .. .. .. E : is leading dest misalignment
ble $1, $onebyteloop # .. .. U .. : 1st branch : small amount of data
--
2.9.4

2017-06-23 21:20:27

by Richard Henderson

[permalink] [raw]
Subject: [PATCH 2/3] alpha: Package string routines together

There are direct branches between {str*cpy,str*cat} and stx*cpy.
Ensure the branches are within range by merging these objects.

Signed-off-by: Richard Henderson <[email protected]>
---
arch/alpha/lib/Makefile | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/arch/alpha/lib/Makefile b/arch/alpha/lib/Makefile
index 7083434..a808159 100644
--- a/arch/alpha/lib/Makefile
+++ b/arch/alpha/lib/Makefile
@@ -20,12 +20,8 @@ lib-y = __divqu.o __remqu.o __divlu.o __remlu.o \
checksum.o \
csum_partial_copy.o \
$(ev67-y)strlen.o \
- $(ev67-y)strcat.o \
- strcpy.o \
- $(ev67-y)strncat.o \
- strncpy.o \
- $(ev6-y)stxcpy.o \
- $(ev6-y)stxncpy.o \
+ stycpy.o \
+ styncpy.o \
$(ev67-y)strchr.o \
$(ev67-y)strrchr.o \
$(ev6-y)memchr.o \
@@ -49,3 +45,17 @@ AFLAGS___remlu.o = -DREM -DINTSIZE
$(addprefix $(obj)/,__divqu.o __remqu.o __divlu.o __remlu.o): \
$(src)/$(ev6-y)divide.S FORCE
$(call if_changed_rule,as_o_S)
+
+# There are direct branches between {str*cpy,str*cat} and stx*cpy.
+# Ensure the branches are within range by merging these objects.
+
+LDFLAGS_stycpy.o := -r
+LDFLAGS_styncpy.o := -r
+
+$(obj)/stycpy.o: $(obj)/strcpy.o $(obj)/$(ev67-y)strcat.o \
+ $(obj)/$(ev6-y)stxcpy.o FORCE
+ $(call if_changed,ld)
+
+$(obj)/styncpy.o: $(obj)/strncpy.o $(obj)/$(ev67-y)strncat.o \
+ $(obj)/$(ev6-y)stxncpy.o FORCE
+ $(call if_changed,ld)
--
2.9.4

2017-06-23 21:20:48

by Richard Henderson

[permalink] [raw]
Subject: [PATCH 1/3] alpha: Update for new syscalls

Signed-off-by: Richard Henderson <[email protected]>
---
arch/alpha/include/asm/unistd.h | 2 +-
arch/alpha/include/uapi/asm/unistd.h | 14 ++++++++++++++
arch/alpha/kernel/systbls.S | 9 +++++++++
3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h
index a56e608..64fcf55 100644
--- a/arch/alpha/include/asm/unistd.h
+++ b/arch/alpha/include/asm/unistd.h
@@ -3,7 +3,7 @@

#include <uapi/asm/unistd.h>

-#define NR_SYSCALLS 514
+#define NR_SYSCALLS 523

#define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_STAT64
diff --git a/arch/alpha/include/uapi/asm/unistd.h b/arch/alpha/include/uapi/asm/unistd.h
index aa33bf5..a2945fe 100644
--- a/arch/alpha/include/uapi/asm/unistd.h
+++ b/arch/alpha/include/uapi/asm/unistd.h
@@ -475,5 +475,19 @@
#define __NR_getrandom 511
#define __NR_memfd_create 512
#define __NR_execveat 513
+#define __NR_seccomp 514
+#define __NR_bpf 515
+#define __NR_userfaultfd 516
+#define __NR_membarrier 517
+#define __NR_mlock2 518
+#define __NR_copy_file_range 519
+#define __NR_preadv2 520
+#define __NR_pwritev2 521
+#define __NR_statx 522
+
+/* Alpha doesn't have protection keys. */
+#define __IGNORE_pkey_mprotect
+#define __IGNORE_pkey_alloc
+#define __IGNORE_pkey_free

#endif /* _UAPI_ALPHA_UNISTD_H */
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S
index 9b62e3f..5b4514a 100644
--- a/arch/alpha/kernel/systbls.S
+++ b/arch/alpha/kernel/systbls.S
@@ -532,6 +532,15 @@ sys_call_table:
.quad sys_getrandom
.quad sys_memfd_create
.quad sys_execveat
+ .quad sys_seccomp
+ .quad sys_bpf /* 515 */
+ .quad sys_userfaultfd
+ .quad sys_membarrier
+ .quad sys_mlock2
+ .quad sys_copy_file_range
+ .quad sys_preadv2 /* 520 */
+ .quad sys_pwritev2
+ .quad sys_statx

.size sys_call_table, . - sys_call_table
.type sys_call_table, @object
--
2.9.4