lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 9 Jul 2022 11:25:06 +0800
From:   David Gow <davidgow@...gle.com>
To:     Daniel Latypov <dlatypov@...gle.com>
Cc:     Brendan Higgins <brendanhiggins@...gle.com>,
        Luis Chamberlain <mcgrof@...nel.org>,
        Jeremy Kerr <jk@...econstruct.com.au>,
        Shuah Khan <skhan@...uxfoundation.org>,
        Andrew Jeffery <andrew@...id.au>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        Andra Paraschiv <andraprs@...zon.com>,
        Longpeng <longpeng2@...wei.com>,
        Greg KH <gregkh@...uxfoundation.org>,
        KUnit Development <kunit-dev@...glegroups.com>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        MaĆ­ra Canal <maira.canal@....br>,
        linux-mmc <linux-mmc@...r.kernel.org>,
        linux-aspeed <linux-aspeed@...ts.ozlabs.org>,
        OpenBMC Maillist <openbmc@...ts.ozlabs.org>,
        linux-usb@...r.kernel.org, linux-modules@...r.kernel.org,
        Matt Johnston <matt@...econstruct.com.au>
Subject: Re: [PATCH v3 1/5] kunit: unify module and builtin suite definitions

On Sat, Jul 9, 2022 at 2:23 AM Daniel Latypov <dlatypov@...gle.com> wrote:
>
> On Fri, Jun 24, 2022 at 10:10 PM David Gow <davidgow@...gle.com> wrote:
> > diff --git a/include/kunit/test.h b/include/kunit/test.h
> > index 8ffcd7de9607..54306271cfbf 100644
> > --- a/include/kunit/test.h
> > +++ b/include/kunit/test.h
> > @@ -250,41 +250,8 @@ static inline int kunit_run_all_tests(void)
> >  }
> >  #endif /* IS_BUILTIN(CONFIG_KUNIT) */
> >
> > -#ifdef MODULE
> > -/**
> > - * kunit_test_suites_for_module() - used to register one or more
> > - *                      &struct kunit_suite with KUnit.
> > - *
> > - * @__suites: a statically allocated list of &struct kunit_suite.
> > - *
> > - * Registers @__suites with the test framework. See &struct kunit_suite for
> > - * more information.
> > - *
> > - * If a test suite is built-in, module_init() gets translated into
> > - * an initcall which we don't want as the idea is that for builtins
> > - * the executor will manage execution.  So ensure we do not define
> > - * module_{init|exit} functions for the builtin case when registering
> > - * suites via kunit_test_suites() below.
> > - */
> > -#define kunit_test_suites_for_module(__suites)                         \
>
> Deleting this bit now causes merge conflicts with Shuah's kunit
> branch, due to https://patchwork.kernel.org/project/linux-kselftest/patch/20220702040959.3232874-3-davidgow@google.com/
> I.e. We added in a MODULE_INFO(test, "Y") in this to-be-deleted section.

Nice catch. I've rebased this series on top of the taint stuff:
https://lore.kernel.org/linux-kselftest/20220709032001.819487-2-davidgow@google.com/T/#u

> Perhaps something like this would be a fix?

Thanks.The rebased version is basically this, but without the #ifdef
MODULE indirection, as MODULE_INFO() will decay to nothing if MODULE
is not defined, anyway.

>   #ifdef MODULE
>   #define _kunit_mark_test_module MODULE_INFO(test, "Y")
>   #else
>   #define _kunit_mark_test_module
>   #endif /* MODULE */
>
>   #define __kunit_test_suites(unique_array, unique_suites, ...)
>           \
>           _kunit_mark_test_module;
>           \
>           static struct kunit_suite *unique_array[] = { __VA_ARGS__,
> NULL };     \
>           static struct kunit_suite **unique_suites
>           \
>           __used __section(".kunit_test_suites") = unique_array
>
>
> > -       static int __init kunit_test_suites_init(void)                  \
> > -       {                                                               \
> > -               return __kunit_test_suites_init(__suites);              \
> > -       }                                                               \
> > -       module_init(kunit_test_suites_init);                            \
> > -                                                                       \
> > -       static void __exit kunit_test_suites_exit(void)                 \
> > -       {                                                               \
> > -               return __kunit_test_suites_exit(__suites);              \
> > -       }                                                               \
> > -       module_exit(kunit_test_suites_exit)
> > -#else
> > -#define kunit_test_suites_for_module(__suites)
> > -#endif /* MODULE */
> > -
> >  #define __kunit_test_suites(unique_array, unique_suites, ...)                 \
> >         static struct kunit_suite *unique_array[] = { __VA_ARGS__, NULL };     \
> > -       kunit_test_suites_for_module(unique_array);                            \
> >         static struct kunit_suite **unique_suites                              \
> >         __used __section(".kunit_test_suites") = unique_array
> >

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4003 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ