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 X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9AEDC433E0 for ; Tue, 12 Jan 2021 17:56:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 593EB2311D for ; Tue, 12 Jan 2021 17:56:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 593EB2311D Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 86ED16B0088; Tue, 12 Jan 2021 12:56:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 820536B0089; Tue, 12 Jan 2021 12:56:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E8736B008A; Tue, 12 Jan 2021 12:56:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0092.hostedemail.com [216.40.44.92]) by kanga.kvack.org (Postfix) with ESMTP id 589846B0088 for ; Tue, 12 Jan 2021 12:56:06 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 183A68248068 for ; Tue, 12 Jan 2021 17:56:06 +0000 (UTC) X-FDA: 77697876732.17.mask97_30155c027517 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id DB743180D0186 for ; Tue, 12 Jan 2021 17:56:05 +0000 (UTC) X-HE-Tag: mask97_30155c027517 X-Filterd-Recvd-Size: 5273 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 Jan 2021 17:56:05 +0000 (UTC) Received: by mail-pg1-f172.google.com with SMTP id q7so1927160pgm.5 for ; Tue, 12 Jan 2021 09:56:05 -0800 (PST) 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=Upx2oTWYrPXCgwMubh2XCOEphSc2BQiSntB9Zcy4eo4=; b=cFM44SJt4abZ2k0N/V/wvcE+AypSBPzNcoOxxYjffEcM2P8o375Gcpk0hRg//m2AyP B8MBGDmbE93WM/ABHzmES0GG7vJ8kr0Ca6WpeiTHfnweGBO+ADGfM1oS8DiycWfgiC05 nvnBP8uU4QZYD/yUH0Yklwuby9KJ0qwxkGzSusHtCPYkJuAIFU2u+mTN8Olwfa65edko 7Q9JzlDJWZLHf706c0q0ztV8AaXE6lK/IBUA0arTGFyaBA249HkJCNl8b9bOdAhFaQk/ 3c9Oj6HZKVnZAGPijvbvnUTfxG6XY48a5Q6joR1mdHNVE1idU4/BwmiZY6M7cY3KE09P Pq2A== 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=Upx2oTWYrPXCgwMubh2XCOEphSc2BQiSntB9Zcy4eo4=; b=nBu+IYbvufw5FwFcrUFObz65N2SR+7GXLgVYvHiTqwEbySUUHM7Y331zNiduOFHgx0 Yjgo0zLzr7GXh1Yf/qSr7US6fzM6UWBYCWkTFlHSXFLB6HjSQ1EI1qFhxTAORmNRhoMN Q7zGUDwC0Wp+R1YNXH9+WUEQSMlVXbjXZJRW5UqMzXMC+7a8MowoUeKz1svTB4m4l/f4 nRhtLneUhl1xlukz7aTFCRcD9eDpDLcTihvIuyVnhaugwqejIEA/BEaK1gCTB4Nj6d+O aj8aRG8trvVKaJ46cZlqEzKKRqZpqZdf93Gg5x+DUhp29oN6AjoArUPgJ5gkmgHpuECk 7FRA== X-Gm-Message-State: AOAM530lPtF/ElDi5Di24BqlGY0IerlG2V0XaMVnmuaPAM/pPdm/rXeb dkAwxr3n97x0EIZlp+bc00BSTgvhGcKCpLpf+UjLuQ== X-Google-Smtp-Source: ABdhPJwjRRI5HrAEIHOrVyzD1kiLcgKTLsKMByfy+UQlsos5Ug2vA6ueDXrnXl6mdKeyh958GyNLYgxd4T1U3qSPUl4= X-Received: by 2002:a62:e309:0:b029:1ae:5b4a:3199 with SMTP id g9-20020a62e3090000b02901ae5b4a3199mr435587pfh.24.1610474164246; Tue, 12 Jan 2021 09:56:04 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andrey Konovalov Date: Tue, 12 Jan 2021 18:55:53 +0100 Message-ID: Subject: Re: [PATCH 03/11] kasan: clean up comments in tests To: Alexander Potapenko Cc: Catalin Marinas , Vincenzo Frascino , Dmitry Vyukov , Marco Elver , Andrew Morton , Will Deacon , Andrey Ryabinin , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , kasan-dev , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Jan 12, 2021 at 8:53 AM Alexander Potapenko wrote: > > On Tue, Jan 5, 2021 at 7:28 PM Andrey Konovalov wrote: > > > > Clarify and update comments and info messages in KASAN tests. > > > > Signed-off-by: Andrey Konovalov > > Link: https://linux-review.googlesource.com/id/I6c816c51fa1e0eb7aa3dead6bda1f339d2af46c8 > > > void *kasan_ptr_result; > > int kasan_int_result; > Shouldn't these two variables be static, by the way? No, then the compiler starts eliminating accesses. > > @@ -39,14 +38,13 @@ static struct kunit_resource resource; > > static struct kunit_kasan_expectation fail_data; > > static bool multishot; > > > > +/* > > + * Temporarily enable multi-shot mode. Otherwise, KASAN would only report the > > + * first detected bug and panic the kernel if panic_on_warn is enabled. > > + */ > > YMMV, but I think this comment was at its place already. It gets updated by one of the subsequent patches. > > static int kasan_test_init(struct kunit *test) > > { > > - /* > > - * Temporarily enable multi-shot mode and set panic_on_warn=0. > > - * Otherwise, we'd only get a report for the first case. > > - */ > > multishot = kasan_save_enable_multi_shot(); > > Unrelated to this change, but have you considered storing > test-specific data in test->priv instead of globals? I'd say that test->priv is for some per-test data that's used in the tests, and multishot is not a part of that. > > if (!IS_ENABLED(CONFIG_SLUB)) { > > - kunit_info(test, "CONFIG_SLUB is not enabled."); > > + kunit_info(test, "skipping, CONFIG_SLUB required"); > > return; > > } > > You may want to introduce a macro that takes a config name and prints > the warning/returns if it's not enabled. Good idea, will do in v2. Thanks!