Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3255715pxb; Tue, 12 Jan 2021 10:00:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4H2KtKdztsI0SU3RnwaUllCBVxPVkB1V0VcUuwDa3WDl20CdY8PZwBmij3V8/maf/gQ/p X-Received: by 2002:a17:906:d93c:: with SMTP id rn28mr44944ejb.50.1610474428571; Tue, 12 Jan 2021 10:00:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610474428; cv=none; d=google.com; s=arc-20160816; b=DQ0t4rKnn40m9wWjBSDflVUMT/fo0W0b135yqdukxMxIHdDBGlky71WUjkvPd8pH0n 1NfSxLZpnc8J28zuBZNBd95ZXfizTKvJQCf7mVduN9fle3zQJ0x6uZr+SOpfgVeD9Nsq n5ROGZMNwjJcaQNAkLoPGNiQW00CEuQDQe2wpfJk0OorhbfsYF3yvd2x9r73HsM6fiIG I9PjA5s0nohPHJksyvrRT+S6ikcCfRmSmafCc5fcdbXuerP5uVoC5UwizHx1WPWqELKb OLXE9v1dj7M49GIIu9XMMXMHreqTIKy6TGxpZ3kROnfGWqbv9Xy1iKR2hcv9cQmr5C9r cEYA== 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=Upx2oTWYrPXCgwMubh2XCOEphSc2BQiSntB9Zcy4eo4=; b=FoH8W+IOblMSJGAViIIVvQrS5d5B6ZIpSczHpmTmIC2UMNrq6tBlJjuaBIz6xAu8/t Li40nA/njD8HXM19VoCqxY/MGZ0magLu03995YCwSgt+4/lRdSwR0yPxw4TOIUeBANHg QfkSRJyeM8RcL0zta4zWlumBw7qFmm09ZKf7AhkNXqgE4F8+xYZnOKURKJ8ENVoJvBx+ b1GqZzw9CxooyBt1OG9chXH2Q4Ni3yvu/pqL7pE8OvqTpkf7i2xaYwuX8EI8cMc/XmE1 z2HbgHkWCnHw0LmRuhcahjOePpkBrrt8pS9VgYVrqMegMcD9NkD6Ozs7dY9v2Sck/8Q1 zRnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cFM44SJt; 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 oq7si1506127ejb.471.2021.01.12.10.00.03; Tue, 12 Jan 2021 10:00:28 -0800 (PST) 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=cFM44SJt; 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 S2390571AbhALR4r (ORCPT + 99 others); Tue, 12 Jan 2021 12:56:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389851AbhALR4p (ORCPT ); Tue, 12 Jan 2021 12:56:45 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD96CC061575 for ; Tue, 12 Jan 2021 09:56:04 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id 15so1920891pgx.7 for ; Tue, 12 Jan 2021 09:56:04 -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=MHO+1TPmYlRhL5ZbxV0qVZWkemVssBlrm/PlG4epQb75oDNd8Kjm+YOCYzhaHGXeG4 1+F+W1sLl9GSYYwozDtv+i1GLH5GiogNHE2Bbh70BXC8/nEmFoG/rHHWz2UhKhzbKZCd uMbh+88T3mFDV/Sm1K7/EE7r6eXaMydVXM6RxsK+7GEB0I2YQADThADOUAi4rZ/AHyhG lCMf/EwZzMMwLBQjOLvC8FoUcWPGveRHZAHUGH1CnxaO8ZV6syh1AgG+L+AoGxFp5yQ1 CjXyQDHiehzhzJ7GzzBWxDTEz1NTPaunq7dSaqYI2rgYxbHi2swJT0RgrsE3WYm8jnju FHHg== X-Gm-Message-State: AOAM531wTftUbfVtuOVV86OiuwCLOJOVj6u4+mrgNCp9wEIuAo2bDq5K xP6cdYlEk4nxNeptkmC9vkHJ8XvIETVgTis9rYI/hA== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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!