Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751720AbbERBNp (ORCPT ); Sun, 17 May 2015 21:13:45 -0400 Received: from ozlabs.org ([103.22.144.67]:50392 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751375AbbERBNe (ORCPT ); Sun, 17 May 2015 21:13:34 -0400 Message-ID: <1431911611.13218.1.camel@ellerman.id.au> Subject: Re: [PATCH 0/3] add new strscpy() API for string copy From: Michael Ellerman To: Chris Metcalf Cc: Linus Torvalds , Al Viro , Fabian Frederick , Randy Dunlap , Rickard Strandqvist , gregkh@linuxfoundation.org, Peter Zijlstra , "David S. Miller" , Frederic Weisbecker , Andrew Morton , Sam Ravnborg , Stephen Rothwell , "Theodore Ts'o" , Grant Likely , Linux Kernel Mailing List , linux-arch@vger.kernel.org Date: Mon, 18 May 2015 11:13:31 +1000 In-Reply-To: <55560D8F.60704@ezchip.com> References: <1430409677-13284-1-git-send-email-cmetcalf@ezchip.com> <1431645018.2981.3.camel@ellerman.id.au> <55560D8F.60704@ezchip.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1772 Lines: 40 On Fri, 2015-05-15 at 11:15 -0400, Chris Metcalf wrote: > On 05/14/2015 07:10 PM, Michael Ellerman wrote: > > On Thu, 2015-04-30 at 12:01 -0400, Chris Metcalf wrote: > >> > >> I tested the implementation with a simple user-space harness, so I > >> believe it is correct for the corner cases I could think of. In > >> particular I pairwise-tested all the unaligned values of source and > >> dest, and tested the restriction on src page-crossing at all > >> unaligned offsets approaching the page boundary. > > Can you please put that in tools/testing/selftests and merge it as part of the > > series? That way I can run the tests and be confident it works on powerpc. > > Unfortunately, the strscpy patch series only changes the one previous > user of the API, which is a tile-architecture-only driver piece, not > particularly useful for anyone else for testing. > > The testing I did pulled strscpy() and word-at-a-time out into a > separate, standalone userspace implementation, and tested it there, > rather than doing tests through the syscall API like > tools/testing/selftests. Not everything in selftests has to or does go through the syscall API. We (powerpc) have tests of our memcpy/memcmp/load_unaligned_zeropad that are built as standalone test programs. Doing that for stuff in lib/string.c does look a bit complicated, because you'd need to pull in a bunch of kernel headers. Do you mind posting your test code somewhere so I can run it, and maybe I can work out how to fold it into a selftest. cheers -- 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/