From patchwork Wed May 16 08:18:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 10403029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73482601F9 for ; Wed, 16 May 2018 08:27:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60CE924B5B for ; Wed, 16 May 2018 08:27:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54BF0287CC; Wed, 16 May 2018 08:27:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 867C324B5B for ; Wed, 16 May 2018 08:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LlrwjxlAFHe+pJuBCQLg8uphAC1gXW3HB4x7b7lh1R4=; b=gIIsPS2+Hoiz5u 41K+ws8MnV3xXNi7kFLc4gn0n8rhRYIa4/HGp10nX5UrCpZc9gG/aRbXOAgVtWe9mguisz9i4EoZx 13Of4tC3b76TiuzwW3zFO0d/q6NnmJQQe7enXmrHjzKw0IHpdUSPRzSiG6dUSSlaxFzSJqX6ZdczN ZBEM79cEwKie3Rqz/SFvKrHX5Cs1q/ljC3FswvMhgrbK0SUpOV8/tPbZ7glGQmkPsPUiEJPS2tOaT ie07rpGCZu8usVjkHGtuGU7bGQR4L7a1F3y338gjlNJ39Nvu9ooD+Iqs8DokJnb7TXizIockGEVBM FK5t09QYK8WJ1HDzPo8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIrmc-0000Gq-C5; Wed, 16 May 2018 08:27:38 +0000 Received: from mail-cys01nam02on0064.outbound.protection.outlook.com ([104.47.37.64] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIrgO-0004EM-NO for linux-arm-kernel@lists.infradead.org; Wed, 16 May 2018 08:21:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kZOgkSOIBPGJPLUPbvxw7kRDYeUeGFpYRIDmWhJ7Tj4=; b=C/BrVnxASSG82m+l8AmoVfPrwvkwLOLviWnjbCbT/e/vvATr4JBCzNWeSynE7Jd0e7F1jpc53B0rRNKYk7uHHeOk8QoSrPnpq7OvdEkrKeJMRhGxePRkhFZfgeZ37ODGSVicAJ41DreLyzvny4cE8wxhkl79sZPK1BCB23Im1GU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Received: from localhost (176.59.36.13) by BYAPR07MB4374.namprd07.prod.outlook.com (2603:10b6:a02:c0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Wed, 16 May 2018 08:20:57 +0000 From: Yury Norov To: Catalin Marinas , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org Subject: [PATCH 07/24] arm64: ilp32: add documentation on the ILP32 ABI for ARM64 Date: Wed, 16 May 2018 11:18:52 +0300 Message-Id: <20180516081910.10067-8-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516081910.10067-1-ynorov@caviumnetworks.com> References: <20180516081910.10067-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [176.59.36.13] X-ClientProxiedBy: VI1PR08CA0115.eurprd08.prod.outlook.com (2603:10a6:800:d4::17) To BYAPR07MB4374.namprd07.prod.outlook.com (2603:10b6:a02:c0::17) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4374; X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4374; 3:fkrIjfvGcZKkBOen97Lcm140az6nuLuB6TUc4RNo6/xh6my7az2KK8NDrExAGNdK+N4A2CCjxfmxm+CYluvUZkXL/WKi5gQe4jhuA0IZxjZTI7IEfdTsVgHT/LOkZKCw1Q1DZGlrkIyArPU7VseO46bAILIdtkbzOb/aBQ3wy7/3TVAWWFz5T3urKyFZ+0cExOWnt/Mav/cxoKCyO9+HlRQQ5x5k1vKPisvtkqTjdU/u3n/s1zliXdpnefS31tPC; 25:xgnbaVj2Emy2PFoiAk7hUy9J/bPBhIwIrWj15i4o0lOKinqkhXBGAvctApDhkJExy/rLOrUXRgSHq1RvNEbpRW6IREA36cZFoPj9oSbdTFa8QKAw6XGXWJYMfW3X77H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gv78VZsR11xxeTsRG9LSEOE7lHn1yPQAiMxsmiyPd+LVNHb8fEiOB+6PH9OCeWKGRvT4cAg=; 4:6p/0na0d6qFzUiq9NqjfcmJIceYrX0cNrflJ8e7ZJzDy8DYX2jqqp133rDxtENEdHJ4BUXrHFlUthpsHp7tguWmiVDxIZiDN3zr2PNeDaFi9qfpxtlYRQz4bHFixzSHmykyUSbQzYkSZoANDVqooXJztoyWtV9khk/Mt5G0t8qQ80Djj8tf4fzorVgDK/m61fY/XSsf5YjbRsBKJ8PKG/hVf1VxNnqDsVRpe77U4BIb/iel9SEZgKjgrxtpxMh+FQGD2GDiLIGc6yhIsZ8DWew== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(93006095)(3002001)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:BYAPR07MB4374; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4374; X-Forefront-PRVS: 0674DC6DD3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(376002)(366004)(346002)(396003)(39860400002)(39380400002)(199004)(189003)(25786009)(478600001)(68736007)(42882007)(16526019)(36756003)(305945005)(4326008)(386003)(81156014)(7406005)(7416002)(50226002)(6666003)(2906002)(81166006)(53936002)(8676002)(575784001)(5660300001)(39060400002)(8936002)(110136005)(3846002)(6116002)(6496006)(54906003)(51416003)(6486002)(52116002)(1076002)(47776003)(72206003)(7736002)(97736004)(66066001)(16586007)(486006)(186003)(2616005)(26005)(476003)(956004)(48376002)(446003)(11346002)(76176011)(105586002)(106356001)(50466002)(316002)(76506005); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4374; H:localhost; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BYAPR07MB4374; 23:mHsSiaSMMpecEk/lrCl70OdnYpJdnkpWCurLbrNWf?= =?us-ascii?Q?i6fFT0ICh7XCzmQrcaFGEvWlK3DY9UmvTrfdsboMwfR/nRPV8ZQprtIV6GGM?= =?us-ascii?Q?CgnQa+BhgSZrBeSjp70REFWLdb4cgsSun80AbnTfDhaBsSz38cgx7K97k3g3?= =?us-ascii?Q?Oe6YKMRQRg5uKPIltl1qxggjE6c76DV/7jlFRuAljp2RwEx2FQA3PzSh4/sL?= =?us-ascii?Q?ADnE5SNPz5u56yiQ3kzF09VGRHIU2GysatBEl5gQ0n3z4FWb0K+UT/wKErZq?= =?us-ascii?Q?Mm1p+ScQlIVN0L89O7sFAe+iyfTZo9EdjUnoVUkj6sgf1ApUzLBfdygCU2Pi?= =?us-ascii?Q?H9jlfFWVxwEe7WzzyMDMcQakqlmOP0WYY8Xh7wFMALXsB6aO077vhqb3mOgB?= =?us-ascii?Q?FRPbwYTNxmgxwdaWqvPhTX+cKCHJRDRxdQcK6vodm7tvNgZlJInGcJVMCtRX?= =?us-ascii?Q?ymRKOtxtfh0Fa6UkLJfO/BwPGDY51dmNPBE4QqB4O83LDJSASNJqQxWZ2VyU?= =?us-ascii?Q?NeQ+K1AgyaXuAMXh33Tk7LIGTECQ4rxC/Oj8Q/NKU7toqEDTgS2hD2u/KbhZ?= =?us-ascii?Q?oQdXJySxIQLqkraddqFhljtLmXqv5HTFJQ3AU5t4o1g58KaW/f1+Nx96Lxym?= =?us-ascii?Q?mKwmzHWjtBcKHiijGYatMx0bfUXsqeTAntKmISMSuznPqpgiDyTpQdI1nTRT?= =?us-ascii?Q?jtRp3uR2IEeRNjz1hxjNkJf2DkaVgXfgt0mJxWJO6Z+YjK5V/c8awqtwpYlS?= =?us-ascii?Q?6aReBDoxgItnduk6IyPQkZOo9A7cXzp/A0Czk4qZDjN82R3HrJL+SKRQqkzu?= =?us-ascii?Q?C/R7GMTN5oD9tOHVZXwvtxZ9MZCoBdWX65y4sWFS1+4jJzBkG2RrzZVpk8rl?= =?us-ascii?Q?5gbIK0in26J42nemH1XQ3ixCV7I9CTZ9xyIPzSfngJo0iXfAmViHf4MFf6So?= =?us-ascii?Q?IJKqRuvR+rTo69I1SpVqWkwJyKr1afab850gKvcLN6hXOcoJ7M5PRY9xSYCJ?= =?us-ascii?Q?rvucqpb3XqAGTpdlkNBd+XM7EycQhcnW0oVh/EhuVLa87zur4CUWdUN9ndJu?= =?us-ascii?Q?HQtAFJf2LOkZXirN36XNPAtlcCciYvGcJXduJ3n/pVkq2QBxyxea5v9tkUJo?= =?us-ascii?Q?GqJScyKz0uR6LX8l2VxKyeN0bxfHMfn34RCE03id95WBwk3hQ/CVy0DKQVIX?= =?us-ascii?Q?cTIOY1l0EMuXkoVxXquOa3bqzTbneqsGzJdscMrsQfgbivmx4eFHDjCTODwP?= =?us-ascii?Q?XTSn0vRAG9nvCRfpHp5uMUbH5Fwn8oeQ8/euFVrJVnztqwJFxBgnRJW/rquc?= =?us-ascii?Q?QeCm2yL3xl4fswLAaCW6wIwCOTg54gVec17xa5eYsDPe6MfFH4neuGNb2D50?= =?us-ascii?Q?xFtuw=3D=3D?= X-Microsoft-Antispam-Message-Info: SSjkjH4uW10xV6Pj+rtDFKnRU+DyM51ptWVEyzwnUMYVViwr6WTK8ODaDwe4etAiFHBGtSh+YVe/udx/H5XxlKrCWmkh67IkCZX7z6A/8JO5ZQrS/rnfsp3LlIdZJ0QllMfp35bsbPTMQT8urc14wcW0JzefIea6vy3XmrBvMk82u1rptXcbOD565Wj2FWHz X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4374; 6:l9QH6+q+sk7D5QZS61e7YBDOZaAdogQAwSq5wd5cnA7j7hQe4CvjXRXhHXzSOu/GC2l46tElX5utIEJrkNJaeeqpJ64DTjvgrHj2Zt49DdC0mLRAuEjuNCPeQ08CKKNywmfDmOC+ukBRZhIaFaGGga7e+YZSR785ue4XkMSFSYJmYDdsyxNkd8IYqpWnEHK9A7NX2545XOehTx7+BCmPZXRwpB2lbw5To+7386EKzFWbMD4XekrnGXy8YiWilSyCB0IMpRKgkzq95LJpAvJLA4UWSBQHWry8DeTABBC5BkcWQqWleuIgnhT3hBA2RBOvUsGaee2Cv7bMR8/dPIoxWGlRZmO4UWCjnbCkabOg4BVDLWp67nHIEugPw2rxt15SYv5gLn1gXjKJdWOGURhLDpI1uibEdRk2wyDOLikrtmLlzigUwmRTOqgpAWV9zdOYXSY3QVQdNmnm6v/wkaalTQ==; 5:jaSU+5tQ1jnZh4UAjYcpas5x0Cus+btCU4dQ5pY1fD/Ra9AtOYezL9dnHZwGZ6onkjB8N1VZuYdPbpkaJcdJWBvCStlYlmqVM7LaBiFd5RQTTyi61Xh57MdC/Cie1VvwAxPmNjLCyoU6W/SVmfyxTkwdiN/s4QqgFi9iGkORzkk=; 24:sYm//1VdCxjX4WsLuVeo4e3Sc3rx6JEERnOfCHrsRCGU8kY5nK9tSaWsWlYaLzgm8T1943hg5V4Seoyj5Qo9pzmtbCXo0vEQ6TNheUEZH+4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4374; 7:pH1eI/mHF6qW/kKO8d5RtHUMiwJBNQGjv6nL3y4xGIsuVyM1Vq5nkWEt9u0vLHMq5x+KvylwT322zAbeXDVze73oLz1NxG/QF4iW0X2UDu0MJTAipKptpNEPJnoAlfeiqi8SPhrBj8IjpK49GGjP/su2PFQfznduWaQzqeUn0JxKlcuN1jxGBPsrvqgoH8gZTZNVxNYHsak/BDgnOianTZMPNTqxenDFVIAo7kQV6SFzJiugRboGfIChA340srqJ X-MS-Office365-Filtering-Correlation-Id: 8ae0c413-6526-4513-676a-08d5bb05f39e X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2018 08:20:57.1768 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ae0c413-6526-4513-676a-08d5bb05f39e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4374 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180516_012112_879711_86AFD5EF X-CRM114-Status: GOOD ( 10.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Szabolcs Nagy , Heiko Carstens , Yury Norov , Philipp Tomsich , Joseph Myers , Steve Ellcey , Prasun Kapoor , Andreas Schwab , Alexander Graf , Bamvor Zhangjian , Geert Uytterhoeven , Dave Martin , Adam Borowski , Manuel Montezelo , James Hogan , Chris Metcalf , Andrew Pinski , Lin Yongting , Alexey Klimov , Mark Brown , Maxim Kuvyrkov , Florian Weimer , Nathan_Lynch , James Morse , Ramana Radhakrishnan , Martin Schwidefsky , "David S . Miller" , Christoph Muellner Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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..d0fd5109c4b2 --- /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. Following 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 alignment 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 expect, and struct ilp32_ucontext, to handle +AARCH64 register set and 32-bit userspace register representation. + +elf_gregset_t is taken from lp64 to handle registers properly.