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=-24.8 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, USER_AGENT_SANE_1,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 10C69C433E0 for ; Fri, 12 Mar 2021 15:11:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD64C64FDC for ; Fri, 12 Mar 2021 15:11:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD64C64FDC 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 48C846B006C; Fri, 12 Mar 2021 10:11:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4633C6B0072; Fri, 12 Mar 2021 10:11:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 305076B0073; Fri, 12 Mar 2021 10:11:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0136.hostedemail.com [216.40.44.136]) by kanga.kvack.org (Postfix) with ESMTP id 121EF6B006C for ; Fri, 12 Mar 2021 10:11:18 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id CEC7218030093 for ; Fri, 12 Mar 2021 15:11:17 +0000 (UTC) X-FDA: 77911560594.17.074795D Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by imf02.hostedemail.com (Postfix) with ESMTP id 09A574080F63 for ; Fri, 12 Mar 2021 15:11:03 +0000 (UTC) Received: by mail-wm1-f53.google.com with SMTP id w203-20020a1c49d40000b029010c706d0642so4730449wma.0 for ; Fri, 12 Mar 2021 07:11:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jcr1/ntj/CbpMghQTHSbkEub+1AngnBAtvqWktUi4eA=; b=knGlT/faP7TxY8Y+0IyOjYkT4OmjPT4nFFpiaDQrjRqtM2yHTLe2/LQAj5jvPcZpbX nGKsH9cJFkxEjBv9BVwzHsv0AoChAuCcWPEXbazHfI005GLKLPJPDAjKQporN/RcEfg7 DxZDZ2dYOhCrAAb1qJtv0QOlzZDXXyEwDlFYDOAHQlYwYDsmiJzHMzUXIh3WoovAfqoF 4HRC2BB+QTXzg1YQSI4cLRMZuzV89Ar3pOq0m+2tx4Tzt6UAJ12CeXCa7DEqiZnBjcqN /uMd3P0RXpbp63K5qCNz7BFlIugdk/A8MyB0uOnpfXcSbWXGap/JrsVEU/yvJvxU8mBp vgyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jcr1/ntj/CbpMghQTHSbkEub+1AngnBAtvqWktUi4eA=; b=ISFsPZCIl34crRJ1HxwKs76tg03CdGAeqMcLxkX3YueNT2WHVLgyc4tmmH2xcBDgaR p7389iqVHLAkqnJmGl8hM0i50JJHbMPEZzxOcHzSjUZxhw3bPy2O4lyTKMQhwEz1CYdo yTAeP6bK8YBJUJlPxMq+vUYMcmHclXTXpIfV53ZMd0tenvzVhknF5q0Wqn8peJH5IPWM BuxxKWCIJ/Q0NtMx0eMPx4edXt5gmI/yitaSkraq/vV9vdTu9wi5XQj8dJ/fEhs1cfJ9 G8P6xfV/qm3ZhJ9+bSPnMaQKrc+N4mlhqzm5BytwdHRGLHHC/1IDJ47sVsW5xxtAni3k pLHA== X-Gm-Message-State: AOAM532rTlwSE0kQWfTdwiKa16By6yQwZK+UKar60U1EcY4Ho9TgztU+ ExLmyi5XGlyHxkpNTyP0RcaQzQ== X-Google-Smtp-Source: ABdhPJyDDn2k+jQAE9N0hV6Jgr+iFDDhyjZy3wcg7PQBX0dc2+SErraBTRSaXykKhauEUZO1BSjoRw== X-Received: by 2002:a7b:c242:: with SMTP id b2mr14133600wmj.119.1615561867587; Fri, 12 Mar 2021 07:11:07 -0800 (PST) Received: from elver.google.com ([2a00:79e0:15:13:d5de:d45f:f79c:cb62]) by smtp.gmail.com with ESMTPSA id z25sm2801177wmi.23.2021.03.12.07.11.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 07:11:06 -0800 (PST) Date: Fri, 12 Mar 2021 16:11:01 +0100 From: Marco Elver To: Andrey Konovalov Cc: Andrew Morton , Alexander Potapenko , Andrey Ryabinin , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 11/11] kasan: docs: update tests section Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.5 (2021-01-21) X-Stat-Signature: yiq688hfgyy511p194icynuegcfg376x X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 09A574080F63 Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf02; identity=mailfrom; envelope-from=""; helo=mail-wm1-f53.google.com; client-ip=209.85.128.53 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615561863-313687 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 Fri, Mar 12, 2021 at 03:24PM +0100, Andrey Konovalov wrote: > Update the "Tests" section in KASAN documentation: > > - Add an introductory sentence. > - Add proper indentation for the list of ways to run KUnit tests. > - Punctuation, readability, and other minor clean-ups. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > > Changes v1->v2: > - Fix missing snippet delimeter around "test_kasan.ko". > - Drop "the" before "test_kasan.ko". > --- > Documentation/dev-tools/kasan.rst | 32 +++++++++++++++---------------- > 1 file changed, 15 insertions(+), 17 deletions(-) > > diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst > index 5749c14b38d0..a8c3e0cff88d 100644 > --- a/Documentation/dev-tools/kasan.rst > +++ b/Documentation/dev-tools/kasan.rst > @@ -411,19 +411,20 @@ saving and restoring the per-page KASAN tag via > Tests > ~~~~~ > > -KASAN tests consist of two parts: > +There are KASAN tests that allow verifying that KASAN works and can detect > +certain types of memory corruptions. The tests consist of two parts: > > 1. Tests that are integrated with the KUnit Test Framework. Enabled with > ``CONFIG_KASAN_KUNIT_TEST``. These tests can be run and partially verified > -automatically in a few different ways, see the instructions below. > +automatically in a few different ways; see the instructions below. > > 2. Tests that are currently incompatible with KUnit. Enabled with > ``CONFIG_KASAN_MODULE_TEST`` and can only be run as a module. These tests can > -only be verified manually, by loading the kernel module and inspecting the > +only be verified manually by loading the kernel module and inspecting the > kernel log for KASAN reports. > > -Each KUnit-compatible KASAN test prints a KASAN report if an error is detected. > -Then the test prints its number and status. > +Each KUnit-compatible KASAN test prints one of multiple KASAN reports if an > +error is detected. Then the test prints its number and status. > > When a test passes:: > > @@ -451,27 +452,24 @@ Or, if one of the tests failed:: > > not ok 1 - kasan > > - > There are a few ways to run KUnit-compatible KASAN tests. > > 1. Loadable module > > -With ``CONFIG_KUNIT`` enabled, ``CONFIG_KASAN_KUNIT_TEST`` can be built as > -a loadable module and run on any architecture that supports KASAN by loading > -the module with insmod or modprobe. The module is called ``test_kasan``. > + With ``CONFIG_KUNIT`` enabled, KASAN-KUnit tests can be built as a loadable > + module and run by loading ``test_kasan.ko`` with ``insmod`` or ``modprobe``. > > 2. Built-In > > -With ``CONFIG_KUNIT`` built-in, ``CONFIG_KASAN_KUNIT_TEST`` can be built-in > -on any architecure that supports KASAN. These and any other KUnit tests enabled > -will run and print the results at boot as a late-init call. > + With ``CONFIG_KUNIT`` built-in, KASAN-KUnit tests can be built-in as well. > + In this case, the tests will run at boot as a late-init call. > > 3. Using kunit_tool > > -With ``CONFIG_KUNIT`` and ``CONFIG_KASAN_KUNIT_TEST`` built-in, it's also > -possible use ``kunit_tool`` to see the results of these and other KUnit tests > -in a more readable way. This will not print the KASAN reports of the tests that > -passed. Use `KUnit documentation `_ > -for more up-to-date information on ``kunit_tool``. > + With ``CONFIG_KUNIT`` and ``CONFIG_KASAN_KUNIT_TEST`` built-in, it is also > + possible to use ``kunit_tool`` to see the results of KUnit tests in a more > + readable way. This will not print the KASAN reports of the tests that passed. > + See `KUnit documentation `_ > + for more up-to-date information on ``kunit_tool``. > > .. _KUnit: https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html > -- > 2.31.0.rc2.261.g7f71774620-goog >