Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753532AbdCAWAt (ORCPT ); Wed, 1 Mar 2017 17:00:49 -0500 Received: from mail-co1nam03on0040.outbound.protection.outlook.com ([104.47.40.40]:22588 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751157AbdCAV7u (ORCPT ); Wed, 1 Mar 2017 16:59:50 -0500 Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=none action=none header.from=caviumnetworks.com; From: Yury Norov To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Arnd Bergmann , Catalin Marinas 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: Thu, 2 Mar 2017 00:49:12 +0530 Message-Id: <1488395968-14313-5-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488395968-14313-1-git-send-email-ynorov@caviumnetworks.com> References: <1488395968-14313-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [27.97.135.110] X-ClientProxiedBy: AM4PR0701CA0031.eurprd07.prod.outlook.com (10.165.102.41) To CY1PR07MB2247.namprd07.prod.outlook.com (10.164.112.149) X-MS-Office365-Filtering-Correlation-Id: a0ad8f82-71eb-4f29-4f67-08d460d805e8 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2247; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2247;3:CLseu6ibl8FHOKIAaZ0UfxXgNupxX4huEgfOC9gpjhN3pR6gj7Mr0oKP+kd6MF2ZGxf8tOSNmGI1MSFWMa0iWE3LWtQ43o9ub9lMQY5Eszy/65+M30dnFTgLfiW8k7n5VT5ArKwaqan2kJm4USHdb2cABAdXBgGZ7C6vsFgQ3uqXgpKR1Csq/+3X8GvibnAmC1tn0/WH/TnyEQzqz6/XfIGWCOigkwMQIjprFtTAYqFa43BEV9Q15Wl3rFmGXMmnfTp3mhio7JEnPjj0cLzPQQ==;25:JPYn1vF2sTNc/GILrtf7nV2U1kESwymIxTYAprMbcvyKMMbNrkSmHvlTqzUobCynEhXzHKW70ofPkPwCykZaQIb4XbVHvPNbXIXQdj3Wa8UklkxrtBXal2T6VVo2iQJ8i3qWkJXRrdAs+ECGT840+MbeXIzQ2v7O6Fg3ExmIfzPFlAe//rUqiDfSWQpEi3XW1wwK7scZI0a2/vepmU+GHCkmDk892c0Kn8xOAGEZODQ4e9TSrgNwysHmBprgkzt+iRmd2LQXe+hZSiMR8Elp3TjLauaHK6DfescXb+s/Rp8chWMuVsdta2nN9HqidyUGvuA9pGGnxx7HxbsnBEr9SVzQOpSn+AeRCBozICZYHY9Wel/rZjOEgL62VRYF1CbZnojaqxljKctb18T9UL+9Cft5vejYQshvOyrMBLQpnPTJGok6OAo8+hMuS4V0O+XVIrlnpNYdB0IiR7hBT4/Slg== X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2247;31:GN2i7i3U4aqDd1PljKkVm1lwps1+DEk6JqZNrpWezixnTZ+DSTEYksmbCPMy224jUPjY6kx6dR1DPcqvOl8xg8eXd2dF+vQOojJdlkVoHUZmBJZSFtjMugYKHIk+6AFXpZtS+jFBq1aYf3tx+M+DzUuN580dONPYFHGb2GldoJKYwgAj7JhP+Jtzq0psZSbVKXtFU8cQ0NoWsp3redZ/5SBN7PL+tdYPtG6s9h7ziAA=;20:uiR/Af9Q5baS0gVpGgzJ0n/eRkJHWI3GsHAPldkWgobNOLz3UDF+cKlQbPGfc4h8l6+R8BKQ0iq7uwAaw1PnKodm4gtZDAy5JvZcRsYA4ez+SnPJoASG38C5/blZ0k1eDbtLuiRJpOt7g4unhcb8ASU9+50+6GArR+i+nkLepHgDGNmkxxbtf7TtJKN5w8MjCCSxEQCe2rT+Dd0eayjOfFdl2RxS2bw/XyMYNaTYbv76mE5kxb7X+bK/NNnsfubbKet8OjOkRyu7YKXrut5oagx6PkEy7uKSt8ZqERA681osw7N+xIIpPdxCnyZYX8aw/WsmAQzNjd8fm5UVFlXJ/iWL1rIb+IKVsVFhz1b/Zw0bFQboDcAHwLE9RnhdX+2BPVwj3nbpGBWGYA4Pf9KhEusx4W0OS0NApgpk9q4FrcRDQexN7WkhQXD/cKZIDiTwdwpIOyYdc463jLYRu9GK87g01G+CdYTT09KbD93OtaTLZgKPcmzHUt9W0eDTAxK5SPyjHffQZPTV1wcnwz/yMRRHIRQseu79kIhYpOSQzNtnIXzm9UFCmAUaCULa/W9KGAlzLKJzlVojETtoUhwQJmNEQoZoz5LeQYN3+v41z2g= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123558025)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148);SRVR:CY1PR07MB2247;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2247; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2247;4:um7UdqNncDElTL2H7aYnXmiYCYTZ3KilO9SZKFHwqrUYq0DPQaHdMEeI6b9RwwQJbxAErj/luqIqfIeWON8KF4HCzTEtImgqT4PkzvqM+MHCSrRZLFoXK5NyRdR14H9wCoCzQOdX/tT2HTjoSqGsmjWxYHNFx4UB7zgJ/fzT+zYoq46EVIj4G3Brog6NsvEig1oJiiF/hJWKSKFUlrfrYTO+JNfIskWnpUgf8TNeX3vDM+l11jsycywkJkYDVvujAW5h5oJlb56vHD0THS0q7r2VP1uqzHiodqGBlVwohI6nSJlR9GuZkHgVGTrDWQ+z4D0mPj2mIRWaz6a6cPO1OhWI+/YzTjPEmTk6QnvhE0/FgQSjBCUgOGPA3zxFf14k8GZ78prBQyaWpcN8MncZDtrYJC9fSRZsWwq0SZNd14uSYPvciLs1jjKgV5TNSbWYQwJQyQrvVdvySSdyFlrVg1OKFyOXq263jlnB0k3YIZxBOKljf/MbezKfDEHxnxHPuAZtsARKd1TW3xtIizEajvyPD6lMrvux3Fcj3fomWoYyppP9JXePl9xwzPJuDBYulcwHnPc0ZcBzjjhoPBDeOx5jB2+ILUIgz96EektRwu0= X-Forefront-PRVS: 0233768B38 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(5009440100003)(3846002)(2950100002)(53936002)(92566002)(81166006)(25786008)(33646002)(50226002)(8676002)(4326008)(50466002)(48376002)(54906002)(7736002)(6486002)(305945005)(6666003)(5003940100001)(7416002)(5660300001)(2906002)(6116002)(76176999)(50986999)(6496005)(38730400002)(36756003)(66066001)(42186005)(76506005)(189998001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2247;H:localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2247;23:LSg3R58W4v4r5gaHKDgIzSZ2Muva7K7cSNbuSOfCzOBRnNlrhZT0mObTRqACd0j1gaZKKYSXu4CgVn1JDV1UbOxp5aJ5xzpSw78rKtMfVRjmz6NRgguDpQislsLy2HTkXS/KNoZ/g9Lwzbo+dMcXaYKnqdfSJ6oUQvNBO+h9D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eDJ4IwaJZVCkdgri5dy7hPFQUy1F4N4YoG9hDyyDctmsgvgS/gFp2tdtBXFELLh6kaFZ2qawzEGUCW7M3AiQ/p6Kw2DWM2A1Id6p4Mvx4fLOjjoD6ypa9je/6cGXCsGVAInEO+CKuHARfQ7BhnGA==;5:RZGP7fNzG7XKPAGu+XjJDRgWY1qkvQ+mcwZmUXXk2k0xM2mO5A/kUubnJSafFkPpLz/kK0FndOKSAnQl6Xc9534fStQ+UCJ6tecIiAOZxn7iY2fhAwQ/ZA3Al74d71igSTxMyX1h59PzTnTRlMzUEEEung3Zmx/4vdTCRpNOh1k=;24:ZACuhfl1pBqGp3yRN92pXtr50xUUHeyH+5E/UG8x6uxrNyQHKHKQVg2HU+xuLESTV2vzEbD04NjPi9sQwQTjsUFTXM2LXCx8flv+kSuQGBI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2247;7:1r77vDz8+lwx1DU7YMp7iYGAgUWgfda0ZnX4ZW4Go1EMTyJnTs1ra5EUU4MBV7eniSyDzw0Lsax+LsjCo4cQ5XEju7wLwgQpnGHAtLt8fcgaEsRdfV3q069xUai8LTtpPBSOY9I1ntgh9gIH4jQ+EBw7RQZFcnzRezI1wE0mSB6/POj9SfnrmCbBep5g2sQqWq+X6GIn+IdulSDVMSPBqW6+mo7LXm8UcLa6ZyUYTzrJp/qQlkvrnN4VgqPEmqJjjtbLHnu6E0gE3jub9doG6MwjaqxgLZrbwV/1BPv6jTSkdWk6cHP1ymbZ4SRAXty3iAFK1qSdTzFW6Uwcpuc1SQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2017 19:20:28.6114 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2247 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2024 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 0000000..08935a3 --- /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.7.4