From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754277AbbCXSks (ORCPT ); Tue, 24 Mar 2015 14:40:48 -0400 Received: from thejh.net ([37.221.195.125]:45707 "EHLO thejh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752539AbbCXSkq (ORCPT ); Tue, 24 Mar 2015 14:40:46 -0400 Date: Tue, 24 Mar 2015 19:40:43 +0100 From: Jann Horn To: Kees Cook Cc: Michael Kerrisk , linux-man , LKML , Andy Lutomirski , Will Drewry , "H. Peter Anvin" Subject: [PATCH v2 2/2] syscall.2: add x32 ABI Message-ID: <20150324184043.GC5677@pc.thejh.net> References: <20150316180154.GA10663@pc.thejh.net> <20150316233457.GA9227@pc.thejh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150316233457.GA9227@pc.thejh.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [added H. Peter Anvin to CC for this patch because he seems to have contributed large parts of the X32 code] --- man2/syscall.2 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/man2/syscall.2 b/man2/syscall.2 index ef8f3cf..1f25255 100644 --- a/man2/syscall.2 +++ b/man2/syscall.2 @@ -170,12 +170,18 @@ s390 svc 0 r1 r2 See below s390x svc 0 r1 r2 See below sparc/32 t 0x10 g1 o0 sparc/64 t 0x6d g1 o0 -x86_64 syscall rax rax +x86_64 syscall rax rax See below +x32 syscall rax rax See below .TE .PP For s390 and s390x, NR (the system call number) may be passed directly with "svc NR" if it is less than 256. +The x32 ABI uses the same instruction as the x86_64 ABI and is used on +the same processors. To differentiate between them, the bitmask +.I __X32_SYSCALL_BIT +is bitwise-ORed into the syscall number for syscalls under the x32 ABI. + On a few architectures, a register is used to indicate simple boolean failure of the system call: ia64 uses @@ -210,6 +216,7 @@ s390x r2 r3 r4 r5 r6 r7 - sparc/32 o0 o1 o2 o3 o4 o5 - sparc/64 o0 o1 o2 o3 o4 o5 - x86_64 rdi rsi rdx r10 r8 r9 - +x32 rdi rsi rdx r10 r8 r9 - .TE .PP The mips/o32 system call convention passes -- 2.1.4