From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D7EAFA373D for ; Fri, 21 Oct 2022 17:07:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230074AbiJURHp (ORCPT ); Fri, 21 Oct 2022 13:07:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230005AbiJURHm (ORCPT ); Fri, 21 Oct 2022 13:07:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ADD0280832; Fri, 21 Oct 2022 10:07:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C9FBA61F07; Fri, 21 Oct 2022 17:07:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37656C433C1; Fri, 21 Oct 2022 17:07:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666372059; bh=VPjhYfOUR6L2mwkcCBIV4jQwrQEUQNNlpty2cw8v/yY=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=jLMqfOwO4f5VGNM/qSMh1erQ7koRuRREgh06yaQjK5qdWlFE/UNcapLrlCEYz20H3 aEpCTRzeyEUFWeXPA9p0X84o0Zefrggy1eV9DsgupKXOLMfMsG+u/JungS+wHKsA6J nc7/BMi/vdYR86OnxKWs6eGWx1CajJ0w45cP32uvy9jXEvT1lYwO0qkyyfbFLdDyRG Xm95gsb8cztGKVH3JNsUEeTJHu3/v9/QwN79LpmKyFGHIb/8Rwy+GcXS66NGoYVdwk KotPi/6YaHnHRNN2M9P8VsUbszRrxgdHbMhSfy6maPNZAOato040UGO3mAwPhUTsRY RhANv9J4799qw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id CABFE5C0543; Fri, 21 Oct 2022 10:07:38 -0700 (PDT) Date: Fri, 21 Oct 2022 10:07:38 -0700 From: "Paul E. McKenney" To: Willy Tarreau Cc: Rasmus Villemoes , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests/nolibc: add 7 tests for memcmp() Message-ID: <20221021170738.GM5600@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20221021060340.7515-1-w@1wt.eu> <20221021155645.GK5600@paulmck-ThinkPad-P17-Gen-1> <20221021170134.GB8420@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221021170134.GB8420@1wt.eu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 21, 2022 at 07:01:34PM +0200, Willy Tarreau wrote: > On Fri, Oct 21, 2022 at 08:56:45AM -0700, Paul E. McKenney wrote: > > On Fri, Oct 21, 2022 at 08:03:40AM +0200, Willy Tarreau wrote: > > > This adds 7 combinations of input values for memcmp() using signed and > > > unsigned bytes, which will trigger on the original code before Rasmus' > > > fix. This is mostly aimed at helping backporters verify their work, and > > > showing how tests for corner cases can be added to the selftests suite. > > > > > > Before the fix it reports: > > > 12 memcmp_20_20 = 0 [OK] > > > 13 memcmp_20_60 = -64 [OK] > > > 14 memcmp_60_20 = 64 [OK] > > > 15 memcmp_20_e0 = 64 [FAIL] > > > 16 memcmp_e0_20 = -64 [FAIL] > > > 17 memcmp_80_e0 = -96 [OK] > > > 18 memcmp_e0_80 = 96 [OK] > > > > > > And after: > > > 12 memcmp_20_20 = 0 [OK] > > > 13 memcmp_20_60 = -64 [OK] > > > 14 memcmp_60_20 = 64 [OK] > > > 15 memcmp_20_e0 = -192 [OK] > > > 16 memcmp_e0_20 = 192 [OK] > > > 17 memcmp_80_e0 = -96 [OK] > > > 18 memcmp_e0_80 = 96 [OK] > > > > > > Cc: Rasmus Villemoes > > > Signed-off-by: Willy Tarreau > > > > I have pulled both of these in, thank you! > > Thanks! > > > One thing, though... I had to do "make clean" in both tools/include/nolibc > > and tools/testing/selftests/nolibc to make those two "[FAIL]" indications > > go away. Does this mean that I am doing something wrong? > > No you didn't do anything wrong, it was the same for me and initially it > was intentional, but probably it wasn't that good an idea. What happens > is that we first prepare a pseudo-sysroot with kernel headers and nolibc > headers, then we build the test based on this sysroot. Thus if any uapi > header or nolibc header changes, nothing is detected. And I'm not much > willing to always reinstall everything for every single test, nor to > detect long dependency chains. Maybe I should think about adding another > target to clean+test at the same time, or maybe make the current > "nolibc-test" target do that and have a "retest" to only rebuild. But > that needs to be thought about with the QEMU test as well (because most > of the time for a quick test I don't build the kernel nor start QEMU, I > just call the executable directly). > > Any ideas or suggestions are welcome, of course. We could consider that > if we build a kernel and start QEMU, it's long enough to justify a > systematic clean maybe ? > > > It would be good to know before I send the pull request containing these, > > so that we can let Linus know of anything special he needs to do to > > ensure a valid test result. > > I see. In the worst case, a preliminary "make clean" will do it. We just > need to decide what's the best solution for everyone (i.e. not waste too > much time between tests while not getting misleading results by accident). Maybe just document the careful/slow way, then people doing it more frequently can do it the clever/fast way. My guess is that the careful/slow is this: pushd tools/include/nolibc make clean make popd pushd tools/testing/selftests/nolibc make clean make -j32 run Or did I miss a turn in there somewhere? Thanx, Paul