Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752017AbdFTO2H (ORCPT ); Tue, 20 Jun 2017 10:28:07 -0400 Received: from mail-sn1nam01on0055.outbound.protection.outlook.com ([104.47.32.55]:59648 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751090AbdFTO2D (ORCPT ); Tue, 20 Jun 2017 10:28:03 -0400 Authentication-Results: armlinux.org.uk; dkim=none (message not signed) header.d=none;armlinux.org.uk; dmarc=none action=none header.from=caviumnetworks.com; Date: Tue, 20 Jun 2017 17:27:02 +0300 From: Yury Norov To: Russell King - ARM Linux Cc: Florian Fainelli , "open list:GENERIC INCLUDE/ASM HEADER FILES" , Keerthy J , Arnd Bergmann , Dave Gerlach , Tony Lindgren , Catalin Marinas , Will Deacon , 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: <20170620142702.mmks36ydoujvvhan@yury-thinkpad> References: <20170617000744.22158-1-f.fainelli@gmail.com> <20170617000744.22158-3-f.fainelli@gmail.com> <20170618235108.peaxdi367jpkt542@yury-thinkpad> <20170619151818.pvjygbdvm6arvarq@yury-thinkpad> <20170619174348.GA23750@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170619174348.GA23750@n2100.armlinux.org.uk> User-Agent: NeoMutt/20170113 (1.7.2) X-Originating-IP: [193.185.223.3] X-ClientProxiedBy: VI1P190CA0025.EURP190.PROD.OUTLOOK.COM (10.165.188.166) To CY1PR0701MB1866.namprd07.prod.outlook.com (10.163.42.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 161cc9e1-8b77-4703-212d-08d4b7e883ff X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:CY1PR0701MB1866; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1866;3:5EXiUl+tc3QGoOWJugsCpQ2uqCfkevQnOzSl7apoGtq/7hwzWQ9bqYnkJWd0Ah83la7v4M2B2TDh9FQ8tBuujBKw7TgyF5gaYAjJ3XWJOR/8/FXeLNTUXdX87DpLIj2s7FRoRguFbjmVtHssIW1Gi/xDzUKwW2QFF7rIC0GXHpRb23lCchbEpvCGC1lVVH0D/kM12m2eK1d+i4t4FI2AdE/17H3HkpsGiNdJ3+Qgt+3rGl5P59s/lX7nU88aYhncsRW+wqc82JFe1GxOUE1sIhY05riIfCHVeqTyBSO/pjXPoIADGlhXgXVgu1YCCEz5/Phy69ol1sX8b0F7ALsfPQ==;25:EueT9zNVvIvNcCJ8MIVRme65YDsmrLsZMeb+ScRJpLCnz1+1MV8i5qUqzFL4BGO/pNrisYvOr5+W7mpzAX6YSQXMOjFoq45s+yDeMDeXa02C3XVHsMqy149y8xfhUPpHP9KFfG09obdFxPENWvsXMRJ6K6jtGtcb2P4BHvweeJPXSKLYxxt0zxNVe0kTo2Cq8vpWF88h1yFwBFrUSKZmQRt+8SsSxH66YBHzH3zC+zss6CVArfYW6o5UayQ2LsCE9oZ8jBW6cuBOiaJSDFOSuGJf2meMupfes3nN4yh85owevUb8ODmzWFwywatmVjEIxidvkL2CECT0tbdTngXDa4Zngz6k22ed97zzcBs5vtpKywG4puLU4ePZ7V/q1eNdStBlc2k60sijSdOH0lGw/vziu9La61vy2IfxTSTUDpAq3m9d3qHC+V3mhRyFoVtnKgN8s37t+KnfOLqnKPgyVE8GaOU9o+KiIZ7canjpu3c= X-MS-TrafficTypeDiagnostic: CY1PR0701MB1866: X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1866;31:7lepH2mwhYlR6ndj5m6wE6+yaMU9qryZkNgkc7fCIsPk4ZEZcCvfCC5uL+kbPAtK5sIaS3vsJFfrbKJAhi3kTtsLQIWZhKfeWTMqfA3Sl0kQOnTpias6ow/wLXg4ty6LNNr1mki9DNGxWjrcGOxROOBrhYC8PZ1cxRF+x/MAoiqPWreAtBrIIu7Fn3wsbVWy/uGT5fGQd6OoEuhIAUhBsHlfHEzcgT8obJ/n32RKG1m6I7OCBFluEz8+Z/KwBOLYpBPovujDfxIEJM15Dv5TeA==;20:PK0jR9pEJK7c2u4z0imSejwLQx99K3GrBSJk3xjRJmZdX/MY7WeKT/oSCYZUhB/f70X+/ZrvwDbb7AgzjbwPzDeQ4/KibDJ29Stq14JBk48LuZ5C7BumHdyD3TxX0OirT/Rm+FCphJXyPaNXk2fIootAMEXU8r8dYgqV9dJUO0zQdNkYC7SfYD5tQKStlMZMo0Lz+/mlOAxTThnBvdeowbAoN/bKRFDFhW1H3eSJ3NHQjifKQdGiNog34CtroyX7f/oWyZC4b3S90e21Ihm6C5+MOHzalLa6KT9P+tErb8xKPIFN2E1lfmeBY0VNHyy5dfc/zBZTjOd4uA7jQBsMwyvek2bcYA1QfY3jkcuMhMzxVyBj70Hpb8wIqcVA9/kHdqQ47wHuiUD6iVWoPkXGpTBjPT68Q8XRtkYez0kiYTo24rHHZLS9/nYMjp50urbv0tzWmp/wF51Je8h9ztF6fzBaN3bJl1VIdyDuw8GtaqWNTW6NlmzKBDvzDcp22l+UaN4XEHygpf+K/bhhiGRq52WE8zK6LHaj3SZOfdkDRRrjKj4VR37G9vN4wVtpJBI10lU4rJYRRoiZx+YtKJOAcaFz5Sm4X4grgVbIl/AJRi0= 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)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(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:2TFcQoULaHNemh/QqPnaTTLOtC7ypEkv0yjSgLiY?= =?us-ascii?Q?xn7EX+MBOiLVEGCUoNyEkRt53+CY+4YmFV+RoDDQ7cuRVRWfWc4fw3u3qF6N?= =?us-ascii?Q?Z3fsayrCAdlFXbyIqM0xPToleRNH3YfMrLfmul67c7hTOqm/KHDhwyeY619e?= =?us-ascii?Q?ZQyRB8zTu9jUt8ZyYQH5hL6oLUxhdy9GlSMFEKbnHNiz0zS1ncmEj5qfEJ7m?= =?us-ascii?Q?FRLosPlf9Olpo1spkkSMMhGk5kjHAjuJgovLBjMxD5/YvTJjkirN9opyhojD?= =?us-ascii?Q?cLtnH24+vLfL81TPzTiEo6WiYbboQJtR0FQaXLrhQfGcl6y2gsV0MC7vqZVA?= =?us-ascii?Q?KfLMqkEgsVL6tLnruPWxdU3vxlUhOVJ6B78qtuto4AsLrm5WPWPp8wE9qpKg?= =?us-ascii?Q?pTbrOKzxLn03zEkY5h3uv3osJekkejLpfzoYZ4Abx/VzaBPhFUcEgTVopvOg?= =?us-ascii?Q?20YUBymJSSKSCfsw+rWNSxBcZnA4SzjRyr/1Rti4JT+y4jDLHEwVhX37bWTF?= =?us-ascii?Q?aR+l3HtXdpItGDr/+0sE4mtdLfr45SVQYO4uSOYh3fmpHSXPMmdLcaghEVq7?= =?us-ascii?Q?ZlflCErAkXRvnJCLVD91uBcw6/3+p/hz75V01luWMyvWCNMH3SrXCLRkuRQR?= =?us-ascii?Q?MoUUsPxA3CQjEU48J23Qw4xViRJuTmyRLAGYJJcagMPRny9VOpt9ZqCztmw+?= =?us-ascii?Q?zzGyfDL8iqUrQnPmG0tkCGC36XCXuZhHJ38SwzAL8ayPX+POigL65d1UzUJ7?= =?us-ascii?Q?w2Um0o3mUW3LfwNL6tXA/U4hqx4veycvp/oDkWczCsN41/a9ytZl8T4Kvoi/?= =?us-ascii?Q?oYGnkGDPrz5b2gZ5Il0KkLqir6UTd35jzuNXtbA18zmuJow3vBbWSX/k+NkK?= =?us-ascii?Q?yYdQbZ9Bn1QoKDVOj5gj0bjneaETY46KG+JwwefEjHMio1GLEnfcHaF2YzDn?= =?us-ascii?Q?hRA7OUco/QoELzssp0T5oTH5eJcYS0DiW7VI44hGdlEoe+aJ30F7sv2aAeHW?= =?us-ascii?Q?FSK4uchj+3/72y8InGPA1xM3lnGPf0LnWVfgh586SbPi17n6ErZ51zIDg7Lg?= =?us-ascii?Q?xr7LRBC4CLTZGtcgD/vOgRPU+jv/duzIwkxTTkimDJSa38b27UbIzkiZiw8g?= =?us-ascii?Q?W2mkN7j/Dzc=3D?= X-Forefront-PRVS: 03449D5DD1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6069001)(39850400002)(39450400003)(39400400002)(39410400002)(39840400002)(24454002)(2906002)(5660300001)(478600001)(4001350100001)(33716001)(83506001)(189998001)(33646002)(72206003)(50466002)(6116002)(3846002)(66066001)(305945005)(2950100002)(76506005)(8676002)(7416002)(4326008)(81166006)(6486002)(25786009)(42186005)(110136004)(1076002)(229853002)(6666003)(6916009)(42882006)(23726003)(93886004)(38730400002)(9686003)(76176999)(6246003)(6496005)(47776003)(54906002)(54356999)(53936002)(50986999)(41533002);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:e7HvqSXp2T3vPcUEGhmRhdfdqKtUM9/bwRjj+cx?= =?us-ascii?Q?qpW4ALSEo3P9A0WyB1KUSPjdvP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3wIdvOP41RZB3oB1bxuC32rRf2CvXZTxCZejiTRcUijW/N+EZ5wP?= =?us-ascii?Q?Dv0rKsG+is6ZAmO3Mx8vrHIUURtbqQRvEZjb/xPFU+o0GjHKN6KfD+N4nM/o?= =?us-ascii?Q?4P0NDIytWt4XBLHeCB5xSBnmddKaZa4VFAL3ne/6c8ktje+yVT8XbP0Ovq6o?= =?us-ascii?Q?94XwdCXy2X6XaGYgbIFoydlvrjMck2xumLIKNXenZamP4VuC93cq/FiWRd6A?= =?us-ascii?Q?sGCZVuU2SamsIX0NdkSB6IXhngQFQk+K7LeAanqhchGJmvYrVH4tgxPQnrQ+?= =?us-ascii?Q?H3/F6FkFkMKpy4jxmZk8=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0701MB1866;6:FdlqGrG3/K3D+4YKsuH0DmEhAjsWn1CBMZy5mF30?= =?us-ascii?Q?9qhJAIbP0/V3WCyLqUbFZ0r2k5afnZBu7ox3umcGKQ/RfadwYDTpMCFwL8BD?= =?us-ascii?Q?0GMN0hukWtX1tAyn+cEYZZE9Gsvulvxn+PVfj2kridDJ1SgLnNVN78ndvEqt?= =?us-ascii?Q?K6zSK6GgKif7Z0G1mubxLDkcYwgPvrnRTW6Cor8VyRLTR1K3CQpdVwv98XSg?= =?us-ascii?Q?jqs/ij+Q3g2yjdri+GFslTlba++fcnT6PAqfZpAXm5AQ7hY2xUfNxBzQOAIy?= =?us-ascii?Q?akDQmn8vyqva9wo0O5jIHMWYU7xrDK9/t/AlkmLdUp8PyTe+wyKHjMU5zft6?= =?us-ascii?Q?zBEDKYy7j2PKTAYyfNY8NSbSQuz8dHq6UZA9/BB0vUXBu0YS/CYofmkgDsCq?= =?us-ascii?Q?3OarRivcIQogu/y9FqyZnU+kFIut2b54eSoKyELk3YmetpRm32m6noZJhR8j?= =?us-ascii?Q?tEuA1MSReHfqbc8zP7m5aRpgOQImnyv/6JP58zHO63YnK2vz0As5XSr8PqVj?= =?us-ascii?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wwI5wFmwpGuzC/negA5S7DiQUARhul56u0B0Rh9Dk3DDU/T4PedHwPi37vEVXeiVepzjlZOjpgGVg;24:E1v3oIcgqCQ/2jty/725pyujs9gCO+dHZ3808SAhKsvbFPDwbApq068IVpwiFyqlbmLvtYsu5PhG12EMRfC/TNvJpFfb/rLpgB24G2AmYxU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1866;7:aqPCn9U40DyE42YH6En62Xuk/4emzwMkBe53EKPxPXrI9JCmVDTeDzPK33hfn+ThhUQKW6YBwZRZzCOVsC2djNjM83h07wm10j7mQ16LyaQHiZGwJOu7w0UxOoDnnbt21MHVsI/eSR/k/EzIvZXtsFDbvKunEYBEZkGERIT+JCifTYRNyW1abQKoSpZfMGM3G1jsIkLKZHIZCBEdPDQHmX7VpFM9CNC81nMjop2msByOKgs/LZg5a1Pan+n02R76C7aFrqg3vjfe/ylqgNp34v/jSmplAfEoT54VYOutWc5xii7DRFQkhSHGx3LAT1G3g5eRxO6A/AcPCGEa54IhpJKKdSR45z94IZtVgcykPb1R2lh/NTZGu19K85+60rGVLDYpRNS3CYy5DdhblaqrhvCNJV935ZZ/7igaA1ihJP6QkHlZNxrNEOzJZbxs+Izd02J08WGvGZ8KTM0CjZLTDR5iOuJIW+LEv+xYKGbnaLJFDSP2s4avo3wz+41uz4TpJVOFqunuG7offtEnEQWsBseK0IfwLcdDUD1hNjTIETC2E+qlZCY/mLPFaMxIq/AQ1/Xr6dRpj6w+szFB2xh8mwIhnP7MHVjgM7aLWXio4pE66vHPTg+Ezb9spz2LNLoTxaQtsTQ/cBFYwQTBZPzgpoX/77zqimDe+Fyy2UVN3yp0/624Zo5p/2kzg61rNNsIxxoVv3i+OPaBWFxKEwTMyG9zA6l/JxSbkHqXTeWuWDA7XwVmVS7idzG7JTkTQ+QxrfeU4SAiHgYsvPjticAbsw441hCqQERU54+1RgET0EM= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2017 14:27:40.9662 (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: 2456 Lines: 55 On Mon, Jun 19, 2017 at 06:43:48PM +0100, Russell King - ARM Linux wrote: > On Mon, Jun 19, 2017 at 06:18:18PM +0300, Yury Norov wrote: > > One else thing I forgot to ask - now you have the generic > > implementation for fncpy(), so do you really need to save arm > > version of it? > > This was covered in the review of v1, which took the ARM version > and incorrectly used it as an asm-generic implementation. > > I explicitly asked Florian _not_ to copy the ARM fncpy() version > to asm-generic because it has (surprise surprise) ARM specific > behaviours that do not belong in a cross-architecture generic > version. > > Namely, the ARM specific behaviour that bit 0 of a code address is > used to signal whether the code should be executed as ARM code or > as Thumb code. > > This behaviour has no meaning on other architectures (eg, x86) > where code addresses are not 32-bit aligned. > > So, suggesting that the ARM fncpy() should be used as an asm-generic > version is completely absurd, and just because we have an asm-generic > version also does not mean ARM should use it. > > Florian's approach to providing an asm-generic version, leaving the > ARM specific version is entirely correct and appropriate. > > So, in answer to your question, yes, we need _both_ an ARM specific > version and an asm-generic version, where the ARM specific version is > different from the asm-generic version. Purely because it needs > architecture specific details. Hi Russell, Florian, Thanks for clarifications. Thumb bit is a good reason to save arm version, and I completely agree with you in this. Sorry that missed it in the v1 discussion. > I explicitly asked Florian _not_ to copy the ARM fncpy() version > to asm-generic because it has (surprise surprise) ARM specific > behaviours that do not belong in a cross-architecture generic > version. But it seems that v3 does exactly that - copies arm with very small changes. :) Maybe there are good reasons to have arm version exactly how it looks now, but in general case, for me, some things that it does are not needed. I mean checking the alignment of the source and the type of destination. And after some headscratching I became even more convinced that for the general case it would be much preferable to write the fncpy() as regular function in .c file, not a macro, at least to have the corresponding symbol in binary and let the assembler code to call it, which is very probable. Yury