From patchwork Mon Nov 2 23:30:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 7538681 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EA972BEEA4 for ; Mon, 2 Nov 2015 23:33:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0BFD12061E for ; Mon, 2 Nov 2015 23:33:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 148932041C for ; Mon, 2 Nov 2015 23:33:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZtOZo-0004rB-NW; Mon, 02 Nov 2015 23:31:48 +0000 Received: from mail-bn1bon0058.outbound.protection.outlook.com ([157.56.111.58] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZtOZk-0004ix-Nl for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2015 23:31:46 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (109.252.143.100) by BY2PR07MB613.namprd07.prod.outlook.com (10.141.222.144) with Microsoft SMTP Server (TLS) id 15.1.312.18; Mon, 2 Nov 2015 23:31:21 +0000 From: Yury Norov To: , , , Subject: [PATCH v6 01/17] arm64:ilp32: add documentation on the ILP32 ABI for ARM64 Date: Tue, 3 Nov 2015 02:30:30 +0300 Message-ID: <1446507046-24604-2-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1446507046-24604-1-git-send-email-ynorov@caviumnetworks.com> References: <1446507046-24604-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [109.252.143.100] X-ClientProxiedBy: HE1PR03CA0036.eurprd03.prod.outlook.com (25.163.170.174) To BY2PR07MB613.namprd07.prod.outlook.com (10.141.222.144) X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB613; 2:fYHQW2fKHRUBPnge1UVUVDHKtByvdwKWuDNlKwdKY8nAra536rm6uYgrnVF5f/QHYhate7PEtTniIPhFYgTTG2/X5KfQPfpp0fZOcrhJOQ1TqjdDplvlfeKrP8o1ziwrLWJtSznk7XNdFOa599aHHqiLg7cdZzpRHVk5cDBerjo=; 3:d9PB5B7q4UjDy1adjaR9bHe0OgGnTMXyct+dtSVrSG4fzFRj6wFzuTJxv/Cc1UkJe9nnPcGo3TI9fG3VYiS4wBd/ykKndnoPJHYk8IHVguwfXcTJZXjG+O9xVoeNL7CULQ7Iu1a4WRm0HGSxz7EbMg==; 25:dcK4qpTmWbTVFFaQ78rDC+locFkTVXrkpprWx2o2aGwoEPoV7MpEI0GABFgOAA13Bs9avHHE61sTfHG1H37et9SHEIE4IpbnBuqQ5Q613+S7uGzyO88L9h+tWZonvI+mtc7h9wKK0Z0z8kVwNPsQRU/Lnw7oPdWNuhjfnT+tUL/iKSPkp0XFuMbcE+Fsb2a8IadehfdE+UuaH8DRC2uPTB8R9pZvHYast3qjZQ9dM+6M0M8DkE8zIuqXZ8xJJbUe X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB613; X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB613; 20:6kA8X/uMzH3up9ZiNtk4t28qMhaiLDQ6q49s5BZm+AxyjW3hM8bXvUZ9k80ihGUcmF3mUbhFx/X7OHvmiOIxmUHx0L0F4moGT++3VcOSsOUZFbxL+wBalQQiZrhcxPJxY4YkQ1AoVN0Dw5xCAcZZceTI/byZhvEDSNPMtpBu2IXCMxuoOgmi3u6Qc9VL7O5GMeFu7AyKN9+KgsYFFLpor29LZ979sTQeiDuJWqDqjXam73E9FwhpuB0qT0ceG6sthKxvKMmFqHrVBzhH2L7+OcVf6UzLyCdtLu2RhsThjKpaZUVa2KIDGWa+a6VUNhyZCBwmBiTvP3Kxvi7niTIQRPxUiH1JQGUJnicyyCy8TODDFwXykodXe4D91UCdUiMWGxdpTk0/VNUdD1dq3jez0mCJBykrKqd7BgEXPq+86LSfgnD1MRUvvHTWW0sucp0tTht76V+zrEP/OukwtaDRcUIARJvGie+fLl7iPglnuWHtRL+Ju36O8GCqR5+cHzjaUlBc6yNEY1oupw+FMJWer65Mkk/OPK3wa6NSUgr5ikTG/c7gMJb2ywl2654HJjnbhHG4T67ZEZ4Gc9ndKXi0Iy0+doVWYmbRugIR8J3AsXo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046); SRVR:BY2PR07MB613; BCL:0; PCL:0; RULEID:; SRVR:BY2PR07MB613; X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB613; 4:tjKgofg2Ij91DwTSrNsc7zr26gwWCZydwTEAnE4+NOzHehFcpPgSHJWIcMFevG3HLMh78KoLDTLUXN8yn/BqVGDeHlKsZQJYnweLkzamewWG4Q8oxOveFGgLr9xEkZgFAeoqJnqZNt7hg4GL5UeLcftOdu4aDHGQQ4uF8v+VUIjUzWro4ngJmIn930ESQK3S7xY6ETGVpYKjG+6qfsiR/EXtzQ8dsbEAMxRwb0vBxwR0H9h5gEGi+jbSmpjHW7cJweaziTxDHNRh1k/Hc+cm6cKYcirzKNOud6hkSZ6J4DzylmTodbsuH1212Dgk2b85PbZJFkmo7OmAo4JQ5ww/ngTt4ZY8Rr1D3ByKjNqSI0ZkFyn6JNHDML9znNVZecYn X-Forefront-PRVS: 0748FF9A04 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(199003)(189002)(5001770100001)(48376002)(19580395003)(33646002)(2201001)(101416001)(81156007)(2950100001)(5007970100001)(42186005)(77096005)(5008740100001)(122386002)(5003940100001)(106356001)(40100003)(105586002)(5004730100002)(66066001)(50226001)(76176999)(50466002)(92566002)(5001960100002)(97736004)(36756003)(4001430100002)(50986999)(107886002)(229853001)(76506005)(189998001)(87976001)(47776003)(19580405001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR07MB613; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR07MB613; 23:HjS9FlcZB+Tot45GxgDmK9MymuhwGoR9Vb8Q+JFHXM?= =?us-ascii?Q?7TL1FbKrFIIoka/YWr3mw2kWumPLnpZruWZOfZuYk5UnTqIiyNUgkNA3Er41?= =?us-ascii?Q?bpW9zQf4Mtiay77YuIKCiFrlQrJ1CiNLyHAzkG7+2UNsFuEQ/Xm2/HECc/tZ?= =?us-ascii?Q?PQj/rGKaxa+CaHpJcGFv8Fj7M/NupeHIR/RbKdkEinPYwcWYc0pY5lbA4gbA?= =?us-ascii?Q?kJH6SrahJ4M4tcAqMmhzDh/kVimLp1L+tpZb/B3JxIrSwJ5L2PcpQGUJyzl7?= =?us-ascii?Q?BlHBrFFeX0zsoKhBMtlkcwd9YfjwjTL3nmz5Bp+1ZlsUJexsjLH3HU5RRXnC?= =?us-ascii?Q?GwhW9ZMdoLTtUpWrhLjQgxA7mMWhz4DmtmQLPaxVIgGGHxU53iVVoBk5oxBH?= =?us-ascii?Q?wo0KfrtI8e2SLhH+T8GNKdcxWg0/SATw7jGSXhVO7A9MDu8J/z3sRID0DAnl?= =?us-ascii?Q?1nVL81v8pmaXBsRcQvp5Yma8aEehcXssIK+USNtEMGIjqb/3wcRBGENGw8++?= =?us-ascii?Q?9C3PUDmpRp4hLAWjfTCj8W+8EtzL33R00qAmwnfFOUyJzFGNjO23+3SHCTpN?= =?us-ascii?Q?I8rcRQfPJlQOpqzR9YLzt2p84vtsEmgXBOuV+f0tYAeOgEMS8DIVmKSHFTny?= =?us-ascii?Q?F20uXoo/R/h5kjZ3Vj33mC7wAL1W/eNpu3By3s7HscpPuyoD01C66/oteFxA?= =?us-ascii?Q?F5u9srECAb6Q7ztUXepAxZDotYoiMhnu4mYt/IaJJIeLtmq1vA648fSMWB8L?= =?us-ascii?Q?zIEvHzyJvPXyJK/AU8vWKLJeSDYNm2wecS3P9JifqMwHtDETc3B0Z6l1+p48?= =?us-ascii?Q?gShk4IsIz5x7/FRS/BK3+MiU7jCCFGbaSYCHSiMDpkhpza7RDuJ8A4G3nuWV?= =?us-ascii?Q?xWks9SuTnXW0GsdS2xV1JtgEbQHe3idvCjVG/Odsrqpwz6UtxDFJJv2cQNER?= =?us-ascii?Q?nI7107wTl0eG0JslsEB4WFQzHSM1HnRPvG0s2YH1lj/IgWOgDK726aOAJoE8?= =?us-ascii?Q?DdO5has8mZMwBfI5ktJJHh1liICDzgBAn14cGtyWqbooBZGkCq/JVojvZl7M?= =?us-ascii?Q?asOSspdD/VEJZX/FdMgarqzrycZkxNkFQxSTUS4VD7wphIew=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB613; 5:vFRTv4VYLZ/1v+/FAQM0jzb/WFXZuz20mOrntjPi1IgxunyjgnFcqtBA+Xmv2qNG6SArMvN5qES4xt3n6K0LlhCl3GPv6O92C0/XE8UNHKnRu1vYplIKKODh4rteGcbDm8FGS5bvhBPxeSVhqg6iQA==; 24:PugcxUq0ajkywPUhh7OOx7f76EPXHOsh3rEI2pATsu5152SQUL8GfXTIxeOvFjK/623S5FBKp+Gx7fA0bqsF2tp25/vRY/mJSxc3qtGOWRo=; 20:qE4/NNOjmKpyCbF/YF6LzR2xgmLvhiA5oCIRjvnql1azunSC7Er9guB4iWDFMwYHqQuTpKNPhgudmVIXVFZMKg== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2015 23:31:21.9415 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR07MB613 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151102_153145_103762_47435F78 X-CRM114-Status: GOOD ( 10.86 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pinskia@gmail.com, Prasun.Kapoor@caviumnetworks.com, Nathan_Lynch@mentor.com, agraf@suse.de, klimov.linux@gmail.com, Andrew Pinski , broonie@kernel.org, jan.dakinevich@gmail.com, Yury Norov , ddaney.cavm@gmail.com, bamvor.zhangjian@huawei.com, philipp.tomsich@theobroma-systems.com, andrey.konovalov@linaro.org, christoph.muellner@theobroma-systems.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Andrew Pinski Reviewed-by: David Daney --- Documentation/arm64/ilp32.txt | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) 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..4f6860b --- /dev/null +++ b/Documentation/arm64/ilp32.txt @@ -0,0 +1,55 @@ +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. + +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: + * 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. + +A number of structures differ between ILP32 and LP64, 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 + * fd_set This is done to avoid endian issues between ILP32 and + LP64. Syscalls consuming fd_set use timespec. + * 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 +