Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751300AbdFDMBk (ORCPT ); Sun, 4 Jun 2017 08:01:40 -0400 Received: from mail-sn1nam02on0077.outbound.protection.outlook.com ([104.47.36.77]:65442 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751201AbdFDMBZ (ORCPT ); Sun, 4 Jun 2017 08:01:25 -0400 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=caviumnetworks.com; From: Yury Norov To: Catalin Marinas , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Arnd Bergmann Cc: Yury Norov , Andrew Pinski , Andrew Pinski , Adam Borowski , Chris Metcalf , Steve Ellcey , Maxim Kuvyrkov , Ramana Radhakrishnan , Florian Weimer , Bamvor Zhangjian , Andreas Schwab , Chris Metcalf , Heiko Carstens , schwidefsky@de.ibm.com, broonie@kernel.org, Joseph Myers , christoph.muellner@theobroma-systems.com, szabolcs.nagy@arm.com, klimov.linux@gmail.com, Nathan_Lynch@mentor.com, agraf@suse.de, Prasun.Kapoor@caviumnetworks.com, geert@linux-m68k.org, philipp.tomsich@theobroma-systems.com, manuel.montezelo@gmail.com, linyongting@huawei.com, davem@davemloft.net, zhouchengming1@huawei.com Subject: [PATCH 04/20] arm64: ilp32: add documentation on the ILP32 ABI for ARM64 Date: Sun, 4 Jun 2017 14:59:53 +0300 Message-Id: <20170604120009.342-5-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170604120009.342-1-ynorov@caviumnetworks.com> References: <20170604120009.342-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [176.59.55.28] X-ClientProxiedBy: HE1PR09CA0071.eurprd09.prod.outlook.com (10.174.50.143) To BN3PR0701MB1267.namprd07.prod.outlook.com (10.160.118.141) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR0701MB1267: X-MS-Office365-Filtering-Correlation-Id: 2d67d393-6f32-4bdd-1c75-08d4ab4165d9 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:BN3PR0701MB1267; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1267;3:SGphP+bOaiaYOyGmeEOsNsl20lgpXJodIUVhK1P/0tvG5KR1Ahh6OaZzH0g7YASB7dnrsC0RjNSF3aX2wLF3g0lyr36Zpy2peKaXeSc5823Xuor/36gs6SwctdJEs99VkDZ9aYF17QSUP1NvF3uXMlJ+3MJfIkwY6gdRy6T2x2ZX6w97b0bEPFuidey//ipmvZAMVG6VymaSc0sAH49RUVn78ud/FV2nW7RqaCdTqULYeumAKFEMJIda0Rkcl6uU9QNEzuvg5FWGzwkbiHUoB5iOBvT9hVCyKxbT8qQ6g4Cvv6CDys704wnpYxM5rstpkcI5GtIcK1gKgnQZzLg+aA==;25:Raq3T0Y9Vgb0dX2fTtmAUJMmA5tiYprsJa9hhgcUwnlU9fWroKXfopATgjfzVxD4KERMFGKAiEPBOyzXjMmjgD5rhXMMMJyH0c2YdePs2zU33YwTkNVjbWliE1ewmKI2zW/NFyNmmWJFtlIxSlQXmLtk5dFMLsH8/gRLTsMP2YSbGcWDCl+5z6NCbXdPfyAevHpdx41H5QlWpY0rvPTe0+bPjlHNxIKGYYWxTL20LXacIuD7RwTLm+ks4J/PrcRm8+vn8a7QeX081oRn1/4sL43+rAX/GF3b/wwLwSd1OQdPqs2V5mOjLBznrxsy+adn63jCIfgRSPvvvQ55HuyZkIu1DAJzhACM1m5Y0cyDWEHCEzq96n+YTFHbjdfEzQ2rdUMA5C51ARfy2DaBrcRK/13n8wy0VphT2c9oJ0KAVHC6HG5tFxKpr/b7d42qJDYRLptdqoiBbKrw0inkuHkkV8B/clcDS9xDjZPD8rrM8Dk= X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1267;31:fY7aak6WjQ3abI/pEo3hpCWYMb//r4jXHbzgbkCp1BEDtxngVzMJRWI8i8eOsKVgKTQ9xNorNlLhRdoLtZ1/6pCTPtT/8LqctvcAgtMYAEqeZc/Zj7vUMlzg2SKpdkvVBytY10XkrgUHDo3CA9vEjrr9y21Ojkksiq/NFDUM5OdADyAo2EU14zFO3ZMc/csHbTufDNuwOMLqlOI9LnFQSfhdk9jNIX+8VgprQlpxug8=;20:xEOMKIinSOW7E/HzYGKNP30p4v7JzFxCHzmps43wwdbwEhzsQwRlChqHoO4xPxOFPcahUZufMucdxfmlE+EUmNxrGTdqXG4msHfFr8DgqNKc16kRcdMUFyhs6IFicpE7A0Gm3ECCvR/9JclaIjLdJekQ3x2Dok4wYJxN/rwPYn5HSdauhD1Pe0ljqWJORcfO3yiaGqg72prT9SfLARjkiXl8CiSxU571+u7biDJVtAkH5gyvwMd00QXA46hOIH+JT9JeGLhiYFYLKdJP1jyvuNqGsVoMqyhcsjutiNbALLB7OOg1AjIDSHjfBuxmBVBefv36rPB722GEWVCOgAkQt9BtwGjGf/c/lBD4iPRy5aCHvHTHXew173wKaq5ZmbQ2O6IQtEzXzFCG4WIopYkXzNDf/8AV0+oLfcoGjH55NZRVnseqwy7OMNinesUOKGZpCZPRN0dOyv6rdukk44fb+nT2AFgGCzKeZICjoak49oZOqxu16hCl1IiQsk6eo4HUHmFtYjMQEsRl4dd0ywvsM9csDZQIVEfbiIPJ9vbYqtGzt8U++WoQrYc5LaPhOG1c6klEuPQZoi/wO9xKU0cHI+C/SteGJtkIPX6Qs9eUoBU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(10201501046)(3002001)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN3PR0701MB1267;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN3PR0701MB1267; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR0701MB1267;4:ABCauf8EupJ3jA2yGjwEaDaNmKUNZSC8t3WWCyn2?= =?us-ascii?Q?gw3XnF3utsBEHcj+NPWGBaNSsjGUFOWiLkAE1vo38akYDx3xshhT2jtOKluz?= =?us-ascii?Q?j+m1HBkPUGaeU5DPualFeOnRe9fVRo1FvdbZPYjqON7Tb9VYmq2DHvdH7D8s?= =?us-ascii?Q?SnDLSZITg1AoDLUEdRt/gKJlB5AW05RSFDs5VUBsGRT4BT5BrHwQlWpnrJ+D?= =?us-ascii?Q?RD3uhzaIOe672fTk7Ur1SuqInUvU/wa6NjhSa8iIHKMV1R2corgBuP+hBATc?= =?us-ascii?Q?KbMay84jj40djuxiUEgKqcAuwFDtRR/WHCE5hyyhybj8t8gnG2vzweorRsiE?= =?us-ascii?Q?q6H4V7JPRUC6ZET8s4l/uF1ge+PLZ9rbch+FwYX4FhYBrPP7T1Gw5khvLg5E?= =?us-ascii?Q?zriKTQV2Xeee7vkWmVf5PfDKIOxvUHSiDK6DwIQglVF6bzwhUGg2njvdXH9t?= =?us-ascii?Q?OK9yjemQ/kNE5gdweTaTpfnzVAnUgX2DCmuFswCDWpF3bi0XwiFQWCgw441d?= =?us-ascii?Q?owE296xDCFbi9I2SubFXjLvvF1qA4k3LOmiuHWookUfUsGW0h6ubaVY9VDW+?= =?us-ascii?Q?ZDkjlkqDz/f2A0TQtMrLn+LzL0/TNEpHCWsseOC2ad6X/xN9hSLWOz9b5UA4?= =?us-ascii?Q?pcMIqO0GOszuW9krYXfwEXvTp0wYvnS0pb0pCc/BT9AuwEuhBaC5DA3ncPjt?= =?us-ascii?Q?sVRnT8dBZDCQi4XeOtjgp1DHbVQZJmPJJMWusWWQU6moVH29RUfOeRPa2HTm?= =?us-ascii?Q?LGyanWWFseFbYrmnHfllQCCdJn6qa7vnGQFTaGEz+JmGgsg3K/AD86DqTD8j?= =?us-ascii?Q?94DvDBIfJK3ognHmJkLTM/O00+CV9WyjzABB1O/GZ9E4TF6Eu1W6rX+mb/to?= =?us-ascii?Q?4TNBz5t1ZUZddyQIdf0SpFbl8bnPTwWJVt1Xb1pfgI7q+LvjkW2KE3bdcQO8?= =?us-ascii?Q?9rP6aqlghBRvNs+ixvv5yxk0rx8ipijwSvsb72xCY4qJjPQDnI9lDu8u1YBW?= =?us-ascii?Q?oQNKG4e9xk6HhQnMc8Ilw1yt/vycwaXHPcREyAIQD/8vr0MFX+CSxevQdyYa?= =?us-ascii?Q?gjMSJAR1lz3mW3iCbo2LWtUea5Rg1fUDZ1RiVPXGIvSe1xGJIsI/Zeq/ID1C?= =?us-ascii?Q?2vvSmoZeL3c=3D?= X-Forefront-PRVS: 03283976A6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(39400400002)(39850400002)(39410400002)(2906002)(72206003)(6666003)(189998001)(2950100002)(42882006)(5003940100001)(478600001)(66066001)(6486002)(53936002)(54906002)(50986999)(76176999)(47776003)(38730400002)(6496005)(48376002)(50466002)(5660300001)(7416002)(76506005)(8676002)(81166006)(36756003)(305945005)(42186005)(33646002)(4326008)(50226002)(25786009)(1076002)(6116002)(3846002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0701MB1267;H:localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR0701MB1267;23:bcegLgcfB0t6YWuC2/q0X4pbeHFv25IQtuvjzCN?= =?us-ascii?Q?9IRLQAvkl5DVb6EkwPyVHVPYNHSh9SsBmYGAohHZ1KRx+kNvBcA4rzymuNl8?= =?us-ascii?Q?+CTQrI5A85tNxcUHla8FSDvcxcNF/R/Rei4ttpyhurZ7vbukxhp90pBcYfcm?= =?us-ascii?Q?I85Nnvh2RL2xrs7X9JfPoylqE1RoySHh2wiG6JwjZ6A3rdkn03uQ7FP++zks?= =?us-ascii?Q?QonMwBXccRjT2y8TqZgBSR1Pda7Eua1T09XZvRsDkqqBtXgr4aLRrCyaalBj?= =?us-ascii?Q?f6t2IPZv92OBkraRl12Wj2m5Z9rzse7eoy8C0IjKmUKy5TL/B0d+F2McJ1yf?= =?us-ascii?Q?oqWVdz2qP19o+sBTnprON2htRnX10KqEgNCuOlAAP9ZBVjaybxbUWiXbe+se?= =?us-ascii?Q?p0MeiKy4JC7Rr7MvZHGsc3TANdyfaVXn43ztldd460veoSCN63BVChBhcy9B?= =?us-ascii?Q?RghowCtv6acFHCDuh0HGnSD7cLuX60MarPW4IiPs4SewFSwX2Lb3G2ux7CUT?= =?us-ascii?Q?PHGeXfMLlJtCleg30s43U/3PhCQrYVpXegxjmleivb6J8bH1toNraFVbfpGO?= =?us-ascii?Q?giqlLJRujDIsoCqLkj825Ep7uhxBIcgG2VMoA+oH9KzT5yJIkaDqTZam1pya?= =?us-ascii?Q?25XYkh/CkCmm4JX/ovqr+xi0Wr8r9cVAxjIC5g1x0NI9r9gF6Gq38XOqr7Ct?= =?us-ascii?Q?r/YtvqM7KX66XRAW76tMGgae1RmXX2SXdUX2sus008bpqn9HfDIGFe5/wHgo?= =?us-ascii?Q?MxK+vkAbdmT4M2skZa6Dp+CiAOXaTraw7jclKX+Nul88Avlynhl6tDNcmsTB?= =?us-ascii?Q?P4Oz4DN9vp8lK5oKcKqN6dc+2Px4C9XSvVOqWec/trTZPjEMUJUlj0+ZHkLS?= =?us-ascii?Q?RjFlL9ZFcDjFmiJ2CDPQ3fPSYpYNIQUJXN6ybVX5sgUALK3SP67keip8xLzK?= =?us-ascii?Q?fTxkPMV3TJKNT3Lld3POkwKHcHA/ftXisDgXwe40dauMXh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tdRrxyh1meE/+mmdggSX+D/Wm9QG94BiBAUr1gAotaQiZlKxUVlA3npS/XgArWVWGDt/0o9l/1LpJgTkFNXS4urMKD6PeguOviahCUgTZbKHh0vLy9V;24:cCzOYW4tX5K20CB3XTWc/rFEPqAxqWbJBJWsbgB25SW1qq8PzjxSaCjw6iYt8Vyhl3ZKHFSUlJvIXA8pGqlWvnWZ2nNiZ0vuDcKQH9wu7m8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1267;7:w9ukRVkw1ZEQdU+jVLuRid14eO/8n0cqX5iR3SIZQ5I/g8Ru2r9Rg7ABnrp/QuvlU4bQ5F8gBgHWVZe8H8Ow85t0bVFCtR5t5AIfo+1b6gsKqvjLs7XNXqDVBth4FF6uZqq7fCxkXnAXLb/ElBVvpF2RQIrgQyqWUgLV70ZlxInHrkoNfg/iw41jJQpTiMoV/1KqqsOO/ebpqyjn/2vz+Vs259hI217nn1AoKC+QaVsmm75zLL7XsVwNT+iVdQROQfc/VzBGlKLU9nuYHH2ehOBUbZQcoIjBdBWPnwNooJXFrkgy9NLYTHL0GZODy5LOJsyRSfl1AmrfyiqzVEbzpQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2017 12:01:13.1700 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1267 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2035 Lines: 61 Based on Andrew Pinski's patch-series. Signed-off-by: Yury Norov --- Documentation/arm64/ilp32.txt | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 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 000000000000..08935a34e7e9 --- /dev/null +++ b/Documentation/arm64/ilp32.txt @@ -0,0 +1,45 @@ +ILP32 AARCH64 SYSCALL ABI +========================= + +This document describes the ILP32 syscall ABI and where it differs +from the generic compat linux syscall interface. + +AARCH64/ILP32 userspace can pass garbage in the top halve of w0-w7 registers +(syscall arguments). So top 32 bits are zeroed for them. + +Comparing to AARCH32, AARCH64/ILP32 has 64-bit length of following types: +ino_t is u64 type. +off_t is s64 type. +blkcnt_t is s64 type. +fsblkcnt_t is u64 type. +fsfilcnt_t is u64 type. +rlim_t is u64 type. + +AARCH64/ILP32 ABI uses standard syscall table which can be found at +include/uapi/asm-generic/unistd.h, with the exceptions listed below. + +Syscalls which pass 64-bit values are handled by the code shared from +AARCH32 and pass that value as a pair. Next syscalls are affected: +fadvise64_64() +fallocate() +ftruncate64() +pread64() +pwrite64() +readahead() +sync_file_range() +truncate64() + +ptrace() syscall is handled by compat version. + +shmat() syscall is handled by non-compat handler as aarch64/ilp32 has no +limitation on 4-pages alignement for shared memory. + +statfs() and fstatfs() take the size of struct statfs as an argument. +It is calculated differently in kernel and user spaces. So AARCH32 handlers +are taken to handle it. + +struct rt_sigframe is redefined and contains struct compat_siginfo, +as compat syscalls expects, and struct ilp32_sigframe, to handle +AARCH64 register set and 32-bit userspace register representation. + +elf_gregset_t is taken from lp64 to handle registers properly. -- 2.11.0