Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753335AbdFSBLU (ORCPT ); Sun, 18 Jun 2017 21:11:20 -0400 Received: from mail-by2nam03on0052.outbound.protection.outlook.com ([104.47.42.52]:44526 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753020AbdFSBLR (ORCPT ); Sun, 18 Jun 2017 21:11:17 -0400 Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=caviumnetworks.com; Date: Mon, 19 Jun 2017 04:11:05 +0300 From: Yury Norov To: Florian Fainelli Cc: "open list:GENERIC INCLUDE/ASM HEADER FILES" , Keerthy J , Arnd Bergmann , Dave Gerlach , Tony Lindgren , Catalin Marinas , Will Deacon , Russell King , open list , bcm-kernel-feedback-list@broadcom.com, Greg Kroah-Hartman , Alexandre Belloni , linux-omap@vger.kernel.org, Shawn Guo , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 2/4] asm-generic: Provide a fncpy() implementation Message-ID: <20170619011105.gjkisjrrtzlmgk6s@yury-thinkpad> References: <20170617000744.22158-1-f.fainelli@gmail.com> <20170617000744.22158-3-f.fainelli@gmail.com> <20170618235108.peaxdi367jpkt542@yury-thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170618235108.peaxdi367jpkt542@yury-thinkpad> User-Agent: NeoMutt/20170113 (1.7.2) X-Originating-IP: [85.253.137.34] X-ClientProxiedBy: AM5PR0402CA0014.eurprd04.prod.outlook.com (10.175.37.24) To CY1PR0701MB1866.namprd07.prod.outlook.com (10.163.42.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8a64b7e7-6ea4-4b54-3f3a-08d4b6b014c5 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:CY1PR0701MB1866; X-Microsoft-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m1AaIIOzZ3WLoJdH7ThCGmLV98Ytu1Laes05FjpPbm9H9XCu7e34qJirREyV4rVuBEyf2tnjlXT8qo3qUXavi5L7VGjMG1zTR5IH9OceZoU7S6OU8KJ0ba5k3W;20:1SDRXT3fvean1RVKPsf24w5K5zJccL/fEMrBAihUFC3kh+B5FUqqpuopNyomeRmD6l4pSkEPjky7jC8oZtritDsWIKuSlMyqaWmDiqnPUbZ/HQvP1JyTmhw4Phlc0buTMMHG6g/BgKfaVvGYM4oStWl/+caC5taGphUl5aSb6m6vcPCUqVLO1KQtrPhkWiIyuT4z78w7IiuPLQL1uLMHZq8yEyRFAArROsnDhQKSaUFWw7UjrEee4CiiOwM9o8+Q6ViatszWF65LRZBf4Dd8yxgvcQvZcTMTRS2TqGGhrBT3HJfe1ns8bBOrOKRTOmcUhp1pqdYUrxEfXRd/Cgco1ZSHl6EWvZaPP3n0s5379M+g9F2vIuKdQE8eR0y0cNuf4NibGRwL7yHMQDzpj2E9xNSAYtLaiO9WpaCI/up9vn4koMLqMiWN+X4LtvhhsYfwoBBX3G8ZzvhZjZhatWginnZak7yQYNKN0EWgYMrzpHxFpeXk6i57firTkhGWqVnSTipS34cNcxkSr4KVC+D/Y9btIzKWEnDrShaZCR9whQE30JwJS3zx/v8/Xmy+xAHYgdGiUGJzPuq1TWoItykaocKQ/zWcLel/7tmk1+PPSnc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(6041248)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR0701MB1866;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR0701MB1866; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0701MB1866;4:1E9uIFjsXtcJmb4o3iN2MuQ2aWKpcFHB4XVbq6LO?= =?us-ascii?Q?x5FLxVKY3wn/2mblVT1Gdqixc1hcZe3flBDoDDbOuuVR8A0ziUr9ZyNsebLe?= =?us-ascii?Q?iExlMRn05HTNyInqAKQx8pZ7omfNhnA06AUCPy1127cQbqGUaZNDUR08a0jk?= =?us-ascii?Q?3aq/GJ4hn8A5v7kglLVOm3WuyMHQ8ri61ulHvSugxfQ3a+ezRA1cdZnqjgDa?= =?us-ascii?Q?udw4yNQkWLWd8xfr6ZJqj66bn0rept84XS6GUqafPkyUke9VSL+1zQAjFxVH?= =?us-ascii?Q?yXiNGHmMXYD/AD018qaBbV6oorsCYu+pq7RTtr1SBzthc/yk3L+loNP3Rok/?= =?us-ascii?Q?tD1QeMXtA1sIPlxpqtlUbEMtZhryrFWxu3mUeVvBSpCMYJfQwbcGSJZmGRCj?= =?us-ascii?Q?U6q678sO5mFIEbwJ4oUnpr1ptQIO3SQwYL7CHq7UXOr4AhUEvqAINFuXwAYe?= =?us-ascii?Q?txzsxfLIq53MJPiBFOOg2eH7/F9ygaaAhR3q9OZgtWu2uVoepxsde3Xbl5dp?= =?us-ascii?Q?SUNtml3Genb2GIOV6ODNK34ZzUgZ5UG+fDXCz9zwpVvqS3z6k3k7qggjCpbt?= =?us-ascii?Q?rrDqH0ks3W3jzA5fQOrC3d8xeqKEYZnx0KtWfccIkZFWTfY+Gkb/clYsw9J0?= =?us-ascii?Q?03OoVqonqXmb/t+TYOSCmZcvVfzLB6x00y53pZpQIiRdJpCot/bS1yciAMBu?= =?us-ascii?Q?Wsbx8LAy4ek/qLSYdWpCiahhgiKG/jNAYVj/WYSsmLbs0uaTraFYgi8fdpHW?= =?us-ascii?Q?yzLPfwlpUQAi71Qp4SbysI8qABGHBX1isVar44ktVo0E/nWbPqGQGlCdUvNy?= =?us-ascii?Q?NA5Mxc4Qq7m2fKQiGzNms4OdYzjMDMRlbVnB2jKhXA0vregRo2VYU9hba23V?= =?us-ascii?Q?PrdTNrOeEiGP1TYxGxe8/ROnCkrYGQx53Kn8d6GKQYR5Ak56ETNCRM+ER9E3?= =?us-ascii?Q?EzPPypRSTS59zoh//cz5tI65OV/M39sxzLDawCguJI92SOaewSWTIsWOKX50?= =?us-ascii?Q?JcJl6t8UEhdA1NN5/3a1sskuAzsUcjmkJcMmabDLecdOWprsnyIxjfXJWy9M?= =?us-ascii?Q?vkjjR44Z0HS1hncW/MRovXqY8DU/uZXnLyvFxtqIrnDrRNlhoVke3HpNpNrE?= =?us-ascii?Q?TbVkw3ge79c=3D?= X-Forefront-PRVS: 0343AC1D30 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6069001)(39410400002)(39840400002)(39400400002)(39450400003)(76506005)(42186005)(50466002)(33646002)(305945005)(7416002)(4326008)(5660300001)(6116002)(2906002)(72206003)(478600001)(3846002)(23726003)(1076002)(81166006)(8676002)(25786009)(7736002)(53936002)(9686003)(229853002)(6916009)(2950100002)(42882006)(6666003)(33716001)(50986999)(4001350100001)(189998001)(38730400002)(110136004)(47776003)(66066001)(76176999)(6486002)(54356999)(6496005)(83506001)(21314002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1866;H:localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0701MB1866;23:IOyr4GRR6pH7sprfYSn1HHdAYYmo4MCzhcU4aZk?= =?us-ascii?Q?TF225WlEJenUbRY4IU5xbPW6HA0oZ0rn/EAgTuVvmzcArxxMru+MqS7Nx5pa?= =?us-ascii?Q?fuhaZzTA/hA9LJ3WtZpfKYDcsg5Z5ERnyxqEHi23sMIEcyh5YNWzLBVKDdfU?= =?us-ascii?Q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: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1866;7:wGPKb/ytW1JhPlk3teVabHwzuLX92Hl7KDW36/hJhThkY3mhbcvQBxPqogvm/+DzA00pvKPeVYSyN8cPEWJXRrTrK0YoLsSc91jzBDEjtHqJ5OuKUiTBCC3ww0kOq4fdZ+7IFW8L1nJR6VJW/gLO3RsDWEWZVDAhLNMDsjMWM5uMvywXCJnMIh0QICKQJOHQlJS+9NNecz8Fz/UDliFbJIA/2rT/YhIv0wGEDqwGi1KYo6ffMmn4XtyUIcgrcFO4o/ShAnwrPK9+8x5io2eqqbktHdw+5q1PU1R6OqDjlJdtVJIh+GXfJ7Gw47L6WyewXblnbGcjGL6yDoE0TQ2P7tgdF7LYPp8Jkb3lmSZwv3YHnLgCrMlZ0qulNE9Xzhsk4n3f+n8y5HxXlNrM5+1ulUe/b1sskNel9n2n6BCvjX3pCmWYYskREhxd+QhYjwSrOZ4Z0ucHPXTi9YluriPsASDNlBv1ZWmBWg7TiHX5q1DxjBcyvqvFfn9UKhrTP6pKQ2BrhUTbaYSSvDIuidJZJ0wc+bxsjHZSskRbhKGzW0EyfSbz5PVt5Hfs0PRS+PkGvqMPrOaApEcJfXp6v390VOC+g4RxiVfm3MRXi43aGIt75pskwoOWXDCuCkcqArvrQsvgCBTIBjVv/xXj45OUwDLrbqKuE7x8qQ4r+Fh0yQmmXkUFZxZETNToZBzdiwDZqTC4y97JnfsrweY1j7+Y8CwuQPaSGou0E0BKiMVng5c5N/tsS6Iq86cISMW2+bKPCaJZhcVP8r73a6iPCaN1J/VYzBbLiIqJ2U8N8g9b5W8= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2017 01:11:13.9638 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1866 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1006 Lines: 29 > > +/* > > + * Minimum alignment requirement for the source and destination addresses > > + * for function copying. > > + */ > > +#define FNCPY_ALIGN 8 > > >From now this is not arm-only, and it's possible that some architectures > might want to redefine it in their arch/xxx/include/asm/fncpy.h files. > So it will be easier for them if you'll wrap FNCPY_ALIGN here with #ifdef > guards. > > By the way, compiler already has an information on the proper alignment. > Maybe it's better to use it as the default value here instead of the > hardcoded value? > > #ifndef FNCPY_ALIGN > #define FNCPY_ALIGN ({void foo(); __alignof__(&foo);}) > #endif Ah sorry, at first it should be like this: #define FNCPY_ALIGN ({void foo(); __alignof__(foo);}) And at second, the correct version returns 1 always. Even if I pass falign-functions=4096 to gcc, and I see that functions are aligned accordingly in elf file, the macro returns 1 anyway. So if it doesn't work, the hardcoded '8' is the only option. Yury