Skip to contentSkip to conversation

syscall.2: Minor register name fixes for arm/arm64

PATCH In review Dave Martin 4 participants 11 messages May 5, 2020 – May 6, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

cover syscall.2: Minor register name fixes for arm/arm64

There are a few inconsistencies in the way registers are named when describing the arm and arm64 syscall interfaces.

While fairly harmless, it's probably worth fixing them.

Dave Martin (2):
syscall.2: arm: Use real register names for arm/OABI syscall.2: arm64: Fix syscall number register size

 man2/syscall.2 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/2 syscall.2: arm: Use real register names for arm/OABI

The arm OABI syscall interface is currently documented in terms of register name aliases defined by the ARM Procedure Call Standard (APCS). However, these don't make sense in the context of a binary interface that doesn't comply (or need to comply) with APCS.

Use the real architectural register names instead.

The names a1-a4, v1... are just aliases for r0-r3, r4... anyway, so the interface is just the same regardless of which set of names is used.

---
 man2/syscall.2 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man2/syscall.2 +2 -2
index f2b277b..53ab40e 100644
@@ -201,7 +201,7 @@ Arch/ABI	Instruction	System	Ret	Ret	Error	Notes
 _
 alpha	callsys	v0	v0	a4	a3	1, 6
 arc	trap0	r8	r0	-	-
-arm/OABI	swi NR	-	a1	-	-	2
+arm/OABI	swi NR	-	r0	-	-	2
 arm/EABI	swi 0x0	r7	r0	r1	-
 arm64	svc #0	x8	x0	x1	-
 blackfin	excpt 0x0	P0	R0	-	-
@@ -332,7 +332,7 @@ Arch/ABI	arg1	arg2	arg3	arg4	arg5	arg6	arg7	Notes
 _
 alpha	a0	a1	a2	a3	a4	a5	-
 arc	r0	r1	r2	r3	r4	r5	-
-arm/OABI	a1	a2	a3	a4	v1	v2	v3
+arm/OABI	r0	r1	r2	r3	r4	r5	r6
 arm/EABI	r0	r1	r2	r3	r4	r5	r6
 arm64	x0	x1	x2	x3	x4	x5	-
 blackfin	R0	R1	R2	R3	R4	R5	-
Signature · 1 line
2.1.4
Acked-by Russell King on v1 1/2
#2 lore raw

Re: [PATCH 1/2] syscall.2: arm: Use real register names for arm/OABI

Quoted 5 lines · Dave Martin

The arm OABI syscall interface is currently documented in terms of register name aliases defined by the ARM Procedure Call Standard (APCS). However, these don't make sense in the context of a binary interface that doesn't comply (or need to comply) with APCS.

Quoted 7 lines

Use the real architectural register names instead.

The names a1-a4, v1... are just aliases for r0-r3, r4... anyway, so the interface is just the same regardless of which set of names is used.

Thanks Dave,

Quoted 30 lines
---
 man2/syscall.2 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man2/syscall.2 +2 -2
index f2b277b..53ab40e 100644
@@ -201,7 +201,7 @@ Arch/ABI	Instruction	System	Ret	Ret	Error	Notes
 _
 alpha	callsys	v0	v0	a4	a3	1, 6
 arc	trap0	r8	r0	-	-
-arm/OABI	swi NR	-	a1	-	-	2
+arm/OABI	swi NR	-	r0	-	-	2
 arm/EABI	swi 0x0	r7	r0	r1	-
 arm64	svc #0	x8	x0	x1	-
 blackfin	excpt 0x0	P0	R0	-	-
@@ -332,7 +332,7 @@ Arch/ABI	arg1	arg2	arg3	arg4	arg5	arg6	arg7	Notes
 _
 alpha	a0	a1	a2	a3	a4	a5	-
 arc	r0	r1	r2	r3	r4	r5	-
-arm/OABI	a1	a2	a3	a4	v1	v2	v3
+arm/OABI	r0	r1	r2	r3	r4	r5	r6
 arm/EABI	r0	r1	r2	r3	r4	r5	r6
 arm64	x0	x1	x2	x3	x4	x5	-
 blackfin	R0	R1	R2	R3	R4	R5	-
Signature · 1 line
2.1.4
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up
#3 lore raw

Re: [PATCH 1/2] syscall.2: arm: Use real register names for arm/OABI

Quoted 12 lines · Russell King - ARM Linux admin
Quoted 11 lines · Dave Martin

The arm OABI syscall interface is currently documented in terms of register name aliases defined by the ARM Procedure Call Standard (APCS). However, these don't make sense in the context of a binary interface that doesn't comply (or need to comply) with APCS.

Use the real architectural register names instead.

The names a1-a4, v1... are just aliases for r0-r3, r4... anyway, so the interface is just the same regardless of which set of names is used.

Quoted 5 lines
Quoted 1 line

Thanks Dave,

Thanks!
---Dave

#4 lore raw

Re: [PATCH 1/2] syscall.2: arm: Use real register names for arm/OABI

In reply to Dave Martin
Quoted 5 lines · Dave Martin

The arm OABI syscall interface is currently documented in terms of register name aliases defined by the ARM Procedure Call Standard (APCS). However, these don't make sense in the context of a binary interface that doesn't comply (or need to comply) with APCS.

Quoted 7 lines

Use the real architectural register names instead.

The names a1-a4, v1... are just aliases for r0-r3, r4... anyway, so the interface is just the same regardless of which set of names is used.

Thanks, Dave. Patch applied, with Russell's Acked-by added.

Cheers,

Michael

Quoted 27 lines
---
 man2/syscall.2 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man2/syscall.2 +2 -2
index f2b277b..53ab40e 100644
@@ -201,7 +201,7 @@ Arch/ABI	Instruction	System	Ret	Ret	Error	Notes
 _
 alpha	callsys	v0	v0	a4	a3	1, 6
 arc	trap0	r8	r0	-	-
-arm/OABI	swi NR	-	a1	-	-	2
+arm/OABI	swi NR	-	r0	-	-	2
 arm/EABI	swi 0x0	r7	r0	r1	-
 arm64	svc #0	x8	x0	x1	-
 blackfin	excpt 0x0	P0	R0	-	-
@@ -332,7 +332,7 @@ Arch/ABI	arg1	arg2	arg3	arg4	arg5	arg6	arg7	Notes
 _
 alpha	a0	a1	a2	a3	a4	a5	-
 arc	r0	r1	r2	r3	r4	r5	-
-arm/OABI	a1	a2	a3	a4	v1	v2	v3
+arm/OABI	r0	r1	r2	r3	r4	r5	r6
 arm/EABI	r0	r1	r2	r3	r4	r5	r6
 arm64	x0	x1	x2	x3	x4	x5	-
 blackfin	R0	R1	R2	R3	R4	R5	-
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
#5 lore raw

Re: [PATCH 1/2] syscall.2: arm: Use real register names for arm/OABI

Quoted 12 lines · Michael Kerrisk (man-pages)
Quoted 11 lines · Dave Martin

The arm OABI syscall interface is currently documented in terms of register name aliases defined by the ARM Procedure Call Standard (APCS). However, these don't make sense in the context of a binary interface that doesn't comply (or need to comply) with APCS.

Use the real architectural register names instead.

The names a1-a4, v1... are just aliases for r0-r3, r4... anyway, so the interface is just the same regardless of which set of names is used.

Quoted 7 lines
Quoted 1 line

Thanks, Dave. Patch applied, with Russell's Acked-by added.

Cheers,

Michael

Thanks!
---Dave

#6 lore raw

PATCH 2/2 syscall.2: arm64: Fix syscall number register size

In reply to Dave Martin

arm64 is currently documented as receiving the syscall number in x8.

While this is the correct register, the syscall number is a 32-bit integer. Bits [63:32] are ignored by the kernel.

So it is more correct to say "w8".

---
 man2/syscall.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man2/syscall.2 +1 -1
index 53ab40e..d724651 100644
@@ -203,7 +203,7 @@ alpha	callsys	v0	v0	a4	a3	1, 6
 arc	trap0	r8	r0	-	-
 arm/OABI	swi NR	-	r0	-	-	2
 arm/EABI	swi 0x0	r7	r0	r1	-
-arm64	svc #0	x8	x0	x1	-
+arm64	svc #0	w8	x0	x1	-
 blackfin	excpt 0x0	P0	R0	-	-
 i386	int $0x80	eax	eax	edx	-
 ia64	break 0x100000	r15	r8	r9	r10	1, 6
Signature · 1 line
2.1.4
Acked-by on v1 2/2
#7 lore raw

Re: [PATCH 2/2] syscall.2: arm64: Fix syscall number register size

Quoted 18 lines · Dave Martin

arm64 is currently documented as receiving the syscall number in x8.

While this is the correct register, the syscall number is a 32-bit integer. Bits [63:32] are ignored by the kernel.

So it is more correct to say "w8".

---
 man2/syscall.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man2/syscall.2 +0 -0
index 53ab40e..d724651 100644

man2/syscall.2 alpha callsys v0 v0 a4 a3 1, 6 · line 206

Quoted 5 lines
man2/syscall.2 +1 -1
@@ -203,7 +203,7 @@ alpha	callsys	v0	v0	a4	a3	1, 6
 arc	trap0	r8	r0	-	-
 arm/OABI	swi NR	-	r0	-	-	2
 arm/EABI	swi 0x0	r7	r0	r1	-
-arm64	svc #0	x8	x0	x1	-
+arm64	svc #0	w8	x0	x1	-

Will

#8 lore raw

Re: [PATCH 2/2] syscall.2: arm64: Fix syscall number register size

Quoted 14 lines · Will Deacon
Quoted 13 lines · Dave Martin

arm64 is currently documented as receiving the syscall number in x8.

While this is the correct register, the syscall number is a 32-bit integer. Bits [63:32] are ignored by the kernel.

So it is more correct to say "w8".

---
 man2/syscall.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

man2/syscall.2 alpha callsys v0 v0 a4 a3 1, 6 · line 206

Quoted 10 lines
man2/syscall.2 +1 -1
index 53ab40e..d724651 100644
@@ -203,7 +203,7 @@ alpha	callsys	v0	v0	a4	a3	1, 6
 arc	trap0	r8	r0	-	-
 arm/OABI	swi NR	-	r0	-	-	2
 arm/EABI	swi 0x0	r7	r0	r1	-
-arm64	svc #0	x8	x0	x1	-
+arm64	svc #0	w8	x0	x1	-

Thanks!

---Dave

#9 lore raw

Re: [PATCH 2/2] syscall.2: arm64: Fix syscall number register size

In reply to Dave Martin
Quoted 7 lines · Dave Martin

arm64 is currently documented as receiving the syscall number in x8.

While this is the correct register, the syscall number is a 32-bit integer. Bits [63:32] are ignored by the kernel.

So it is more correct to say "w8".

Thanks, Dave. Patch applied, with Will's Acked-by.

Cheers,

Michael

Quoted 19 lines
---
 man2/syscall.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man2/syscall.2 +1 -1
index 53ab40e..d724651 100644
@@ -203,7 +203,7 @@ alpha	callsys	v0	v0	a4	a3	1, 6
 arc	trap0	r8	r0	-	-
 arm/OABI	swi NR	-	r0	-	-	2
 arm/EABI	swi 0x0	r7	r0	r1	-
-arm64	svc #0	x8	x0	x1	-
+arm64	svc #0	w8	x0	x1	-
 blackfin	excpt 0x0	P0	R0	-	-
 i386	int $0x80	eax	eax	edx	-
 ia64	break 0x100000	r15	r8	r9	r10	1, 6
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
#10 lore raw

Re: [PATCH 2/2] syscall.2: arm64: Fix syscall number register size

Quoted 7 lines · Michael Kerrisk (man-pages)
Quoted 6 lines · Dave Martin

arm64 is currently documented as receiving the syscall number in x8.

While this is the correct register, the syscall number is a 32-bit integer. Bits [63:32] are ignored by the kernel.

Quoted 7 lines
Quoted 1 line

So it is more correct to say "w8".

Thanks, Dave. Patch applied, with Will's Acked-by.

Cheers,

Michael

Thanks!
---Dave