From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932245AbbKQVRY (ORCPT ); Tue, 17 Nov 2015 16:17:24 -0500 Received: from mail-bn1on0059.outbound.protection.outlook.com ([157.56.110.59]:60576 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751882AbbKQVRV (ORCPT ); Tue, 17 Nov 2015 16:17:21 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; From: Yury Norov To: , , , CC: , , , , , , , , , , , , , Subject: [RFC2 PATCH v6 00/19] ILP32 for ARM64 Date: Wed, 18 Nov 2015 00:16:40 +0300 Message-ID: <1447795019-30176-1-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [95.143.213.120] X-ClientProxiedBy: HE1PR03CA0033.eurprd03.prod.outlook.com (25.163.170.171) To CO2PR07MB617.namprd07.prod.outlook.com (10.141.228.143) X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB617;2:o1ryf3+/uPsVYoIAbyQcdl1M95HDnHLmvqX5XOLgqAypr/C+PeyGXNHK+3wrKcFKwKq/px2xPtBQPOs+Ii/gqPTtJW0FYmeQqsDv3Ce3XNDjYJwX8qbwo6LKc7VPY3cZvBxctzWfF1Ch+X+3HrFS6Mg8Jo5EOek1JVitNzJ1w4Y=;3:eErD2PDiU0mVmU8kEYQ9uJ1QRBFN/I3K1nEWNqx6ihOxDYunMYLeNifytu/VR0GuZsVRk9nAhO6ZHgDD8berG98YFmz7Xkg1MD42lrkj5cO+A14PMjlU+GR8PcgLezqyuuR/4Y9c8cCtBRmp32THuQ==;25:izqgZKdfwkN62/7UIWHoTCaOTizpzAuTRF+/tIR/btnCicXEqma6JtNeU5nwzLiiR+a3pFOuYdgOZuWzhnD2efAdtTBdXiCDUgqFmoTVsPA8Qzx/37dnyU+UY93U4i9ezEG0W7JAXGhObqQ2fM1kjrooGno0U0b5LJcMPxTfGDF39DYFORCjJh725ZKt0KQhWeWTyS/LN+pDeiohC2evKDxHmnJaKf4g129j9Zls0JOuUpm+nGqn3ahOzMv5UjhZXxyXXNwqn2eD0g5DKSxX/g== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR07MB617; X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB617;20:11VKAI/OoJRmhtjFLHhqHH3bh65eEYHyMHNSo3jdeq3JzCQnoWYdR/Njeb0q6N6FFCQR1dscpgiYmju9bdL3FPMfwA+uUxHNl5DfMfYP1Qfjz8ffHTHE9b2oOu2imZ5FtWZkcReqkdn4xLA1WUuYNNDXsfqovCnqvFYkAphGFlR7ssd3/R6l+6KYbp/4+/IsoZjzxqbYRAra0KkhPPvkWaXjxB3HBA+XKdYCT5y8Z+aIiuzjFKr/mmb+4QpYPjzgD0atHICaX4F1czbkSGkGlqx11+RiLx6ynEqmlFpUo3HvSI7vf4vrJfvdezIVSts9TxAEH0z6u+nf1e08+vvosg71MoG7I3QpBDzbyAlunTHH8li3Bq6DAiea+I+p8XkLjtF16NCWU2Yc6sI3t3QCFGGX4Hk5QdmWJFgbfuT3kMozyufIMWSicO3WltRTVaaLnVkKggrWiPOFhFS1tmB2kLk2Cno6KYXUBKGCSziWoRtMOaY0QO9wstXSLDI7PR75AkUWtKcpYGTTyKUwZQv3cjvitsvTb774tILZJAx1RaxQtIn0c13nMaoBsW1r6p48IuP1qplhU/fMbHnHD7DJb3fMbU/PTiz/roYIvYVo63s= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10201501046);SRVR:CO2PR07MB617;BCL:0;PCL:0;RULEID:;SRVR:CO2PR07MB617; X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB617;4:37tl+G/HqquA/4hWkCKzdLMgzHgGYuIP/6/TMh3byaLbfAMGkvW0d4dp86Zoa3WAVF+b/y3yZJ2ou5+oasdJPrcL2ZgH4SpwiCDHxL+PI3bF84qcinlJuudifxick0Z3gDZeLJwyLfvJMJYjDX97p9MRnOA0fTgeNzI8APQsqV+z6KGoOagIrWbMKX53VdO5AnSLhA0l9wSrQUgWpDJB8z1HkSBDcpD79sa63NM79qPykyYo+VJIioPsKkMxpswuzQ+MOl03IYaVlfvaYF3628tjFTfsjqhFj2+HKTrXOykytSeAhVIf8Db2MuCUQh/Cob/3qSg5m5/zXNelOUckhNSz8zFdMBw2E83U/S4GLYqQynalo/DwMzXMMBy8CS6T X-Forefront-PRVS: 07630F72AD X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6069001)(189002)(199003)(77096005)(5001770100001)(36756003)(97736004)(2201001)(189998001)(101416001)(92566002)(47776003)(5004730100002)(5007970100001)(5001960100002)(81156007)(33646002)(5003940100001)(50466002)(5008740100001)(87976001)(50226001)(48376002)(229853001)(42186005)(106356001)(40100003)(66066001)(105586002)(15975445007)(122386002)(19580395003)(586003)(50986999)(76506005)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:CO2PR07MB617;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CO2PR07MB617;23:suECKUjgkOoplvA+UcKkNp9pp5FCjuOk2qbJVDV12A?= =?us-ascii?Q?kQ+n9iPpydfvjsgpwVD2MZ8BzjHluJQHw/iHZmriee+57Dc8bp7Ww1ytIgBg?= =?us-ascii?Q?YgvkmFZrm5502Pe6EGqrIjKDUPysn7hYhvo3dwdXC4DZm3mKL3VC8U8U5A/Q?= =?us-ascii?Q?LAaGjzVVf3UpuHJvv9YhJlAvt1drETNSuEcUSPzVQNgehQEuogO2O9kkvSfq?= =?us-ascii?Q?IIymZeWbWIy3c6vbT7AFGs6Y8Ia2mzIm/+6lVzlVt2LdkdIXoj93yfPU6xfW?= =?us-ascii?Q?IvFAK25XufChvOG8Cz6FZuuyQ6XgBTovnG8Jq81s/CsacoYtDBGFDp+ul1fg?= =?us-ascii?Q?L3VIiRb2qHzWhn63p/dl50M7jX7bXWNgXRZv9lPO0YpufGV6aVTQa/7W68cb?= =?us-ascii?Q?WMNOQlloCUTNgoR0eAZZqjZVMooWyPip6E7W1UzCrZJR4HaUYfmSPYVUK/ow?= =?us-ascii?Q?jtDsRc9l3gsDbI2TtP56+BXvMUbqU8uT6pxoZECkiZJphNrQTxq7wBscSRxw?= =?us-ascii?Q?+yp8bfEiTaV/FFoLFPH/3xCFedmTPbpwPE/XGJyViBYMyKgEzlsXLBLgduF8?= =?us-ascii?Q?ZjZ2klkGaktP2wIaYCW0PfUP5bn7jHq9cGlyUVloSrkW4LifDTBPhR7FBCyk?= =?us-ascii?Q?Un8LNCgStSUw+M166YVJ0kg/CZZWf34Bj+WhcX51vp2gkFg/2EYZyvTFxZRI?= =?us-ascii?Q?0UWuOAZHsLMmnKS8q6dosLj0ut//jOxzxr3tlcxv5C5/EofjOaWIV7mTn7uL?= =?us-ascii?Q?ktoGx7CrtGgneZcFKokJig/KDztebgDHhbW4OYaLNvceebSY9Qbms6kqHbZJ?= =?us-ascii?Q?ekUc+n5+BNlKFn0Kf64YoDubbabIt0aTqcIoukueqhHGgdV3390QJipeXXQM?= =?us-ascii?Q?YcZjUvMthy5cm/TByMdE9QzOXo0DuVY5qCq9OCVj8cNoLbvhQBKIBEEtUj8J?= =?us-ascii?Q?W82s0S9xYvRB1qycungx/QOoTAzLfsJhxF+2xcL2xzufN08xDgd1b/YvNLl2?= =?us-ascii?Q?XWZFQ6hf0opCZqQfwbjZEd?= X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB617;5:OiKtxu8/9zZGSab00b9kEw54NGoBIZiX/YFN9CHgTWhr5hhuGZqBEdbkk87klrT4dooYVBt9VN9sAGkoZOb7F6QkDxB09CNbFKT53x776TNOeaiFXEEnGwEFjV1TeU3Go+dajYyUm493Ib9GBSsjRQ==;24:SZt8hqzta+YqaSy+QwrvZtc4K8bPxj/MBLvgEEOzCLHvoxG4QXRs/iHhwxOdVayVNVLDLEtFBt9rw2nw7lv8eTrkSaQeiTPnXqB1eA1KVNg=;20:qM25E5wVJZXAx3DH5O80OP9vRY8tHIvMr2mvW4RSpsdkalLonrkIioa9Y05/1c77SwHZAgWzNMP7of1S4AurDQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2015 21:17:14.0588 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB617 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ------8<----- Colleagues, I'm gonna to send it to list. Please, take a look. ------8<----- This is still RFC because ~20 tests still fail, and because it's based on 4.3 kernel version, and some work is needed to rebase on 4.4. I'd preffer to do it later. v3: https://lkml.org/lkml/2014/9/3/704 v4: https://lkml.org/lkml/2015/4/13/691 v5: https://lkml.org/lkml/2015/9/29/911 v6: - time_t, __kenel_off_t and other types turned to be 32-bit for compatibility reasons (after v5 discussion); - related changes applied to ILP32 syscall table and handlers; - ILP32 VDSO code excluded. It's not mandatory, and caused questions during review process. We definitely make sure we will follow up with a VDSO later on because it is needed for performance reasons; - fixed build issues with different combinations of AARCH32 / ILP32 enabling in config; - ILP32 TLS bug fixed; - entry32-common.S introduced to hold wrappers needed for both ILP32 and AARCH32_EL0; - documentation updated according to latest changes; - rebased to the current head; - coding style re-checked; - ILP32 syscall table turned around. Testing is performed using LTP with scenario 'ltplite'. Tested on QEMU + vanilla defconfig kernel. Regressions are mostly related to core dump genereation, readdir(), and futex(). Some tests fail both in ILP32, and LP64. The full regression table is: ILP32 LP64 float_bessel FAIL 134 PASSED 0 float_exp_log FAIL 134 PASSED 0 float_iperb FAIL 134 PASSED 0 float_power FAIL 134 PASSED 0 float_trigo FAIL 134 PASSED 0 abort01 FAIL 2 FAIL 2 fcntl14 FAIL 2 FAIL 2 kill11 FAIL 2 FAIL 2 mmap16 FAIL 6 PASSED 0 open12 FAIL 2 PASSED 0 pause01 PASSED 0 FAIL 9 pipe07 FAIL 2 PASSED 0 readdir01 FAIL 1 PASSED 0 rename11 FAIL 2 PASSED 0 rmdir02 FAIL 2 PASSED 0 setregid02 FAIL 1 FAIL 1 settimeofday01 FAIL 1 FAIL 1 umount2_01 FAIL 2 PASSED 0 umount2_02 FAIL 2 PASSED 0 umount2_03 FAIL 2 PASSED 0 utime06 FAIL 2 PASSED 0 Kernel with this patchset, and corresponding version of glibc is here: https://github.com/norov/ Andrew Pinski (14): arm64: ensure the kernel is compiled for LP64 arm64: rename COMPAT to AARCH32_EL0 in Kconfig arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64 arm64:ilp32: share signal structures between ILP32 and LP64 ABIs arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat) arm64:ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64 arm64:ilp32: share HWCAP between LP64 and ILP32 arm64:ilp32 use the native LP64 'start_thread' for ILP32 threads arm64:ilp32: support core dump generation for ILP32 ptrace: Allow compat to use the native siginfo arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it arm64:ilp32: use the native siginfo instead of the compat siginfo arm64:ilp32: add ARM64_ILP32 to Kconfig Jan Dakinevich (2): ilp32: common 32-bit wrappers arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl Philipp Tomsich (2): arm64:ilp32: add documentation on the ILP32 ABI for ARM64 arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32 Yury Norov (1): aarch64: ilp32: use generic stat64 structure Documentation/arm64/ilp32.txt | 47 +++++++ arch/arm64/Kconfig | 12 ++ arch/arm64/Makefile | 5 + arch/arm64/include/asm/compat.h | 70 +++++++++- arch/arm64/include/asm/elf.h | 105 ++++++++++++-- arch/arm64/include/asm/fpsimd.h | 2 +- arch/arm64/include/asm/hwcap.h | 12 +- arch/arm64/include/asm/memory.h | 2 +- arch/arm64/include/asm/processor.h | 18 ++- arch/arm64/include/asm/ptrace.h | 2 +- arch/arm64/include/asm/signal32.h | 19 +++ arch/arm64/include/asm/stat.h | 2 + arch/arm64/include/asm/thread_info.h | 3 +- arch/arm64/include/asm/unistd.h | 11 +- arch/arm64/include/uapi/asm/bitsperlong.h | 9 +- arch/arm64/include/uapi/asm/siginfo.h | 21 +++ arch/arm64/include/uapi/asm/signal.h | 31 +++++ arch/arm64/kernel/Makefile | 4 +- arch/arm64/kernel/asm-offsets.c | 2 +- arch/arm64/kernel/entry.S | 18 ++- arch/arm64/kernel/entry32-common.S | 37 +++++ arch/arm64/kernel/entry32.S | 29 ---- arch/arm64/kernel/head.S | 2 +- arch/arm64/kernel/hw_breakpoint.c | 7 +- arch/arm64/kernel/perf_regs.c | 2 +- arch/arm64/kernel/process.c | 4 +- arch/arm64/kernel/ptrace.c | 47 ++++--- arch/arm64/kernel/signal.c | 21 ++- arch/arm64/kernel/sys_ilp32.c | 223 ++++++++++++++++++++++++++++++ arch/arm64/kernel/traps.c | 4 +- arch/arm64/kernel/vdso.c | 12 +- include/linux/compat.h | 4 + include/uapi/asm-generic/siginfo.h | 17 ++- include/uapi/asm-generic/signal.h | 27 +++- kernel/ptrace.c | 24 +++- 35 files changed, 745 insertions(+), 110 deletions(-) create mode 100644 Documentation/arm64/ilp32.txt create mode 100644 arch/arm64/kernel/entry32-common.S create mode 100644 arch/arm64/kernel/sys_ilp32.c -- 2.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: ynorov@caviumnetworks.com (Yury Norov) Date: Wed, 18 Nov 2015 00:16:40 +0300 Subject: [RFC2 PATCH v6 00/19] ILP32 for ARM64 Message-ID: <1447795019-30176-1-git-send-email-ynorov@caviumnetworks.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org ------8<----- Colleagues, I'm gonna to send it to list. Please, take a look. ------8<----- This is still RFC because ~20 tests still fail, and because it's based on 4.3 kernel version, and some work is needed to rebase on 4.4. I'd preffer to do it later. v3: https://lkml.org/lkml/2014/9/3/704 v4: https://lkml.org/lkml/2015/4/13/691 v5: https://lkml.org/lkml/2015/9/29/911 v6: - time_t, __kenel_off_t and other types turned to be 32-bit for compatibility reasons (after v5 discussion); - related changes applied to ILP32 syscall table and handlers; - ILP32 VDSO code excluded. It's not mandatory, and caused questions during review process. We definitely make sure we will follow up with a VDSO later on because it is needed for performance reasons; - fixed build issues with different combinations of AARCH32 / ILP32 enabling in config; - ILP32 TLS bug fixed; - entry32-common.S introduced to hold wrappers needed for both ILP32 and AARCH32_EL0; - documentation updated according to latest changes; - rebased to the current head; - coding style re-checked; - ILP32 syscall table turned around. Testing is performed using LTP with scenario 'ltplite'. Tested on QEMU + vanilla defconfig kernel. Regressions are mostly related to core dump genereation, readdir(), and futex(). Some tests fail both in ILP32, and LP64. The full regression table is: ILP32 LP64 float_bessel FAIL 134 PASSED 0 float_exp_log FAIL 134 PASSED 0 float_iperb FAIL 134 PASSED 0 float_power FAIL 134 PASSED 0 float_trigo FAIL 134 PASSED 0 abort01 FAIL 2 FAIL 2 fcntl14 FAIL 2 FAIL 2 kill11 FAIL 2 FAIL 2 mmap16 FAIL 6 PASSED 0 open12 FAIL 2 PASSED 0 pause01 PASSED 0 FAIL 9 pipe07 FAIL 2 PASSED 0 readdir01 FAIL 1 PASSED 0 rename11 FAIL 2 PASSED 0 rmdir02 FAIL 2 PASSED 0 setregid02 FAIL 1 FAIL 1 settimeofday01 FAIL 1 FAIL 1 umount2_01 FAIL 2 PASSED 0 umount2_02 FAIL 2 PASSED 0 umount2_03 FAIL 2 PASSED 0 utime06 FAIL 2 PASSED 0 Kernel with this patchset, and corresponding version of glibc is here: https://github.com/norov/ Andrew Pinski (14): arm64: ensure the kernel is compiled for LP64 arm64: rename COMPAT to AARCH32_EL0 in Kconfig arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64 arm64:ilp32: share signal structures between ILP32 and LP64 ABIs arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat) arm64:ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64 arm64:ilp32: share HWCAP between LP64 and ILP32 arm64:ilp32 use the native LP64 'start_thread' for ILP32 threads arm64:ilp32: support core dump generation for ILP32 ptrace: Allow compat to use the native siginfo arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it arm64:ilp32: use the native siginfo instead of the compat siginfo arm64:ilp32: add ARM64_ILP32 to Kconfig Jan Dakinevich (2): ilp32: common 32-bit wrappers arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl Philipp Tomsich (2): arm64:ilp32: add documentation on the ILP32 ABI for ARM64 arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32 Yury Norov (1): aarch64: ilp32: use generic stat64 structure Documentation/arm64/ilp32.txt | 47 +++++++ arch/arm64/Kconfig | 12 ++ arch/arm64/Makefile | 5 + arch/arm64/include/asm/compat.h | 70 +++++++++- arch/arm64/include/asm/elf.h | 105 ++++++++++++-- arch/arm64/include/asm/fpsimd.h | 2 +- arch/arm64/include/asm/hwcap.h | 12 +- arch/arm64/include/asm/memory.h | 2 +- arch/arm64/include/asm/processor.h | 18 ++- arch/arm64/include/asm/ptrace.h | 2 +- arch/arm64/include/asm/signal32.h | 19 +++ arch/arm64/include/asm/stat.h | 2 + arch/arm64/include/asm/thread_info.h | 3 +- arch/arm64/include/asm/unistd.h | 11 +- arch/arm64/include/uapi/asm/bitsperlong.h | 9 +- arch/arm64/include/uapi/asm/siginfo.h | 21 +++ arch/arm64/include/uapi/asm/signal.h | 31 +++++ arch/arm64/kernel/Makefile | 4 +- arch/arm64/kernel/asm-offsets.c | 2 +- arch/arm64/kernel/entry.S | 18 ++- arch/arm64/kernel/entry32-common.S | 37 +++++ arch/arm64/kernel/entry32.S | 29 ---- arch/arm64/kernel/head.S | 2 +- arch/arm64/kernel/hw_breakpoint.c | 7 +- arch/arm64/kernel/perf_regs.c | 2 +- arch/arm64/kernel/process.c | 4 +- arch/arm64/kernel/ptrace.c | 47 ++++--- arch/arm64/kernel/signal.c | 21 ++- arch/arm64/kernel/sys_ilp32.c | 223 ++++++++++++++++++++++++++++++ arch/arm64/kernel/traps.c | 4 +- arch/arm64/kernel/vdso.c | 12 +- include/linux/compat.h | 4 + include/uapi/asm-generic/siginfo.h | 17 ++- include/uapi/asm-generic/signal.h | 27 +++- kernel/ptrace.c | 24 +++- 35 files changed, 745 insertions(+), 110 deletions(-) create mode 100644 Documentation/arm64/ilp32.txt create mode 100644 arch/arm64/kernel/entry32-common.S create mode 100644 arch/arm64/kernel/sys_ilp32.c -- 2.1.4