Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753214AbcD1TTw (ORCPT ); Thu, 28 Apr 2016 15:19:52 -0400 Received: from mail-bn1bon0054.outbound.protection.outlook.com ([157.56.111.54]:32979 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751865AbcD1TTt (ORCPT ); Thu, 28 Apr 2016 15:19:49 -0400 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=caviumnetworks.com; Date: Thu, 28 Apr 2016 22:19:14 +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: <20160428191914.GA28527@yury-N73SV> References: <1459894127-17698-1-git-send-email-ynorov@caviumnetworks.com> <1459894127-17698-21-git-send-email-ynorov@caviumnetworks.com> <20160426165701.GE8525@e104818-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20160426165701.GE8525@e104818-lin.cambridge.arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: DB5PR06CA0033.eurprd06.prod.outlook.com (10.162.165.43) To CY1PR07MB2230.namprd07.prod.outlook.com (10.164.112.144) X-MS-Office365-Filtering-Correlation-Id: d11af788-3d76-4d7d-09fc-08d36f9a0f22 X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2230;2:i2l68m1J2yta+uR5elnN0yw+eQSFRO8L5YwK62yF00QBx7D/oOfOWM0A6rKA4EwHAaIBms0p3C2/fa/XaVqAOy2O/sWh0e6Y9GY5NH/x3L3rkRhvEtJIzy3f4TG5ZGFRlpchWvd16BvJWNe8W6rZPTxmDplcnQ176rWlDE4i1o1qRS6d9ygPqFfarc4XdRGA;3:l7aO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JhhQWIuzjY7/yzin3ghnCbEH+HCId/jyDdmamJiokfBNGkqLK1v953kGh+GMRk7D5hvKtUESKDlrvKDfVTexfDH96KgLGV+Tw8KhZUSR9I= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521072)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:CY1PR07MB2230;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2230; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2230;4:aoFdOyCWJkC6X6JxOlqBgVQBDFYX91JvVs45hXrosYI7olMPPKYxXeMGU+9y3P3aD+tU236hohIvw26jZtAjUBKa//dGs4yepenVZeDcPApwmHS5djYd39o5UcpdYG5EtqUcGHu+w95cnvHq+ZUaSNijcu9dLIWNUuG39SzkMZePiRRE8EAjWg3g2+3MbpIyLViuKR5hOqtjHFblyZKDsUrTh+9kff7v/e3J2fPyz69dw8UZEgghN6tQ4OaDQyvM3LGL4c+av0pWLnElWR5haq4wSOTDXQJLYe9Tg4pjjcCpFID1W5/q4ylpcuFShdwmOcJlgbsmibTx9/MpGQcAOoUNTIUr4v2bfIQHYmX1A86V90tWsy+Ja4eXVwkPHXjMrq8LbgztwL4l9/N8zNMsEg== X-Forefront-PRVS: 0926B0E013 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(24454002)(33656002)(1096002)(110136002)(83506001)(46406003)(66066001)(81166005)(76506005)(5008740100001)(3846002)(50986999)(23726003)(33716001)(2950100001)(92566002)(5004730100002)(1076002)(77096005)(4001350100001)(42186005)(76176999)(47776003)(6116002)(586003)(50466002)(19580395003)(54356999)(4326007)(9686002)(97756001)(189998001)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2230;H:localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;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SB1Nicc8mJ3LK?= =?us-ascii?Q?86Kedw6MSKbWk2QsDcL6Ca7CeY5jr3Vry0LUzKML/eXr/z98TkQsbu1inyo0?= =?us-ascii?Q?J3gYgLa79H7Nj3AzPX+CfdULxBQIQfKn4v/9UYPmQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2230;5:L05rpBlQ8xSgaGXqZCHHZhD/g6mY54Mn5bZo1J3Y7lFUbvfy32XNDqQRqTNbrFhVAa7LDndZ6Z+OQy9uJ9ihSLIyBMgZGkeRV/wHcO4LC8Y8CcW1+Gl8c+1jeBESsUzyYjlH6mZkVsSFu+Ed71tFyPgJaF9/DLkqo1j7U9V5qzVnHkvZ56dpCPQyD97XLcC/;24:7eXXMoNNlb30JOhxvM+RSw7BIcDVtjma8t7nadR4kuOS/aFcxoomE9wpgy26qLWy/BPYDmGgifdBb+Qzhq4/uT08Czv+nZV521EpnHJUlyY=;7:kca+8NKhosmhePRygrSPmpE2dmx9/0eUxvS8v21E+l9hO60kSu4fCNxL4xLOeU2KQ3OTC5xutK3HIF7k0VPGnAx6ZEGSfOcijK1sVJFlFWCMDMWMjkH4nBttZ8+r9yZgieozjt8hHKubLjBWZWwf2V8OK9xgQsLyeT506TRZkp/vXGcNuHrfgD9lRDe2F0btD0y4lSLn2i9o4O0mcO3nBDle7DSxCfRwGymcHQqCP0s= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2016 19:19:45.5157 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2230 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2673 Lines: 75 On Tue, Apr 26, 2016 at 05:57:01PM +0100, Catalin Marinas wrote: > On Wed, Apr 06, 2016 at 01:08:42AM +0300, Yury Norov wrote: > > +/* Using non-compat syscalls where necessary */ > > +#define compat_sys_fadvise64_64 sys_fadvise64_64 > > +#define compat_sys_fallocate sys_fallocate > > +#define compat_sys_ftruncate64 sys_ftruncate > > +#define compat_sys_lookup_dcookie sys_lookup_dcookie > > +#define compat_sys_pread64 sys_pread64 > > +#define compat_sys_pwrite64 sys_pwrite64 > > +#define compat_sys_readahead sys_readahead > > +#define compat_sys_shmat sys_shmat > > Why don't we use compat_sys_shmat? Is it because of COMPAT_SHMLBA? Yes. COMPAT_SHMLBA is 4 pages, and it's aarch32-only limitation. > > > +#define compat_sys_sync_file_range sys_sync_file_range > > +#define compat_sys_truncate64 sys_truncate > > +#define sys_llseek sys_lseek > > +#define sys_mmap2 sys_mmap > > Nitpick: there are some whitespace inconsistencies above (just convert > all spaces to tabs). > > I think you should also update Documentation/arm64/ilp32.txt to include > the list above. OK > > > + > > +#include > > + > > +#undef __SYSCALL > > +#undef __SC_COMP > > +#undef __SC_WRAP > > +#undef __SC_3264 > > +#undef __SC_COMP_3264 > > Minor detail: do we actually need to undef all these? Maybe we can get > away with just defining __SYSCALL_COMPAT at the top of the file. > Yes, we need. Otherwise we have circular dependency like this: arch/arm64/kernel/sys_ilp32.c:60:0: warning: "__SC_WRAP" redefined #define __SC_WRAP(nr, sym) [nr] = compat_##sym, ^ In file included from include/asm-generic/unistd.h:1:0, from ./arch/arm64/include/uapi/asm/unistd.h:16, from ./arch/arm64/include/asm/unistd.h:62, from ./include/uapi/linux/unistd.h:7, from include/linux/syscalls.h:23, from arch/arm64/kernel/sys_ilp32.c:30: include/uapi/asm-generic/unistd.h:33:0: note: this is the location of the previous definition #define __SC_WRAP __SYSCALL Defining __SYSCALL_COMPAT at the top of the file does not help much. > > + > > +#define __SYSCALL_COMPAT > > +#define __SYSCALL(nr, sym) [nr] = sym, > > +#define __SC_WRAP(nr, sym) [nr] = compat_##sym, > > + > > +/* > > + * The sys_call_ilp32_table array must be 4K aligned to be accessible from > > + * kernel/entry.S. > > + */ > > +void *sys_call_ilp32_table[__NR_syscalls] __aligned(4096) = { > > + [0 ... __NR_syscalls - 1] = sys_ni_syscall, > > +#include > > +}; > > -- > Catalin