Message ID | 20210715213138.1363079-1-dlatypov@google.com |
---|---|
Headers | show |
Series | crypto: tcrypt: small changes to run under KUnit | expand |
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. > * 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 <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
On Thu, Jul 22, 2021 at 11:43 PM Herbert Xu <herbert@gondor.apana.org.au> 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 <herbert@gondor.apana.org.au> > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
On Fri, Jul 23, 2021 at 12:31:28PM -0700, Daniel Latypov wrote: > > 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? I think it's a mix of both. As in performance on bare metal and under virtualisation may be of interest. I don't think you're going to be going through kunit for the speed tests though, because you need to supply module parameters for tcrypt to do that. Cheers, -- Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
On Fri, Jul 30, 2021 at 10:55 AM Herbert Xu <herbert@gondor.apana.org.au> wrote: > > On Fri, Jul 23, 2021 at 12:31:28PM -0700, Daniel Latypov wrote: > > > > 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? > > I think it's a mix of both. As in performance on bare metal and > under virtualisation may be of interest. I don't think you're going > to be going through kunit for the speed tests though, because you > need to supply module parameters for tcrypt to do that. FYI, there is a patch for kunit_tool which will allow kernel parameters to be passed through: https://patchwork.kernel.org/project/linux-kselftest/patch/20210715160819.1107685-1-dlatypov@google.com/ That being said, no-one's ever used any of the KUnit tooling for performance testing before, as far as I know, so whether or not it turns out to be useful or not remains to be seen. With this patch, it'd at least be an option if you wanted to try it. -- David