Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933309AbcDYSUD (ORCPT ); Mon, 25 Apr 2016 14:20:03 -0400 Received: from mail-bn1on0056.outbound.protection.outlook.com ([157.56.110.56]:64165 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754678AbcDYST5 (ORCPT ); Mon, 25 Apr 2016 14:19:57 -0400 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=caviumnetworks.com; Date: Mon, 25 Apr 2016 21:19:13 +0300 From: Yury Norov To: Catalin Marinas CC: , , , , , , , , , , , , , Andrew Pinski , , Andrew Pinski , , , , Subject: Re: [PATCH 20/25] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Message-ID: <20160425181913.GA30125@yury-N73SV> References: <1459894127-17698-1-git-send-email-ynorov@caviumnetworks.com> <1459894127-17698-21-git-send-email-ynorov@caviumnetworks.com> <20160425172656.GI9614@e104818-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20160425172656.GI9614@e104818-lin.cambridge.arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: AM3PR08CA0015.eurprd08.prod.outlook.com (10.160.207.153) To DM3PR07MB2233.namprd07.prod.outlook.com (10.164.33.143) X-MS-Office365-Filtering-Correlation-Id: 24ec8158-65fc-4d1a-3517-08d36d363295 X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2233;2:lkCKZvvzOeq0EnpoDlXRi4fG26wvgaH0Fr7hXMnTWRsmvD3jvsa7CalmGcp9+7zQzfGGImtnqd7CgpZgp1Z8IfAvBeKwgBK2ieZM2BO/693eaTOx7lyGrJM5j51K1eO8m+v23fLn9umijOMK+OiIsRdUMRy3/qZ16nlwPWauVG73TWsjYnrRQD3FWUwpAt2B;3:FbnCx+AMIZACh580H7bkFzDvc16vYmSn3ejaV8U1AjTA7R0vRsdfNWMzq9zx7LQvyeH5d+FeSRcI5pvq+f0oueZWvQNGViqTtpe20gs4oKcfpMS5DC5Ot/jprg8Eb2M1 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM3PR07MB2233; X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2233;25:2XWjVl8WJJjO1lIxUtdKJWyVHHcqGtjTBm5W8Zf15pnAKVFn60ztCF3mEWo7zep1uDNMMhxv46Dl7LMmzkBcUUra2V67J+yn3RtXut9m5+udB2O7BEeqdlC3TT/TT0/y/5QlbKIVsmiIOATBpX+FgPs3+WT6lX6PjhEtspXorQmrSVSdgj5LAoKQInhUAu/ePIaXFD3xmCt218KEklm3m19rLDzh+FPiy981STqjGvsjqZNZL0unAkFYldTQqsSrWN4DvvkpKfrnkQXSDpGakjFsEmNqyKTeRl4TXG37+jD6D2G/tgunwLUUssh1q/7d9Ec1KyUjxt0m3Ua9JNfyZ5p4rNFUMYbmx9wc7JR3onbrOmuvdB7OJyfXhv1qWW/VHQIGTJargSZxCCX490CzhZNZ1omcyWZFgwKPvip46V6W0HeRFKpganN7TO4ltcnz3j1T5Qy3zmj/BVBfQVT7hgqWe0CRks1X4hLfGLiaal8tKWlyQ2LLiHidV5JkxZZeJP/DgX7v1HBhDQF4Kmj4bCHhQv+k2hAljvLMZGcVyDElLwvAJsfRb3clpHObV0mq7xiUHJUzgyeHQ40MoFty7QHVD6x48ybCn/vNuBYHB3auKTzvXlJyd/uWE7qM6tMOy3K1RmZK5kqSV5XEhVsgE935fOi76x1QGPYkbgbEuwY= X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2233;20:jNwHo17qAeC6acWuLZq7m/y4jdu0/b5gqlp8qsDPY7DOJAWueKzKzAFLbF+DEFRGn75m/uOTMtDf09Jqlm9dR0crIHDYUesmDABoeifK/l0S9mqhGvDCOMDEKgl3WNtoCqyroisk5asjYIHAP+kLRgqBAZwF5g6LPifrt33KwWUIuUsre9pgu7TaDomB21IB5qYNGgwLWhF04+x1pPPKBHvsWnvjwrNnSIJGtuV5hcuSFuqz4x2pLyEGASb6juGUMJ491K8ZnNwzb4yBXL7nFakkaM/Vy69tHvHOfjGcpwhQYM8uI/FCW4kGwtEK26ltieJmSNEkhRaE6/SfK2k8/lJh6Eb5bqJDW+a9BzDEJKPk7il9udxFvYiVzLb79NkQ1JWHW/u7N9q70pUxt7ScC/UFEEx3D2Xau/Ww+IAiFJnW3jT5UObYDRdgJtDvHytsYZW9jeAscKR3jiJLONM0qIHIdOBhKKewzDcmRpgi6iESC7JdpyHQl+cl77OoV6TFB7sfCpz1A9HeR2ykGw2kaBavS9qPXUxUHpiKl3X/igQc6ePV7lZ9H/ta2NouUCRjlp9/nB6oNh7Dnla+1WQYYBDJ9SJgaFoksDNt4XXlbp4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521071)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:DM3PR07MB2233;BCL:0;PCL:0;RULEID:;SRVR:DM3PR07MB2233; X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2233;4:E67m/hQ81nXMIrCWGwlycDhvvJCcpIT19JLtAokwvROXoMvs0ETEaxTL0D+9DyunFFVPSHY14EayW+gE+pW3GqFv+6s9VTbt5Yypw8eIExEvgRWakxqfn48pUlBgb2brjBtILWTZRzTPPksDeN/k+eavrm/JSlZxdy33CnewnPmMXEzfNQG6+rdg8SZaoht4+T4hvjU8K031ttTZx9aItUtYGedygOTSptqud49F3OjlPWsxNJFzuZEtFsZ9Fw9j9zRPYB/xm30wxyfE+Z+Cn6jP1uBTSnAQ01KpfFBIj6Jp0fZh3gAgdKhZxonC+VUtR3QmJ2AAUhUDloiEcBxMoRnJYAj0awVekUL9pJqtGr3cllbYL2ZOvUp8fagq3iwJW9K9kuO5EzI08pueNYEH3Q== X-Forefront-PRVS: 0923977CCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(24454002)(77096005)(4326007)(33716001)(2950100001)(23726003)(3846002)(6116002)(586003)(1096002)(97756001)(1076002)(9686002)(83506001)(47776003)(2906002)(81166005)(66066001)(76176999)(54356999)(50986999)(5008740100001)(92566002)(110136002)(42186005)(46406003)(5004730100002)(76506005)(189998001)(33656002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM3PR07MB2233;H:localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2233;23:XWROPrYV/5bwfJgZbWpAlZ0sdkoNyw6C63avJziEr9otopu4gpp8kuCVyQXu9EoYk+GJar6BvcKQm2srNZvMIt9uKLqgeCVVWSifGxX6N14ix4TGZ4Lgd01Qg6yrS8z12u/Q9LkQo9Bc2JqtfGhJboQqNYSDd/ErGl4f5eH+nxP+whL+Zet0O5eMcn4bKT5oLT86UPTJOM37DsTzF708yvV1XCqx4w9+aQ837ew9GiXkmUfQ4gge7LGh/YZpfYl8fC66GEm0bJ/84LTKNNlX3i7qfss19zX5N6Mkdwvh0AeTRLkc6bQeEa2attQ5IVTdiCsA+zrsgJiC9n/Ztj0fxBb1qyAhiby+XuaKJ/DLcy2ZUlUiTSbMzwVRmCag3xP/TzY8/XtuvC6FM1jgR3R1l8Tx4TdKeC73riGtiHlqjV4xMHS2te6YGTu6IFgE0WJ91j+AYdX+5s7KLcTV4FyaJkOfzdeuFxzBH7xhVK1VjTBdhF1P/OKypR5I1bi/CLDHLri83hMeNoH6wGCmi+m7BBGnDJEOVss0/t5ByzBsgsDfp/lycxCfBib73fQt5MeHHRS6Lgneo/TbCmgDmWAt+NBSVnA8mnlkXSF8JUzrN5GVH57FosesC8yXZnuEj9U+hWWHgPrrBS68IrrwIzMuxzDp9P4Zu5a16479IAQoQvQoywqL6eajMPylRo5lI+FAnlmPu1DI4JoOSN+rty7rkYVkshO1oflIA50/3IXffrDxGS5pZOM4bGirkWncxOOin3ABajzCiWgJu+/zwB/4fuhp7YeElR/2afBNKnpLOmlwNsyqQ1vfzqTAi2lO3rumQPmVvMfc3vxCnR+zkG7w/yiksxE24dNzKfCk66zhqVY9SRdzKNLsmU7Ji70OKGyO X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2233;5:8zbt11vJzefhJV70IcyQZiGV2GZ2ehEg8A4Xgopr2qm7GBV8kye0EZXBZ7TFYgh/HJetUbK5SH63fVM7ScNBhHBh569/9VB5CO4Klq+8ZClFtcg+ZkcwEr0KPe6LXnkX34NOpBk2O/S/zjaWUpNfZA==;24:dNTlsL5VPYWodAQgyhzH9MlERb9A06mFxBSJWPHr6pUY2mTHxzvgI2Bmh6wK86l7IXgVIszg7YQ03POfz6YhdRx2+/JIS8lTg52JzBLdbK4=;7:ku1xSm3XvR77oS5F+uVg7K6zptbZr+drVNCT0hBfNRdA+tDuv2OPeJDgBYvxKc6wTHUrM4EE8pqj97nwnxS4Og0/FuRMUJNQX0hKDWLOOEx+AGeiImyBw1dEhQv5dGtShl4hiDKL2LjG8N3Y8tMvzg/Z2zZeEwj0zLD2KY5xijd53AourouWEfz8KGHE9GoH SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2016 18:19:52.8672 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR07MB2233 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1537 Lines: 44 On Mon, Apr 25, 2016 at 06:26:56PM +0100, Catalin Marinas wrote: > On Wed, Apr 06, 2016 at 01:08:42AM +0300, Yury Norov wrote: > > --- a/arch/arm64/kernel/entry.S > > +++ b/arch/arm64/kernel/entry.S > > @@ -715,9 +715,13 @@ ENDPROC(ret_from_fork) > > */ > > .align 6 > > el0_svc: > > - adrp stbl, sys_call_table // load syscall table pointer > > uxtw scno, w8 // syscall number in w8 > > mov sc_nr, #__NR_syscalls > > +#ifdef CONFIG_ARM64_ILP32 > > + ldr x16, [tsk, #TI_FLAGS] > > + tbnz x16, #TIF_32BIT_AARCH64, el0_ilp32_svc // We are using ILP32 > > +#endif > > There is another ldr x16, [tsk, #TI_FLAGS] load further down in the > el0_svc_naked block. We should rework these a bit to avoid loading the > same location twice unnecessarily. E.g. move the ldr x16 just before > el0_svc_naked and branch one line after in case of the ILP32 syscall. > Yes, I thiks we can refactor it. Thanks for a catch. > > + adrp stbl, sys_call_table // load syscall table pointer > > el0_svc_naked: // compat entry point > > stp x0, scno, [sp, #S_ORIG_X0] // save the original x0 and syscall number > > enable_dbg_and_irq > > @@ -737,6 +741,12 @@ ni_sys: > > b ret_fast_syscall > > ENDPROC(el0_svc) > > > > +#ifdef CONFIG_ARM64_ILP32 > > +el0_ilp32_svc: > > + adrp stbl, sys_call_ilp32_table // load syscall table pointer > > + b el0_svc_naked > > +#endif > > + > > /* > > * This is the really slow path. We're going to be doing context > > * switches, and waiting for our parent to respond. > > -- > Catalin