From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755265AbbI2WPN (ORCPT ); Tue, 29 Sep 2015 18:15:13 -0400 Received: from mail-bn1bon0098.outbound.protection.outlook.com ([157.56.111.98]:57765 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754942AbbI2WPG (ORCPT ); Tue, 29 Sep 2015 18:15:06 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; From: Yury Norov To: , , , , , CC: , , , , , Yury Norov Subject: [PATCH v5 01/23] arm64:ilp32: add documentation on the ILP32 ABI for ARM64 Date: Wed, 30 Sep 2015 01:13:58 +0300 Message-ID: <1443564860-31208-2-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1443564860-31208-1-git-send-email-ynorov@caviumnetworks.com> References: <1443564860-31208-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [91.78.158.8] X-ClientProxiedBy: HE1PR03CA0037.eurprd03.prod.outlook.com (25.163.170.175) To DM2PR07MB624.namprd07.prod.outlook.com (10.141.177.154) X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB624;2:C+RXoCrRdmAhL2OuxpOTc/X9B/eY7LOHCSxPNKS2EdeaIws58lu03g3FLGAx3TQllUQDyqU6Jw0Ajl1DTvYngHB0bPVy4IlBQx44HV7ukHUElzy/zpw9kewQaZ1bVAq5p9Iti2eWwTa0qRsN/advdPBPc/5Hpmk/CWIILhzgBW4=;3:MNUDxwLrkr42buKihASvYy5iFbg6U48eHxpVIjNvjUN0yXuM1W4BR1Qb1Eba6FANu9uCJyu3YsGT7rweCSVKbpdl/ZlXCo9v1uX6WwXx1BOx07/qCE2yP8y/KYVBCjoG4Jbyhm2PumjwyxKq+sgDng==;25:5PGITnj7URGf6RJIMG3ZlKX1eLi2ZzPoT4QpBym22vIW+A34I1MUrLnPDuVnoAumAn2VLEaxO4Zqi/0Ewbo1HF9/z+XVjBWi0HmX+qID5pgGci1BVQCa953ehVd3dFyNXCl67jTwBUqtNxFQore+GVO5zmNiQ/wrNd8qT4LeijF3hUBGZYIyQqIyinpc2rGgzh0UKXht7wuSdlL03TTx3IoZuE4I7xm/TTd0ZSBcuYqqhlYZ9TxfECneUyiyG6is X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB624; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB624;20:bJsJMer16mihq1yepWDiXW9A5RWi2UfqnDPNAugqLffz0n4Ft8CGtFbGm/t6bae6/3uEgdYmwNIXTbb3nBOp3E4OrhTL3rxcg2g3s64ZL9/rWgUeQRO8bpECeq8EmxUabNp64qZmJPdh995R71ITUp1izQ+m9IAbmgMYWi3NcixyxtdXB9i3inI71n/lyYwYYv+u/mzACqhvlscgj9ZCXAdaW8EbGIa2O1vk/mu130y/5qdY4rKOsZMp1mO761EPdeVv4Xo2J1MyGCvgOPeIfHrGfllICYTRpOQUdgYN02m88HQKPjtac2IVxn6cHGVCzJyEv3Xl5evTEuBgbxoFlra1N2rBiXtF7HgncFjXHqkryi1OCKWtQPPd6IlgWtrRUT1Ol3CjUdkbL3eMqfPEjLBL+B+RNFg5/k+dDnyWFJtIIbwenQq/rBKSA/D5hdgTwLZLxr42CX48/GusL/ceILyzqzvcDQrZXD3nlIhdoVXkZcs2om4UUXpEM+fH4Ng/cIqXtRCLv/CXg0omHMRsB+0PHP0H4B6Y3gyv5v/IN9POWpEQ0SHh6/SBbBgd2eACt3nG3wMtpc9efbSqgrYqmMPcgysHTxIpctph+2Bmi+M= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001);SRVR:DM2PR07MB624;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB624; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB624;4:NgRYMJjgaQKPnl1mKTxdVDhQnBhDSMZi3pf13PTZ0fk3AIrbz+feWh2asCzxZeL4NPKH4/FmsO4zUk93RaUu16V15WL3yGYb0GZi1vsA74xjsUXVrRI/MkGW4ASF9l27xLkNf49CfRPb8gHIKWAVuj4rHyo8405A8/ZM00T9WNniwHL2VRvH0IK4yQWBSkZKv15ebnyqCw3cwolYqurJD5voWhnXc2fjlxVEh3pxbYEqKxYRRrs6THZtYsBJYDFd91QWyXnp2L2IqyDMv7XW2ndfW/8Zavr17YG/ww4N7hHS0EbWNB18Cyd/AUKMdAAqjs9H9gabFRgIuRIVVK29zH4WpFlGySZJQP+SoJ3NPio= X-Forefront-PRVS: 0714841678 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6069001)(189002)(199003)(5001830100001)(40100003)(76506005)(4001540100001)(76176999)(47776003)(50466002)(2201001)(101416001)(5001860100001)(50986999)(81156007)(48376002)(68736005)(105586002)(33646002)(5003940100001)(62966003)(5008740100001)(106356001)(77156002)(5001770100001)(229853001)(36756003)(64706001)(77096005)(66066001)(2950100001)(87976001)(92566002)(46102003)(42186005)(19580405001)(50226001)(107886002)(189998001)(97736004)(122386002)(5007970100001)(5001920100001)(19580395003)(5004730100002)(5001960100002)(4001430100001)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR07MB624;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR07MB624;23:Pm7hBdkiDusT6iQDvqZZHx5vIIWIwNyRE6OkVMYKs7?= =?us-ascii?Q?vswdDYhRXUnyy6KZdj4sryWmenGI0b9TRaJKViMVA8pqOYf/KJUQkp6g4WaP?= =?us-ascii?Q?GtgTCpeDvft/eUsEg+C6RiW368wVTlI3kR86H2rEW18mGebGI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mJqzH32dAHdWonySJJ7uVJ4sZuUS2OCiobt?= =?us-ascii?Q?9Rl0h9hSAu5hEm1uJof4N7aSP0aURsdXQJzfQeU/4wCUZgeRHTdzOwFFdR94?= =?us-ascii?Q?Inf6ialru1ZdAK1Jgu92J0S+3kB3KA5zjdbzqIHcIBLnmMQ72rYLp0H4BZT/?= =?us-ascii?Q?wgUIe9H5drtwkHCQrOsCiA9Re0/ecBKuP7ScPTIsV0flwHDb36ubwIj6uNpS?= =?us-ascii?Q?dHBWPd7Cia/Dhvb7rJ2+HJXHcYOjmi7PpSf1PyWHvtgj4nfcjZjWfhPq0SBq?= =?us-ascii?Q?sZMrDzvjYFiCNifmH+DiegodFir5x9ljgxvbUw4OJl?= X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB624;5:/z4vCiB1qk2u31BpLpcBBs9Kq1p68hQIl9ws5Gl9c13iS6CkHnwC8Bo/PH4iWkna4cBuFp1KR3woopmy2vhRW7B9tlkuGcnEK+1K17Wj7g51JEaBo4bIU+vAr0XLuvt0eoFTOXBw0kjR2aUegt2ycg==;24:g5iO0SVv14sZTaSAZXI7t6+SZlpCUz6kPudGZQQIny6+8GqdtemIezvRcBdvgg3EdAxXXUU/EINDpIaStpFLuipkyMeQSVNjOdUS7SbqiS8=;20:w6GeyJRHvgM9EFKTFlHArMhB8NBi6MKiC+FYLbKUc3T2kP735dErhvgSrDp6WcOok7oYqFrEkNb6JhL1KQN29g== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2015 22:15:03.3696 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR07MB624 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Philipp Tomsich Based on Andrew Pinski's original patch-series and adapted with changes to reduce the duplication of code-paths and resolve issue found during LTP testing. Signed-off-by: Philipp Tomsich Signed-off-by: Christoph Muellner Signed-off-by: Yury Norov create mode 100644 Documentation/arm64/ilp32.txt diff --git a/Documentation/arm64/ilp32.txt b/Documentation/arm64/ilp32.txt new file mode 100644 index 0000000..1049510 --- /dev/null +++ b/Documentation/arm64/ilp32.txt @@ -0,0 +1,64 @@ +ILP32 AARCH64 SYSCALL ABI +========================= +Written by Andrew Pinski +Updated by Philipp Tomsich + + +This document describes the ILP32 syscall ABI and where it differs +from the generic linux syscall interface. + +ILP32 sets __kernel_long_t and __kernel_ulong_t both to 64bit. This +affects the following type definitions for ILP32 client programs: + * time_t unsigned long long + * clock_t unsigned long long + * fsword_t long long + * suseconds_t long long + * swblk_t long long + * fd_mask_t long long + +Some structures are changed to reduce the difference in the code path +for both ILP32 and LP64 ABIs for signal handling. + +The following structures have been changed so the layout of the +structures are the same between ILP32 and LP64 ABIs, including: + * timespec uses time_t and suseconds_t + * timeval uses time_t and suseconds_t + * stat uses timespec/time_t + * semid64_ds uses time_t. + * msqid64_ds uses time_t. + * shmid64_ds uses time_t. + * rt_sigframe uses siginfo and ucontext. + * siginfo_t uses clock_t and sigval_t + * ucontext uses stack_t and sigset_t + * sigval_t contains pointers + * sigevent Uses sigval_t which causes it to be the same. Special + handing is needed for reading; in the mq_notify syscall + * sigaction Conversion is handled in the userland (glibc), as the + userland data structures are defined in glibc anyway. + * fd_set This is done to avoid endian issues between ILP32 and + LP64. Syscalls consuming fd_set use timespec. + +A number of structures differ between ILP32 and LP64, including: + * struct msgbuf The specification of 'struct msgbuf' defines the 'mtype' + field as a 'long' (i.e. 32bit for ILP32, but 64bit for + LP64). Functions that operate on 'struct msgbuf' need + to be passed through the compat-syscalls to resolve + this. + * stack_t contains pointers (handled in the compatibility layer) + +Also the syscalls which normally would pass 64bit values as two arguments; +now pass the 64bit value as one argument. Also they have been renamed +(removing the 64 from the name) to avoid confusion. +The list of these LP64 syscalls reused by ILP32 clients is: + * fcntl + * statfs + * fstatfs + * truncate + * ftruncate + * lseek + * sendfile + * newfstatat + * fstat + * mmap + * fadvise64 + -- 2.1.4