Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756531AbbLDRG6 (ORCPT ); Fri, 4 Dec 2015 12:06:58 -0500 Received: from mail-bl2on0058.outbound.protection.outlook.com ([65.55.169.58]:24832 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756093AbbLDRGy (ORCPT ); Fri, 4 Dec 2015 12:06:54 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Date: Fri, 4 Dec 2015 20:05:23 +0300 From: Yury Norov To: Catalin Marinas CC: , , , , , , , , , , , , , , , , Subject: Re: [PATCH v6 07/19] arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat) Message-ID: <20151204170523.GA2791@yury-N73SV> References: <1447795019-30176-1-git-send-email-ynorov@caviumnetworks.com> <1447795019-30176-8-git-send-email-ynorov@caviumnetworks.com> <20151203121303.GK10747@e104818-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20151203121303.GK10747@e104818-lin.cambridge.arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [95.143.213.120] X-ClientProxiedBy: DB5PR06CA0025.eurprd06.prod.outlook.com (25.162.165.35) To BLUPR07MB611.namprd07.prod.outlook.com (10.141.207.16) X-Microsoft-Exchange-Diagnostics: 1;BLUPR07MB611;2:cE0zHavnXuBjZSgYzIK5XTePVOj9stI4i0mv11hH7vetHbZo7eZXXs1Khv/N5sskN2FI6bFwi8T9ypW5gPkUNnO7J9BPBksflITo1M0AI65rqRsssV8s+Foa23ihC25nOnOb05Fjk0MIvI4+p/CEZQ==;3:N4pT1EwSYnOFAPI6M6EO/RTp0u7/0BCHVIxWFKtl97CtiGyvp4rOpoNIb203Y5ttay2jlQmH1ZM31ksLejGfocU3MGhfY7PEb6R5FAx+8XkrUt+bOTeaZHbZMZ0Hc9y0;25:ZlwIGN+PKmMAmQNIny4ujpkPna2ZmxcIHWoDsB16w9hvbl5oTHv1QCuFlohEbtkl5AnSbRjqZ6uHO5rb+YlXWbL0j2rhU+sJgUla0e5HpT1VJd7yvuR75Gtv64sAY3tyCmGh6lGqSHjvVrUtF+Yy9rcCCD3pCnW62ayXDZsrT5y9RXlxWWrnOy0G6VW1vCuFiwi5uAd/bRnsiRDrw6116KL7uafiRY8lGw7X5W9wF3ztw5wRNvn5xtjCFbmC9REvjrxxdRYl7SLIuOUWlPb1cw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR07MB611; X-Microsoft-Exchange-Diagnostics: 1;BLUPR07MB611;20:IUx+D734aCq4QGsBP4U39UhLVGaBCOIYc2FWvZtDt1LW57gIJSCIy5hBzmNWBGkPs6B4uS6BzzgGkWVSULEbbUiCZpRacFAwrusFd9xi52jhY7hH+6mUGMfW3PScu6/LtWHu3kxmadzQmWO38ROxl7rfKWpkPeWlGkGpWkjm803a/TcxSUH4WPznvkhVEtH0P6yeDA19oNRqTXyzAWhD96goEsDIaXRcm538Ic7Zycu/WkKn4B/WdN6MEEJ9VLLjYziCtdorRKCxzHlfj78LT5Qk6GZRByaDCydZo98FwlZbgp2EFoI2d/u1qzxFcju8VJl9TlrX1WH1Z8z2a9k367em61v1O6l7gsD1HrN681RSyqvJFq7FW50/Ysn8q9Lpx4j0HNwKGZFT3sH76lzy/4hGH5RMpJ4N5ublypJDmEh4fJB8jWf8s0FjVxX3uHZxmowTq9g3vPsBcHrtwBwx1V30EGco8qjCc2eA2BeOatvElfkCY7cd+CLsjvmRF5oykKWkj8L3+14xioh4TpNmeGYxFTkTrSf4C+dU/bVRs54ZCgnRbfx3QPphBXorFbbdqRvE884/yTjUfT1lCnnkAizs+e/wP9Frz32w6l5a6Lk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046);SRVR:BLUPR07MB611;BCL:0;PCL:0;RULEID:;SRVR:BLUPR07MB611; X-Microsoft-Exchange-Diagnostics: 1;BLUPR07MB611;4:s9HAI4V87V9R2SRdNO4Ob4CBpsCoFXKIUfzFi45/vSBulALkIo4bxzfnYT7d132R9iWfuSHRr/9TndCLuPm4Z3sTUKA/o/JV1ABuh53kECNf0PAlSY5/cFp23zYh6/YsMEGVVc10sthMIGydHIzT/kDqCNjfCmTkfNsFtQ8eJ2JrNzBqMRk9KTKxFwQC06JelmY9+InmAeqWCg04I5qczG3AdYA3zDzLyPWEulTS4LV23tNfEoFu1GZxUQIf+e8Fmc2Y2E7Sr/iEh/YBvg1BxeoqWTC8hTJ0Ni9cj5lsUpqvwBLGeHHotQPpehsSI0c3eYBOlbOe4kykhI0SVjZPJfWNIUql2FchPb8AmwMk27Ljh5yBWsDnW4GyEl8VVWIW X-Forefront-PRVS: 07807C55DC X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(6009001)(24454002)(199003)(189002)(40100003)(66066001)(189998001)(5008740100001)(54356999)(83506001)(586003)(47776003)(106356001)(105586002)(4001350100001)(122386002)(1076002)(23726003)(6116002)(3846002)(1096002)(42186005)(76506005)(33716001)(81156007)(50986999)(101416001)(76176999)(77096005)(97736004)(46406003)(5001960100002)(110136002)(5004730100002)(92566002)(2950100001)(33656002)(50466002)(97756001)(87976001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR07MB611;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR07MB611;23:FiXiuJqbT6C6SiI/AqhfJnvw3PRlaaY982iVHGKad7?= =?us-ascii?Q?aa8B60ih/ir+XSnmtqkpd8fomHPGC+EfBXEcINdXr2zewnZCBPxn712Xjc6o?= =?us-ascii?Q?eeGuCS/v5HDn+rq9zxUqWTIsXRBNzWMR6I2C3HaKMqKLNLUX5BZB35tdJgpI?= =?us-ascii?Q?zv5eTaZ+krNmfvEmQRIwa343BeOVIl0J5QfQbvqHXiQUdZSImeJB6869LDwy?= =?us-ascii?Q?4lqZYtfbJ4S3BVRHl45xfTMbv3AAjakTo+dtyZ7IcTDshezbXLN+5N5izg9S?= =?us-ascii?Q?lT4ZheymvAAwEaj69qCwdyu+MSHByDJ65HINSGZeW6I/FbNMdEAJsIu9A7HE?= =?us-ascii?Q?+7t3RAibF5avdWKVH2rT/swxdyZP5I6DpuTKnex/7ZdbWz4mw1kJJFPDgdxQ?= =?us-ascii?Q?W3QG0K9ggm+Mx+ef212bsjR3AhCizM6PDV8RpHx/IIs+A8pg4SUKglKgLZvQ?= =?us-ascii?Q?/a0B5QciBHhQzX/XHX3mk2rxpThXJvC4Tf0DDNo74hK538wufVAhTUKbgP8d?= =?us-ascii?Q?v8f+21SzIrj9vdecGdn6AxIyxW5ixcBCrKUOqhZ6rSzgsg7HRcUk7vMi4wHL?= =?us-ascii?Q?S8qrmH1NOTZUpgomKKrAfRoY28IGSLs/aizO9Rge3ftjlGK10cxH1UC+j61x?= =?us-ascii?Q?eVafwjmDMHmcDylNKqn6DYU62OOyVS0tgtZnz8WEXErxZhzBCjrTLiyTInZM?= =?us-ascii?Q?pNh2q6BHyCLvK9EGns9qQlkBt2uc9zpzUMsCstElr5zBjVRASqc0BN64ZW1t?= =?us-ascii?Q?SdyEXSEMELNYhW21WNvJaGbQluL3CTqz3S2ZcK90l7IdxspYohsK9TOYkP98?= =?us-ascii?Q?vI6pShcZZSDxeEpxEPTXtyufUwe5cFdFWM/l6TFpIoZpMutb7z8GnBSSulnO?= =?us-ascii?Q?yyQ0F2qU0u6yTYDQY1ZN3r//AYhagPxDukALDpvbEO8ehDY0BVNv98bInFa2?= =?us-ascii?Q?fQXa828xmjVRh00JLG5StsrscOScen9KNImz3jFJwQSBMvSZBzfzNiA3LGTr?= =?us-ascii?Q?VGyq2KLjyLzbqNGxyyfN0IoNCZA+Rbdj7ZIUMOBPPYLRmmW9z2sK9QELCz6K?= =?us-ascii?Q?1F2dH5i27XT2a/sAvOMe6jOZqo?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR07MB611;5:CExk/7KMkyl7wj9WvrdDgReeOKELeken7jW2aSE9M4+Y9n8YGhqLKwsFqot8iDSD85VxBAnceWNLd/o0QfEw+aEnPRXwawOAW8VLh2fjHURACvMBLBaQZNnO07cAecbCIEly9mlCLNqoChOcTTF+Vg==;24:kX2UFPtfo45qWgMdQbyrAImE/J5iSFAKvqx/f+cdqDyDumsV7k532FLoC98eAwmzgKoT1aYU/8OszWmMZu8Cdye5ZqgAYKMnAyXTual4a04= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2015 17:06:51.3891 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR07MB611 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2311 Lines: 72 On Thu, Dec 03, 2015 at 12:13:03PM +0000, Catalin Marinas wrote: > On Wed, Nov 18, 2015 at 12:16:47AM +0300, Yury Norov wrote: > > diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h > > index 7fbed69..9700e5e 100644 > > --- a/arch/arm64/include/asm/compat.h > > +++ b/arch/arm64/include/asm/compat.h > > @@ -299,19 +299,44 @@ struct compat_shmid64_ds { > > compat_ulong_t __unused5; > > }; > > > > -static inline int is_compat_task(void) > > +#ifdef CONFIG_AARCH32_EL0 > > + > > +static inline int is_a32_compat_task(void) > > { > > return test_thread_flag(TIF_32BIT); > > } > > > > -static inline int is_compat_thread(struct thread_info *thread) > > +static inline int is_a32_compat_thread(struct thread_info *thread) > > { > > return test_ti_thread_flag(thread, TIF_32BIT); > > } > > > > +#else > > + > > +static inline int is_a32_compat_task(void) > > +{ > > + return 0; > > +} > > + > > +static inline int is_a32_compat_thread(struct thread_info *thread) > > +{ > > + return 0; > > +} > > +#endif > > + > > +static inline int is_compat_task(void) > > +{ > > + return is_a32_compat_task(); > > +} > > + > > #else /* !CONFIG_COMPAT */ > > > > -static inline int is_compat_thread(struct thread_info *thread) > > +static inline int is_a32_compat_thread(struct thread_info *thread) > > +{ > > + return 0; > > +} > > + > > +static inline int is_a32_compat_task(void) > > { > > return 0; > > } > > My main worry with this patch is a potential #include mess. I can see > that you already had to include asm/compat.h explicitly in > hw_breakpoint.c even though linux/compat.h was already included. In > subsequent files (asm/elf.h, asm/memory.h) you check is_compat_task() > without explicitly including asm/compat.h and hope that it won't break. > > A solution would be to add these functions in a separate header file > that gets included where needed (also by asm/compat.h). Thank you for pointing that. I don't see big advantage in moving that to new file, only if you insist. What about just fixing that mess? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/