Skip to contentSkip to conversation

Updates for Alpha

PATCH New Richard Henderson 1 participant 4 messages Jun 23, 2017 Alpha port

lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
2.9.4
#1 lore raw

PATCH 1/3 alpha: Update for new syscalls

---
 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(-)
arch/alpha/include/asm/unistd.h +1 -1
index a56e608..64fcf55 100644
@@ -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
arch/alpha/include/uapi/asm/unistd.h +14 -0
index aa33bf5..a2945fe 100644
@@ -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 */
arch/alpha/kernel/systbls.S +9 -0
index 9b62e3f..5b4514a 100644
@@ -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
Signature · 1 line
2.9.4
#2 lore raw

PATCH 2/3 alpha: Package string routines together

In reply to Richard Henderson

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

---
 arch/alpha/lib/Makefile | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)
arch/alpha/lib/Makefile +16 -6
index 7083434..a808159 100644
@@ -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)
Signature · 1 line
2.9.4
#3 lore raw

PATCH 3/3 alpha: Fix typo in ev6-copy_user.S

In reply to Richard Henderson

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.

---
 arch/alpha/lib/copy_user.S     | 2 +-
 arch/alpha/lib/ev6-copy_user.S | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
arch/alpha/lib/copy_user.S +1 -1
index 159f1b7..c277a1a 100644
@@ -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
arch/alpha/lib/ev6-copy_user.S +4 -3
index 35e6710..954ca03 100644
@@ -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
Signature · 1 line
2.9.4