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 9D123C67871 for ; Thu, 27 Oct 2022 09:10:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235243AbiJ0JKZ (ORCPT ); Thu, 27 Oct 2022 05:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235262AbiJ0JKJ (ORCPT ); Thu, 27 Oct 2022 05:10:09 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56F56120A1 for ; Thu, 27 Oct 2022 02:09:58 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id j4so1544549lfk.0 for ; Thu, 27 Oct 2022 02:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=OmfGV//KmMuic4TgO6B6vfIweF0JdsZfuu3s+Qe2Rfc=; b=BOMLOipgWTGcIVb7PapOdU9iiCF8wgQ45BNUdfX0F957+X8rdd2g09ehnb/YzoQE0U 1+urSVIxFDBtB7meLqbvaxdg+t5vQj2AHEL8XLuElrDsXQ+gc8B1uJxlFaDBKH6ZnMHA NTmHmfkbZaav1fWDblzrnvLqaUo+Vlj6UUecY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OmfGV//KmMuic4TgO6B6vfIweF0JdsZfuu3s+Qe2Rfc=; b=VBEYICmiAjwmliRhvCahUOlpIKogBaHBx1nDN5amyXVMW1VbiDKkHJP1eAfZqq2Nzk i17jYeIWkxiHdldTTrWlRFrqZEVSrtD02lFZdHB4tNLNGGO/0V9diYOkqNDNlCoLQBuI s3jRLQBOP0YaC6XsPTSJ0GN/4ZzyfT7WRWVDDXY4+boYIKCReFdhLht6VSkZoPCw9jJW Wv9cX1MdCh39v9X3a+eG+aSMDN159Bf4bAFmFC95drrHFjEjiEawhPPZP4olg6YlhY9/ Z0BYJXgbRT82zqqcBQUNaV6zWRpF0O64bYc5ilpajAbcUcD2P6T9dujFeRHhL3LRwiBr +80Q== X-Gm-Message-State: ACrzQf2jqYlYLApDQ4Jd3aUMSbrAET65wLVLGkxK03fDyZUzSNXFICum WxSLliuuuEggpI2SyyGu2n4w+Q== X-Google-Smtp-Source: AMsMyM5jjPBa7Tcg65INJ5Gwrp3OOniDuXxIBIYwfP4ATGzQwGtdbjWycZGpTSapwM38W6w8zOuSeQ== X-Received: by 2002:a19:700a:0:b0:4a4:7fc2:788b with SMTP id h10-20020a19700a000000b004a47fc2788bmr19520859lfc.117.1666861797193; Thu, 27 Oct 2022 02:09:57 -0700 (PDT) Received: from [172.16.11.74] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id w7-20020ac254a7000000b004946c99e78asm107237lfk.277.2022.10.27.02.09.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Oct 2022 02:09:56 -0700 (PDT) Message-ID: <0b8feeb2-6ec6-d2af-8aa7-0bf34e7ab4b2@rasmusvillemoes.dk> Date: Thu, 27 Oct 2022 11:09:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] selftests/nolibc: add 7 tests for memcmp() Content-Language: en-US To: Willy Tarreau Cc: "Paul E. McKenney" , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221021060340.7515-1-w@1wt.eu> <20221021155645.GK5600@paulmck-ThinkPad-P17-Gen-1> <20221021170134.GB8420@1wt.eu> <20221021170738.GM5600@paulmck-ThinkPad-P17-Gen-1> <20221021172026.GC8420@1wt.eu> <20221021180040.GN5600@paulmck-ThinkPad-P17-Gen-1> <20221022112228.GB30596@1wt.eu> <20221024155357.GZ5600@paulmck-ThinkPad-P17-Gen-1> <20221026053922.GA19206@1wt.eu> <20221026195224.GA24197@1wt.eu> From: Rasmus Villemoes In-Reply-To: <20221026195224.GA24197@1wt.eu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/10/2022 21.52, Willy Tarreau wrote: > On Wed, Oct 26, 2022 at 11:08:41AM +0200, Rasmus Villemoes wrote: >> On 26/10/2022 07.39, Willy Tarreau wrote: >>> >>> No more false positives nor false negatives anymore. I'm sending you >>> the patch separately. >> >> While you're at it, may I suggest also adding a few test cases where the >> buffers differ by 128, e.g. 0x0 v 0x80 and 0x40 v 0xc0. > > I initially thought about it but changed my mind for +/- 0xc0 that > covered the same cases in my opinion. Do you have a particular error > case in mind that would be caught by this one that the other one does > not catch ? Not really, but in a sense the opposite: for the +/- 0xc0 case, both ways of comparison will give the wrong sign because -192 becomes +64 and vice versa. For +/- 0x80, one way of doing the comparison will "accidentally" produce the right answer, and I thought that might also be a little interesting. I'm fine for proposing a respin of the patch to improve > it if it brings some value, It's your call, you can respin, do an incremental patch, or just ignore me :) Rasmus