Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3015438rwi; Fri, 21 Oct 2022 10:25:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM63Da6Og2BhQ+FZIa81fbwi00FDYOXFhgaNUm4tMZT6LSxtRNRY7TQhj80grbF3HGVyrl7K X-Received: by 2002:a17:907:3e9c:b0:78d:ce8b:8548 with SMTP id hs28-20020a1709073e9c00b0078dce8b8548mr16817824ejc.427.1666373115458; Fri, 21 Oct 2022 10:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666373115; cv=none; d=google.com; s=arc-20160816; b=utHDb0ChuEYEe3EjRWjz5esoioCHLYoTSCi6L0Cl+vKAZc2+GB6eeWZk7F4Yb6GtgN sbMnmFbw1LiKe5msoMe6vpMld396aELoFvimnDyTPbkam7pn6v9ayi+Hxer7OHn2Hgmz e1VL/xb9VkqoUYEutbS6nL1/uOYQhFjNs7ODOvYJ15vtBS2l58x8DKJYDC3PbOBsclSR XjGH8PYbVgNSLFMSmZJJ8VQId01imNFujAuSImJk1qJSPjy4RiJ1LJK2JsrtiENpiwdJ 6CbCzugDjrxextssPDnhjEUEAOcXkfZ3fzKrUE2/Sj/UnDfKEUjrnXew3v9wewOBkrod cR+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=rWonAb30ieOFI8zUswUwitQNuymOo2mxsfwUr5huPD8=; b=SmCWxO1sX1iasPYipOOfViZxaUtLEOvHShbn43tm42u0ZIu+xdUm2mTKGaG2tNRhax cB4ccEle3l18ZP1e41jrldqyU/THF/D6MDukDSbcp4IOeoVdO3ofNZ9AfmdFmsohrovv +rHblKg9I8S9WMPQ+ueIRdf7f9jb/uuwg2w+Z5g6SYy3XJ4ylRzx09hyasC9NNBXdYng P3YFhhNQ3Ax4ukMopdgNKxe2IukgGfTTqOdU3/7Jo3NKiKi1tS4eX8zAULeS/3QGKSv0 lVsq42KsyuE/RQ25WX4rvtjLJwUktBf8GsKKZ8LdSsZ/0ygp49OVIQVGOX9MyYYS34/S b7NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jLMqfOwO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt4-20020a170907728400b00791a2a7e578si9949197ejc.641.2022.10.21.10.24.36; Fri, 21 Oct 2022 10:25:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jLMqfOwO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230094AbiJURHp (ORCPT + 99 others); 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> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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