Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1606563pxv; Fri, 23 Jul 2021 12:32:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjw+Adszy76FPyGGAlMZr2lWzkx3e7YqcqbyyNG4dJNkKUSFjTowD5CCi25qX7bet8nY02 X-Received: by 2002:a5d:960b:: with SMTP id w11mr5210254iol.138.1627068754365; Fri, 23 Jul 2021 12:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627068754; cv=none; d=google.com; s=arc-20160816; b=m/1leuSxIFDAPt2dgqNav6iB0ky31I6IRr90tlDydd9otF3NW913p36ijS0/1P9Wvg W37k8ahidRAfW0J9qsxwc+zMPJTJmX7M2nxeWIHH2O8VQVGYQLoeSCcJyNAxIq0ggxPM Fx+5Q2daGCtiXQb7elPDSM1g8bEosqGyTWqTrgN0juPwODRx8cIjX1BjPBQLJZk4Pr2r Acu5l0ZXCIfa8zvGnQgfl4AAnQNMiWEYKlBdy7tl4M1MqmLig7YLQQqZohYiLK5avc2w aawf2AXWohiCfzsVFcfD2Pu59oEEy7ghLDsVZa6Un7TOHqnmVOOiLcHZSIi69fP503av S/rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=O4duAkdP8nGjwQz3gP8+9f75sObkeoEVncrqoagaAf8=; b=ULL7VulZDcGGRbv2addZ1NUjRvy30mW/o2rp+wWHAD9Oh4UINcPKgkB9FN+3KDsTZJ Wo9TzAIA16H+zf9SOgZ8hCyv/V7QPQpAuumpF1ny1heByoCJRyqP3yT7bb67/6uIDAgI lOIXF+ud8fSFuKU/BqEYLbUKqmXy2+4k31DMvRQrbWObjTjooSvMSlT57juFCe35TM/F cfiwJM32QbvCtw3QPfBVHA2bvauVe6H2ZseAnVfOsDUsJKG1htv4PxS0Rsmm/dAPpalU jpDlxB+bfRweO2ZBccmIdRRSpjfNVAZz9EikQe9DlfbYqaRlMm+fsPd9bb1q8iAvTKhn PD7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Qt8EzUll; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si15889104ilh.117.2021.07.23.12.32.22; Fri, 23 Jul 2021 12:32:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Qt8EzUll; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230480AbhGWSvI (ORCPT + 99 others); Fri, 23 Jul 2021 14:51:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbhGWSvI (ORCPT ); Fri, 23 Jul 2021 14:51:08 -0400 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3865AC061575 for ; Fri, 23 Jul 2021 12:31:41 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id m13so3831747iol.7 for ; Fri, 23 Jul 2021 12:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O4duAkdP8nGjwQz3gP8+9f75sObkeoEVncrqoagaAf8=; b=Qt8EzUllMk+BQxwjEg3h2dLhND6WXelcF1KCJ/OESaIZQAXOBaluspkozlZW4JU2R+ Znk6RH2WGkvMVtpnF6jQsDJNRstUK2sj7oCQyqLlSAZGRo+RcEouepg9OhlYyiS/p4yQ s9ltX/w4poTJ8k5MZwNSxVDzds6mULz9zIVop40Cl/D4JyEaTpsTD49WyrV2fPgZYlhG XcFHEPNTXItFCgL5d2CgCSWzRH/nvr1uyeVYf5CLU3ivAePMLLTfgV+8gexujzqlY15+ aQvrAO63kiibVX+tnhTalXzk/+TvDNI9CpZMk4mheAcD9/zMdCubD3WiP9JyDYFvu1mI jzxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O4duAkdP8nGjwQz3gP8+9f75sObkeoEVncrqoagaAf8=; b=BWkFNTcxrvrpCmWFW6uJA/hafUZYfmuloM3q4NlB2LTomMoWAe+qq9KXWkv/1TnJ3q hHShIrg3TxGeRGypZ39mhhXYNm2Ki2UOG1u2bCDEuY1oW+/+JuQkcDeAFf/SS6avM0uS st3hmXQgBClV5HSWZx1n9V8utyb3b3O1PZobHavW8J+BGSfDn76GiCNYuL0ENtVQU5kk XXVDXwXvB1bn44XfW0rxYadeeejYa2plW2GbCOr5JSJOhdfoggmFDj1yU1M4U9OGOpCp BmpNWYt0nOE713tk3yYRQXq1Ph6jv7YzahHG31ExzWGMR3qWCgMVspbflmPNYtqdLSTE uyQA== X-Gm-Message-State: AOAM53280muRrajibGxDX64wkTd0IbzKpIZyazkyqGIAFbbMA0X+XWsx lbfycSIZ9Oy0D1zNoih6IeidxPmgVt1jtTUbnt0JGA== X-Received: by 2002:a5d:9599:: with SMTP id a25mr5155045ioo.86.1627068700385; Fri, 23 Jul 2021 12:31:40 -0700 (PDT) MIME-Version: 1.0 References: <20210715213138.1363079-1-dlatypov@google.com> <20210715213138.1363079-2-dlatypov@google.com> <20210723064328.GA7986@gondor.apana.org.au> In-Reply-To: <20210723064328.GA7986@gondor.apana.org.au> From: Daniel Latypov Date: Fri, 23 Jul 2021 12:31:28 -0700 Message-ID: Subject: Re: [RFC v1 1/2] crypto: tcrypt: minimal conversion to run under KUnit To: Herbert Xu Cc: davem@davemloft.net, linux-crypto@vger.kernel.org, brendanhiggins@google.com, davidgow@google.com, linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 22, 2021 at 11:43 PM Herbert Xu wrote: > > On Thu, Jul 15, 2021 at 02:31:37PM -0700, Daniel Latypov wrote: > >> == Questions == > > * does this seem like it would make running the test easier? > > I don't mind. tcrypt these days isn't used so much for correctness > testing. It's mostly being used for speed testing. A secondary > use is to instantiate templates. Thanks, that makes a lot of sense. In that case, how useful would `kunit.py run` be? I.e. Do people mostly want to see numbers on bare metal? The default mode of `kunit.py run` is to use ARCH=um. I assume (for at least most of the library-type crypto code) it should have the same performance characteristics, but that might not be the case. I can try and get some numbers on that. There's an option to make `kunit.py run` use ARCH=86_64, but it'll be in a QEMU VM, so again there's some performance overhead. If either option seems useful, then perhaps a minimal patch like this would be beneficial. I can make it even smaller and less intrusive by restoring the "ret += ..." code and having a single `KUNIT_EXPECT_EQ_MSG(test, ret, 0, "at least one test case failed")` at the very end. It does not sound like patch #2 or any future attempts to try and make use of KUnit features is necessarily worth it, if correctness testing isn't really the goal of tcrypt.c anymore. > > > * does `tvmem` actually need page-aligned buffers? > > I think it may be needed for those split-SG test cases where > we deliberately create a buffer that straddles a page boundary. > > > * I have no clue how FIPS intersects with all of this. > > It doesn't really matter because in FIPS mode when a correctness > test fails the kernel panics. > > > * would it be fine to leave the test code built-in for FIPS instead of > > returning -EAGAIN? > > The returning -EAGAIN is irrelevant in FIPS mode. It's more of > an aid in normal mode when you use tcrypt for speed testing. > > Thanks, > -- > Email: Herbert Xu > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt