From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754939AbbI2WPA (ORCPT ); Tue, 29 Sep 2015 18:15:00 -0400 Received: from mail-by2on0077.outbound.protection.outlook.com ([207.46.100.77]:61273 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752314AbbI2WOv (ORCPT ); Tue, 29 Sep 2015 18:14:51 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; From: Yury Norov To: , , , , , CC: , , , , , Yury Norov Subject: [PATCH v5 00/23] ILP32 for ARM64 Date: Wed, 30 Sep 2015 01:13:57 +0300 Message-ID: <1443564860-31208-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: [91.78.158.8] X-ClientProxiedBy: HE1PR03CA0032.eurprd03.prod.outlook.com (25.163.170.170) To BY2PR07MB613.namprd07.prod.outlook.com (10.141.222.144) X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB613;2:f0veHgfBb9yXDoC0fz4/5YmJPJ7slywxvS5wjWHnZEYCrCzVE4Cp47bcafhJtVqB1XamPBaJuSPNiu5hGNVEvWlbcaN42242FCsn4qE9yJtSRKzHU1+rR6V8fbtGR8gVhLeeBIeEYf1KiOLQn9OKegk9h4G0eECzWM9wM5sYjFQ=;3:pL4WlIGjmDuEEAroIMFWuXcZa4U8XLzXZPwdVxFqTpqL580xUD+sNhmdVnYQ7Ha5IdXVqtvHQiOiXcYaoGPwz9DPikpC1Au5y/RTLLgYL3quOSjg8htBV747vswsHaGutFjT0vGWEcY/Al8zoJhGug==;25:vgHJ6ShjPBT0bXoxhmb2M1EUSCTy6cFLmR1iyug7ao1HpByAd60DPbr7lBSZIzRhuVRlnJ91Os1XG9fG5PCq4xKR0V5ugqchnWRTwk05HukCN7M0qsjvZtmbpmNfHBIBRiCNgSh55wl0YoGmKDzdvAFZ7XC2TaSotsblBpoC8WmBNOYVEZG9IJLqqwcgeIr5Tq8qtuWFa2SuOfaGGn0ru1jdoUYse8NKmA41dxWae++p7wQCaTzbHki9U5ndy/nMZ20+AGY0ogHl5BLbGleb+w== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB613; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB613;20:Wdgggt6aRGOLhD5n9x6RZfxicgvXw4IzftDDGb2N9kdFoSKwvcFwh13SHrwPrfdRD4p6Rt7a8yzd2+VtPzk9ommkDbJwnHVKh9cCcPg/G1+3y6K/qjaptNpOTOaNOX54MOyqMtn4ZWLWDMtk4GwOH0na1hIBLNt+4JbDRVm+Vow0oYi/GDdDB4Z6KnjHzWrDbXVPafrIi/oB/Ac9aWS1dczKzYI8pdjoE27atEGLGiz5BD1UFXOjHaV/DM+EhybUrAgDzVLvA3wl14YILFgIMw8xdwIySjoN4zhnrDoH+eQNjqfg0y/g/mcp/JWHNVNAAnq1hd812jNQ2X0HjJ9Slo7b9g2TBBb0cYdd2QqRqzpHjZL8UbJ/OSs5t5Sve9/nF1VP7+YZ8Tuli6hazWKIszqk/59ekssYQnog68g6CeFFpsB2BCXA1HrjtfOTEH7snnPNHMeEMVsWFtQFBXOhL1a9zizVSQhKs6ZUQtZM1u07VcVdgHSYywpWmHu3YnZUST0N38m2g1wjG6CfRcYE4mDr7M8i00UJa+WUdPpJkPzbe/4qomJDljkEin7yJRMD1axJruk8mvz+WsPGVaQ5MUIuALUWDVPfNkDmYL/1nmM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(3002001);SRVR:BY2PR07MB613;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB613; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB613;4:A8BjcIvxjh8dJMyLnl+iwIfVK6z6q+G8cmxT6VJroCbpynRrbuNG3mpdB9PwqiuzA8Dql9OPBE+gavxcy3GWtSufi+QOrEbNwcXymMQxURx+fbuN4Q//RIXLHLHyfhiCmc3tp/FxwSLR7kVadH+z0eaq1C3bi0WJ6EKgz0JRHgiDmPi8bUi4/7INE6Qhz4asi5VqH93Fm2X1ZbYYu9C9Tf8YBaCHv9IGkHMfq+oM8QTCAgahpwwM14VDIs/O0p5yrdMQ0I/9uihACtxqAf0ch2YB9xRIWflz6t0iazAp1RU/3gBZvlgpwwYZ6hB2ySo6laTzf3DHrc3jRdfEiDD1ZVZCrE004s76sJVlX0Ys/BE= X-Forefront-PRVS: 0714841678 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(6009001)(189002)(199003)(5001960100002)(5001770100001)(66066001)(64706001)(46102003)(47776003)(5001830100001)(5001860100001)(92566002)(107886002)(50986999)(36756003)(97736004)(81156007)(87976001)(4001540100001)(15975445007)(76506005)(42186005)(68736005)(189998001)(77096005)(48376002)(50226001)(5007970100001)(40100003)(101416001)(5004730100002)(62966003)(5003940100001)(2201001)(19580395003)(77156002)(106356001)(105586002)(229853001)(33646002)(122386002)(5008740100001)(50466002)(2101003)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR07MB613;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR07MB613;23:YWjsaWT4fFPkPG+9uEkfKtM8HwxjijFngpHhn0BWx2?= =?us-ascii?Q?vDCEYzWa8o4R8p6sechkd+iLzWGGzTUnQLJ+uLIG7efvHS7VRptXQy1SEp3f?= =?us-ascii?Q?TDRNMsn5Ic3ItejHTEur/VNeIQWUmyZFT2pQoNXDmSRL2K3smR6Q4/BmBnQX?= =?us-ascii?Q?trSP+57kH1fUvP6qfINn1AcmezWG8R6CGTgljKAW7BRege0AmnBF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sAs3eA+2l0ktFOHeR9xPAmQ5YE26xZNBmOI?= =?us-ascii?Q?SX1lWEUa7H+ShC7CmeUZtEk2Ei1E1mEXCR+87svNLdynKbt6jz7BtkPfSfj1?= =?us-ascii?Q?92lcQbLIMgExMVxU5b/QvJQP8rPu8K5ea97DOfJ1k1EjAiNK+o4ivkAJd0I5?= =?us-ascii?Q?IiRPUrkIvpS/hau84ZyTSrCV+5EItehe+zWDYN?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB613;5:FdYI4xOjwM1Ho0i/TvSaQA5XbWdRJalJSii+El5HTNO2OIZrSSa6lRnruRV/1FgAN4T4Zxr5yX5/Xt2WURrnGG2ap++3GTRPCYqtwTVOZcLprRgokVNREjK313Orecp3FRMZv2pdFfphMc66fkrFKg==;24:nihw89jpjDS09ICa3kru/z72YzbnnBtlMlYxCd9MKChZHAySZOVgZbenxZhNPfmjMn6bdXLREFOvxq0b6G64uQSznBC1EBDTlfwOan96Ztc=;20:LG5prwGg3CKZ2v1pj4Fp/JC2i7kFLjz22kzH7STpMFqpnos4Hye4SCeyigoNwwEJMpISGxWvyJCGFiDT+E4NCA== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2015 22:14:48.3597 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR07MB613 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org V5 reincarnation for ILP32. This is mostly the same code as Andrew suggested in v3: https://lkml.org/lkml/2014/9/3/704. V4 series and discussion: https://lkml.org/lkml/2015/4/13/691 Discussion on v3 and v4 raised questions and some disagreement in community, and therefore patches are not accepted till now. In this v5 I tried to avoid any changes that are not about obvious fixes, so all interface and implementation questions are still here. In v5: - rebased on top of 4.3.0-rc3; - build fixed if ILP32 enabled without AARCH32; - PATCH v4 22/24 (use compat for stack_t) dropped because it confuses debug tools like gdb and strace; - PATCH v4 20/24 (use compat-syscalls for msgsnd and msgrcv for ILP32) dropped as breaking tests; - PATCH v5 22/23 (msgrcv, msgsnd handlers) introduced for proper handling of msgrcv, msgsnd; - other minor fixes. Questions under discussion: - What for ILP32 on ARM64? See https://lkml.org/lkml/2015/4/13/814 and http://permalink.gmane.org/gmane.comp.lib.uclibc.buildroot/121100 Briefly, - for compatibility; - for performance; - for memory saving. - ABI questions: time_t and so on; I think we are out of choice now. Patches to GCC and Glibc are upstreamed more than a year ago, and there already might be a code compiled against existing ABI. At the end, there is no major disagreement, and final word is after ABI users. And I found no objections from that side. - Implementation questions: use ILP32 separated table or not, and others; Code proposed by Andrew works just fine for more than a year, and it even shows slightly better performance comparing to LP64: http://permalink.gmane.org/gmane.comp.lib.uclibc.buildroot/121100 So I see no reason to change something except obvious bugs, if found. Andrew Pinski (18): 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:ilp32: expose 'kernel_long' as 'long long' for ILP32 arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64 arm64:ilp32: share signal structures between ILP32 and LP64 ABIs arm64:ilp32: use 64bit syscall-names for ILP32 when passing 64bit registers arm64:ilp32: use non-compat syscall names for ILP32 as for LP64 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 arm64: add support for starting ILP32 (ELFCLASS32) binaries 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 Philipp Tomsich (4): arm64:ilp32: add documentation on the ILP32 ABI for ARM64 arm64:ilp32: COMPAT_USE_64BIT_TIME is true for ILP32 tasks arm64:ilp32: add vdso-ilp32 and use for signal return arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32 Yury Norov (1): aarch64: ilp32: msgrcv, msgsnd handlers Documentation/arm64/ilp32.txt | 64 ++++++ arch/arm64/Kconfig | 14 +- arch/arm64/Makefile | 6 +- arch/arm64/include/asm/compat.h | 65 +++++- 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 | 12 +- arch/arm64/include/asm/ptrace.h | 2 +- arch/arm64/include/asm/signal32.h | 2 + arch/arm64/include/asm/stat.h | 2 + arch/arm64/include/asm/thread_info.h | 3 +- arch/arm64/include/asm/unistd.h | 8 +- arch/arm64/include/asm/vdso.h | 4 + arch/arm64/include/uapi/asm/bitsperlong.h | 9 +- arch/arm64/include/uapi/asm/posix_types.h | 12 +- arch/arm64/include/uapi/asm/siginfo.h | 21 ++ arch/arm64/include/uapi/asm/signal.h | 32 +++ arch/arm64/include/uapi/asm/unistd.h | 7 + arch/arm64/kernel/Makefile | 8 +- arch/arm64/kernel/asm-offsets.c | 2 +- arch/arm64/kernel/entry.S | 18 +- arch/arm64/kernel/head.S | 2 +- arch/arm64/kernel/hw_breakpoint.c | 6 +- arch/arm64/kernel/process.c | 4 +- arch/arm64/kernel/ptrace.c | 51 +++-- arch/arm64/kernel/signal.c | 23 ++- arch/arm64/kernel/sys_ilp32.c | 223 +++++++++++++++++++++ arch/arm64/kernel/traps.c | 4 +- arch/arm64/kernel/vdso-ilp32/.gitignore | 2 + arch/arm64/kernel/vdso-ilp32/Makefile | 72 +++++++ .../siginfo.h => kernel/vdso-ilp32/vdso-ilp32.S} | 22 +- arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S | 98 +++++++++ arch/arm64/kernel/vdso.c | 73 +++++-- include/linux/compat.h | 4 + include/uapi/asm-generic/siginfo.h | 17 +- include/uapi/asm-generic/signal.h | 27 ++- include/uapi/asm-generic/unistd.h | 5 +- kernel/ptrace.c | 24 ++- 40 files changed, 973 insertions(+), 96 deletions(-) create mode 100644 Documentation/arm64/ilp32.txt create mode 100644 arch/arm64/kernel/sys_ilp32.c create mode 100644 arch/arm64/kernel/vdso-ilp32/.gitignore create mode 100644 arch/arm64/kernel/vdso-ilp32/Makefile copy arch/arm64/{include/uapi/asm/siginfo.h => kernel/vdso-ilp32/vdso-ilp32.S} (60%) create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S -- 2.1.4