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 7E9F9C19F29 for ; Tue, 2 Aug 2022 17:29:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235080AbiHBR3w (ORCPT ); Tue, 2 Aug 2022 13:29:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234911AbiHBR3l (ORCPT ); Tue, 2 Aug 2022 13:29:41 -0400 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F25554AD4F for ; Tue, 2 Aug 2022 10:29:39 -0700 (PDT) Received: by mail-yb1-xb2c.google.com with SMTP id 204so23480172yba.1 for ; Tue, 02 Aug 2022 10:29:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=MvRBkFzdQaYaXfpQTRaszNRJA99lxIjSlE2BIJqxf/w=; b=QRi9qghYw00C8ncMgz03GPp5X4XZwYBjLhTst+txxvrrxIKQSUmvN0iydfY7XxTRPZ FljvcSTp2ADimYd7Symv/nntq6KpZiWp6d//C2GypYu/OlpHeLOtYJAAvDcymW7JC3z0 vFmHS4EctNa1FeEfaDLNxOsvpogUFSLuXoQkFy1gkjcrY42Fcsk3slvwkX0sSHWa2PA+ tx4YnR0p+wucGibEbwhrHFYXYZI38NDi3qKYYQnitOrDk170nf3Jt8K81Ues6I017fas rtIy9n7wsldT5qtbZc3Up54mQyY1/O/xbkmoCTmJ7Qwc73uY29KBeFOWyQvihRzUNGNx LxaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=MvRBkFzdQaYaXfpQTRaszNRJA99lxIjSlE2BIJqxf/w=; b=gdAx2O6AQ2a11WrZ5PebFsrmX0mfjS2IUB+jq9sNfLip3s9VK5DPXgdegNxRD/f0U/ pOqCnAKsfeKRwBXW5IujZwFnXQ6yxqGFW7CHCa5YWyurWckCO3YaPepMZY6YpCRe14bp DOceau0cohPzAKxrwkCygTPRxLghCYKrLLODtemKD5g0AwZ3/5OXhoEA6vIAXuOmvTsQ UypajjrTPm+Qlg4pG+zJCIfK+P15JzEk8aMdQlQf9VoKagPE2cgWk0k0sXiDVKtp7Y/0 +1ERfFVRnN+RLbV2e24EVmjoLD1/WxpNDQzYLYqvf2MVyvmmKPy9JnpbSuN5bRoD29WR QJig== X-Gm-Message-State: ACgBeo1qfF5dH3rzUnycCBQ+PYePu/6Vu3efi7wjCWg7cc92Aj7iVxh6 CGqIDG9e9ztT8axNP7wlwCCaYORJKL64RQnKHkBGqA== X-Google-Smtp-Source: AA6agR7VtR+Gv6MIRMZVXbACWuJKrFK4u921sU30CJ51jY/b/Dg4+iYwU/syVU8A9VvADNQ3PrTrNZmZWMU0fOSHqlA= X-Received: by 2002:a25:bc3:0:b0:673:bc78:c095 with SMTP id 186-20020a250bc3000000b00673bc78c095mr15729538ybl.376.1659461379014; Tue, 02 Aug 2022 10:29:39 -0700 (PDT) MIME-Version: 1.0 References: <20220701142310.2188015-1-glider@google.com> <20220701142310.2188015-26-glider@google.com> In-Reply-To: From: Alexander Potapenko Date: Tue, 2 Aug 2022 19:29:02 +0200 Message-ID: Subject: Re: [PATCH v4 25/45] kmsan: add tests for KMSAN To: Marco Elver Cc: Alexander Viro , Alexei Starovoitov , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev , Linux Memory Management List , Linux-Arch , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 12, 2022 at 4:17 PM Marco Elver wrote: > > > +static void test_params(struct kunit *test) > > +{ > > +#ifdef CONFIG_KMSAN_CHECK_PARAM_RETVAL > > if (IS_ENABLED(...)) > Not sure this is valid C, given that EXPECTATION_UNINIT_VALUE_FN introduces a variable declaration. > > + if (vbuf) > > + vunmap(vbuf); > > + for (i = 0; i < npages; i++) > > add { } > Done. > if (IS_ENABLED(CONFIG_KMSAN_CHECK_PARAM_RETVAL)) > Same as above. > > +static void unregister_tracepoints(struct tracepoint *tp, void *ignore) > > +{ > > + if (!strcmp(tp->name, "console")) > > + tracepoint_probe_unregister(tp, probe_console, NULL); > > +} > > + > > +/* > > + * We only want to do tracepoints setup and teardown once, therefore we have to > > + * customize the init and exit functions and cannot rely on kunit_test_suite(). > > + */ > > This is no longer true. See a recent version of > mm/kfence/kfence_test.c which uses the new suite_init/exit. Done. > > +late_initcall_sync(kmsan_test_init); > > +module_exit(kmsan_test_exit); > > + > > +MODULE_LICENSE("GPL v2"); > > A recent version of checkpatch should complain about this, wanting > only "GPL" instead of "GPL v2". > Fixed.