From patchwork Mon Oct 14 02:57:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sabyrzhan Tasbolatov X-Patchwork-Id: 13834115 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1C46CF259F for ; Mon, 14 Oct 2024 02:56:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 86ADD6B0096; Sun, 13 Oct 2024 22:56:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 81A516B0098; Sun, 13 Oct 2024 22:56:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 695776B0099; Sun, 13 Oct 2024 22:56:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 4A0776B0096 for ; Sun, 13 Oct 2024 22:56:50 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 56EB840AD4 for ; Mon, 14 Oct 2024 02:56:45 +0000 (UTC) X-FDA: 82670695128.08.43E9D4F Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf08.hostedemail.com (Postfix) with ESMTP id 0091A160005 for ; Mon, 14 Oct 2024 02:56:43 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="Ld/31hrx"; spf=pass (imf08.hostedemail.com: domain of snovitoll@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=snovitoll@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728874467; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=JGMf0QveJLuqNVGuhCQVRHmO+zBayTHS2lF5VIrEUbY=; b=btKdXMMYaHmDQk9dVqbNi6sIHjG8M5DF/bheX10AwuqOvSLo9bMYDxhaO3UO5+dGxZlJfM Yd+M8qX6MGSZCrhbZL6kNyskXQc5KuX5ki4SIpWE1EB6LkRgNInAJ/SmN7U2ZfItRNjH+7 5F2svjH/M4EmergVIvRgSdId6YxiSUY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728874467; a=rsa-sha256; cv=none; b=O56yJv2tiMYPgLAOasX8DZ6E23L0Of0yUe2utLtqzy4QelPnIoJKY5p0zY7HYmw2FxDpjs ZoHt7VDYydsyJem8hPn8WtvIGQ81p2izdLJhdDJjY6/xYq06ru0YJc+++bkt1NXeJsr3wD PoQIA2eJqehs+DfL+vZtLYs/mXOdPrI= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="Ld/31hrx"; spf=pass (imf08.hostedemail.com: domain of snovitoll@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=snovitoll@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a9a0ef5179dso71908566b.1 for ; Sun, 13 Oct 2024 19:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728874606; x=1729479406; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JGMf0QveJLuqNVGuhCQVRHmO+zBayTHS2lF5VIrEUbY=; b=Ld/31hrx8Pm7/fcKedwiWsqnAX2j+/BwJJciQDfS4B20Ur0/6g/QpIHaV4HHTXHPw3 d0BDx556PnsThwK8lbueQf7XbuL6vV8YpeqNtDbA359EVsK0hzbKVTxrKQ+GPYxej8CM EXmXg4BCobwdrZUcyFuqr6sapt7r1OuOB5zyrr+gLJ5MCmXd4OV5JJpvBWlZufy+wBAT 5Q/nIr7iZLmI7J5lbRS+4FtKXfyzKnTLis9g04qL4xeWHt+mZhNiKrzTJAgnTbUy84uR O8BvcnBQi5raoO6JXLNJ3VZfT4SV12+gn/sIl5YnQtZI1AjLcYgL2Rd0GqtGBlCTJ+X/ hQNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728874606; x=1729479406; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JGMf0QveJLuqNVGuhCQVRHmO+zBayTHS2lF5VIrEUbY=; b=C96SetDIRz+nwd8UK1ktYwXgKBQWgsq07ORnY5H2+AEJFKqlOFAyI2f800zoS9ybU8 3LHYqI7xbep7I4F49RY+YOT04gmsPiwwNy9aw1qyJG1aTFF+6xqUTH9bskRVgDwPWYp6 YUcnW65eljcL/BO++4sFjhYBXLjGmOwfIkgAbQ0/748RhYhCFzjaMb12CukLlh+yea2K E8GGxb8yTK/h/uPo+9jMov+crywX/l1WLKcuY288y5UIM68pZQEXn1daYu2YlrXaPjd4 292HZj0lHZN72AqYmYztHH0r/AE0UCf44FCIA/ki1Uig4DBb9lEHhF9mJ7Bq0gVqJ8jR JgeQ== X-Forwarded-Encrypted: i=1; AJvYcCXp3Ey2nAGKeqxtKDxRjhFjJrMl2xJFxqaHxlBDMok0mDtwDScnH8lHiRbzNDIhyRLMzNqGDEC+qA==@kvack.org X-Gm-Message-State: AOJu0YyQn0agumTCYSoPEzwZIADUGQ22Foyxs8ISSeKT1IC9Jbwef7UQ +6RQnAt2iQELsBkVJLOBj+xkuayxYgLaHskQA1PinsQvYmWIeHq6 X-Google-Smtp-Source: AGHT+IGlDB8KlTXo7DMjdLaANmivxjxlnYDmQ0l9WvS8pEmuPKYpnSfmCvDI08URAXjBlRXZF+7cEQ== X-Received: by 2002:a17:907:72c1:b0:a9a:17f5:79a8 with SMTP id a640c23a62f3a-a9a17f59d0bmr26163766b.13.1728874606156; Sun, 13 Oct 2024 19:56:46 -0700 (PDT) Received: from work.. (2.133.25.254.dynamic.telecom.kz. [2.133.25.254]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99ebdfbff1sm270501366b.39.2024.10.13.19.56.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2024 19:56:45 -0700 (PDT) From: Sabyrzhan Tasbolatov To: andreyknvl@gmail.com Cc: 2023002089@link.tyut.edu.cn, akpm@linux-foundation.org, alexs@kernel.org, corbet@lwn.net, dvyukov@google.com, elver@google.com, glider@google.com, kasan-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ryabinin.a.a@gmail.com, siyanteng@loongson.cn, snovitoll@gmail.com, vincenzo.frascino@arm.com, workflows@vger.kernel.org Subject: [PATCH RESEND v3 3/3] kasan: delete CONFIG_KASAN_MODULE_TEST Date: Mon, 14 Oct 2024 07:57:01 +0500 Message-Id: <20241014025701.3096253-4-snovitoll@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241014025701.3096253-1-snovitoll@gmail.com> References: <20241014025701.3096253-1-snovitoll@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 0091A160005 X-Stat-Signature: wyxhi4irtioqitmkkqq7sz3gk9o836d3 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1728874603-4731 X-HE-Meta: U2FsdGVkX1+ce/2STFKLkO9qHXy4TVfPafv1yHELFcDEnagRLMc/c6L67q7ffu5kdQaQ2sP61zz3Zqms3C7kxzYqqz/NnhPs+A599gNNIU2nxvwjZke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azBHMh1JtpDD1SohjWS8wTWIhMDFqO3iQFzUOxI5X6FhjGdsY/NgSDiA918rciZBXoqRZLOg0fM8jDPdI+k5X1yzQP/YvD1TGS08LLqAId8oyhvkwKejeaO72gjhrPbKAC1LuquXjCuf0oM1BLjJD3bQWFTeCUk84bm1THbUp11X2c6OMm8cs92cDcVfPltaJjS1GqqFZmt/RIFIBzp8LEer0OLVs29E6z3JQYZoXk7wb0oMZ9cbuxW/Ws8Vi6YlPHEZwr9iYYiJy3N2eSdkYlxaEGEJddQHwLGclABCpHpcnYFf7umyasB09jFnAWbQRQl4a9zRzzIf1ucQWKgw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000368, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Since we've migrated all tests to the KUnit framework, we can delete CONFIG_KASAN_MODULE_TEST and mentioning of it in the documentation as well. I've used the online translator to modify the non-English documentation. Reviewed-by: Andrey Konovalov Signed-off-by: Sabyrzhan Tasbolatov --- Changes v2 -> v3: - applied Andrey's patch to modify further kasan.rst. --- Documentation/dev-tools/kasan.rst | 23 ++++++++----------- .../translations/zh_CN/dev-tools/kasan.rst | 20 +++++++--------- .../translations/zh_TW/dev-tools/kasan.rst | 21 ++++++++--------- lib/Kconfig.kasan | 7 ------ mm/kasan/kasan.h | 2 +- mm/kasan/report.c | 2 +- 6 files changed, 28 insertions(+), 47 deletions(-) diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst index d7de44f5339..0a1418ab72f 100644 --- a/Documentation/dev-tools/kasan.rst +++ b/Documentation/dev-tools/kasan.rst @@ -511,19 +511,14 @@ Tests ~~~~~ There are KASAN tests that allow verifying that KASAN works and can detect -certain types of memory corruptions. The tests consist of two parts: +certain types of memory corruptions. -1. Tests that are integrated with the KUnit Test Framework. Enabled with -``CONFIG_KASAN_KUNIT_TEST``. These tests can be run and partially verified +All KASAN tests are integrated with the KUnit Test Framework and can be enabled +via ``CONFIG_KASAN_KUNIT_TEST``. The tests can be run and partially verified 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 -kernel log for KASAN reports. - -Each KUnit-compatible KASAN test prints one of multiple KASAN reports if an -error is detected. Then the test prints its number and status. +Each 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:: @@ -550,16 +545,16 @@ Or, if one of the tests failed:: not ok 1 - kasan -There are a few ways to run KUnit-compatible KASAN tests. +There are a few ways to run the KASAN tests. 1. Loadable module - With ``CONFIG_KUNIT`` enabled, KASAN-KUnit tests can be built as a loadable - module and run by loading ``kasan_test.ko`` with ``insmod`` or ``modprobe``. + With ``CONFIG_KUNIT`` enabled, the tests can be built as a loadable module + and run by loading ``kasan_test.ko`` with ``insmod`` or ``modprobe``. 2. Built-In - With ``CONFIG_KUNIT`` built-in, KASAN-KUnit tests can be built-in as well. + With ``CONFIG_KUNIT`` built-in, the 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 diff --git a/Documentation/translations/zh_CN/dev-tools/kasan.rst b/Documentation/translations/zh_CN/dev-tools/kasan.rst index 4491ad2830e..fd2e3afbdfa 100644 --- a/Documentation/translations/zh_CN/dev-tools/kasan.rst +++ b/Documentation/translations/zh_CN/dev-tools/kasan.rst @@ -422,16 +422,12 @@ KASAN连接到vmap基础架构以懒清理未使用的影子内存。 ~~~~ 有一些KASAN测试可以验证KASAN是否正常工作并可以检测某些类型的内存损坏。 -测试由两部分组成: -1. 与KUnit测试框架集成的测试。使用 ``CONFIG_KASAN_KUNIT_TEST`` 启用。 -这些测试可以通过几种不同的方式自动运行和部分验证;请参阅下面的说明。 +所有 KASAN 测试都与 KUnit 测试框架集成,可通过 ``CONFIG_KASAN_KUNIT_TEST`` 启用。 +测试可以通过几种不同的方式自动运行和部分验证;请参阅以下说明。 -2. 与KUnit不兼容的测试。使用 ``CONFIG_KASAN_MODULE_TEST`` 启用并且只能作为模块 -运行。这些测试只能通过加载内核模块并检查内核日志以获取KASAN报告来手动验证。 - -如果检测到错误,每个KUnit兼容的KASAN测试都会打印多个KASAN报告之一,然后测试打印 -其编号和状态。 +如果检测到错误,每个 KASAN 测试都会打印多份 KASAN 报告中的一份。 +然后测试会打印其编号和状态。 当测试通过:: @@ -458,16 +454,16 @@ KASAN连接到vmap基础架构以懒清理未使用的影子内存。 not ok 1 - kasan -有几种方法可以运行与KUnit兼容的KASAN测试。 +有几种方法可以运行 KASAN 测试。 1. 可加载模块 - 启用 ``CONFIG_KUNIT`` 后,KASAN-KUnit测试可以构建为可加载模块,并通过使用 - ``insmod`` 或 ``modprobe`` 加载 ``kasan_test.ko`` 来运行。 + 启用 ``CONFIG_KUNIT`` 后,可以将测试构建为可加载模块 + 并通过使用 ``insmod`` 或 ``modprobe`` 加载 ``kasan_test.ko`` 来运行。 2. 内置 - 通过内置 ``CONFIG_KUNIT`` ,也可以内置KASAN-KUnit测试。在这种情况下, + 通过内置 ``CONFIG_KUNIT``,测试也可以内置。 测试将在启动时作为后期初始化调用运行。 3. 使用kunit_tool diff --git a/Documentation/translations/zh_TW/dev-tools/kasan.rst b/Documentation/translations/zh_TW/dev-tools/kasan.rst index ed342e67d8e..35b7fd18aa4 100644 --- a/Documentation/translations/zh_TW/dev-tools/kasan.rst +++ b/Documentation/translations/zh_TW/dev-tools/kasan.rst @@ -404,16 +404,13 @@ KASAN連接到vmap基礎架構以懶清理未使用的影子內存。 ~~~~ 有一些KASAN測試可以驗證KASAN是否正常工作並可以檢測某些類型的內存損壞。 -測試由兩部分組成: -1. 與KUnit測試框架集成的測試。使用 ``CONFIG_KASAN_KUNIT_TEST`` 啓用。 -這些測試可以通過幾種不同的方式自動運行和部分驗證;請參閱下面的說明。 +所有 KASAN 測試均與 KUnit 測試框架集成,並且可以啟用 +透過 ``CONFIG_KASAN_KUNIT_TEST``。可以運行測試並進行部分驗證 + 以幾種不同的方式自動進行;請參閱下面的說明。 -2. 與KUnit不兼容的測試。使用 ``CONFIG_KASAN_MODULE_TEST`` 啓用並且只能作爲模塊 -運行。這些測試只能通過加載內核模塊並檢查內核日誌以獲取KASAN報告來手動驗證。 - -如果檢測到錯誤,每個KUnit兼容的KASAN測試都會打印多個KASAN報告之一,然後測試打印 -其編號和狀態。 +如果偵測到錯誤,每個 KASAN 測試都會列印多個 KASAN 報告之一。 +然後測試列印其編號和狀態。 當測試通過:: @@ -440,16 +437,16 @@ KASAN連接到vmap基礎架構以懶清理未使用的影子內存。 not ok 1 - kasan -有幾種方法可以運行與KUnit兼容的KASAN測試。 +有幾種方法可以執行 KASAN 測試。 1. 可加載模塊 - 啓用 ``CONFIG_KUNIT`` 後,KASAN-KUnit測試可以構建爲可加載模塊,並通過使用 - ``insmod`` 或 ``modprobe`` 加載 ``kasan_test.ko`` 來運行。 + 啟用 ``CONFIG_KUNIT`` 後,測試可以建置為可載入模組 + 並且透過使用 ``insmod`` 或 ``modprobe`` 來載入 ``kasan_test.ko`` 來運作。 2. 內置 - 通過內置 ``CONFIG_KUNIT`` ,也可以內置KASAN-KUnit測試。在這種情況下, + 透過內建 ``CONFIG_KUNIT``,測試也可以內建。 測試將在啓動時作爲後期初始化調用運行。 3. 使用kunit_tool diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index 98016e137b7..f82889a830f 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -195,13 +195,6 @@ config KASAN_KUNIT_TEST For more information on KUnit and unit tests in general, please refer to the KUnit documentation in Documentation/dev-tools/kunit/. -config KASAN_MODULE_TEST - tristate "KUnit-incompatible tests of KASAN bug detection capabilities" - depends on m && KASAN && !KASAN_HW_TAGS - help - A part of the KASAN test suite that is not integrated with KUnit. - Incompatible with Hardware Tag-Based KASAN. - config KASAN_EXTRA_INFO bool "Record and report more information" depends on KASAN diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index f438a6cdc96..b7e4b81421b 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -568,7 +568,7 @@ static inline void kasan_kunit_test_suite_end(void) { } #endif /* CONFIG_KASAN_KUNIT_TEST */ -#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) || IS_ENABLED(CONFIG_KASAN_MODULE_TEST) +#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) bool kasan_save_enable_multi_shot(void); void kasan_restore_multi_shot(bool enabled); diff --git a/mm/kasan/report.c b/mm/kasan/report.c index b48c768acc8..3e48668c3e4 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -132,7 +132,7 @@ static bool report_enabled(void) return !test_and_set_bit(KASAN_BIT_REPORTED, &kasan_flags); } -#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) || IS_ENABLED(CONFIG_KASAN_MODULE_TEST) +#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) bool kasan_save_enable_multi_shot(void) {