Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp232068rwb; Tue, 25 Jul 2023 15:02:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlGv/xwaRrJYy/xjT9vm6UR0caxvmpDLmjBgqgdjDQX1JVTJ2nb2icEGjU41M1lnAJhFB2e+ X-Received: by 2002:a17:90a:1546:b0:263:ebab:a152 with SMTP id y6-20020a17090a154600b00263ebaba152mr353105pja.19.1690322573897; Tue, 25 Jul 2023 15:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690322573; cv=none; d=google.com; s=arc-20160816; b=jg6sRZBCige0cI5F6yAosLyBvbAThFJUK5P7cpdR5nDJdjLoqoBrSqmuNSlYgdh0yd dRT7d50bKlnyMzKKUt1P9JODxIWOxLpLoV5Bdwh7NVJ9lWf/OpPIjlU6vfN1HluTHQ3A 0jV4FYe60II/VwOtT+d9lLmOda2c8VkFjPaNI+UePQDEo81fy9ZsdNksxuLaJFgtsktv 65mRr3hk8+kPk2+H6vs0ePXFlV5Bu9f2TSNH6UVx4fI9hzKfZy7zTjnFahFULeqN3p7T /OMalpUQtwvYz6eiqYfQlE/bMqiywTDJh+KfRRxic9hJPm5P2Q+xxOSyRIA1FUjWS3Hu mMlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=qLoNex9VSKfv9hVd+vj0W4QLZlbUb5hbp+0GMsSnSiM=; fh=eSOGplXNKm0TQlVMiAPjma3ZxjxuDQ0l9LD5ETEQPUY=; b=pDjqC4FPuC1HQ/rShxc9q4Iwjgfj8EU877Ae91L9hcRjhen1AC1581jhk5AvaI4weI GbtY4juNRotvFipf9vYJmID8DamrO1EGs41LWBXXBDCKD/T2Bywl2SSZwvtx1amzTgru A87c5iAZpEDOQgjt2sQNexl6Y3ESwgLcLM5eyd1ILP+ANoEctt5BOQmEPetAdex9tZzB zWmy0tcUIDmgEhJMieOlFO0NQQkG3BV0+I6P2nOp51rdcddQnVGmaDw30yxjwVplbHlw vs7MR7p7fd9663rTPfyDflAzM+V7Rb6ydKWFCObsD5iorXAn2bp/JO7RWxoWmMtZd69a M/Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=iII52Yr2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g3-20020a636b03000000b0055c8b7c0a31si11538249pgc.363.2023.07.25.15.02.41; Tue, 25 Jul 2023 15:02:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=iII52Yr2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230254AbjGYV0D (ORCPT + 99 others); Tue, 25 Jul 2023 17:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231387AbjGYVZq (ORCPT ); Tue, 25 Jul 2023 17:25:46 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D91D5212E for ; Tue, 25 Jul 2023 14:25:39 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5704995f964so75058887b3.2 for ; Tue, 25 Jul 2023 14:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690320339; x=1690925139; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=qLoNex9VSKfv9hVd+vj0W4QLZlbUb5hbp+0GMsSnSiM=; b=iII52Yr2AsFMrW2gl7h9826rnSe3VHq289Q/djrjkXcmtKmfWF+M66UBMsnBuklFAD wNmPfxtVh7FwJSADK8EyZQgbwddlCJ23V9UeneBOn5FSMDMwb4QssEUyPAPtpUw0n41R T5OLyofFO0sw4l+4lpStYNVyjCHWbekTJnqMx53GPpeWJJj7Yd7jEx41AYF99IsGKUp7 7nhxc4H1v8BKg6AXFNzn09i9R5DyqmUzCG+Pv+kFKLoVs8fZlRNs7YAfM6iB3gXrBfcl F1UMW10GmBFckL8ba6elSeP6wQY/jWgbvfg6FCtVnpi9IJr4uwM+/c3/ir/gzLXP9PhL MB5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690320339; x=1690925139; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qLoNex9VSKfv9hVd+vj0W4QLZlbUb5hbp+0GMsSnSiM=; b=J1CHR0XvRkhCEvAFeF78V3EqYKaSEDwK/tYQKd8Hd8RC6hrJ3rf8fdXrK4uaT9rnhI RJtxcbeeJy0BwnegdZHDPlBUevEQzlyrAvxyyqEDd5CuNv3Wj0Igr3O+nUUuTAk/tDJL UeC9/Q5HHm6V4XS16fay+Gv4P7b5M2fsAoygWfyYd05t96QfGRt9ktJ8fseaHT9BAAeK 3TY7/4ida8tynZwdrRk4+DgseyXdkOK1kmVfMqiBiVvwWZHdXyE8zLBDfSlFPXH/6W7h 0UR3/ltumT71dwJSg+iBhgz112R83QWcvmqjdoclEzc82I91XBOdIAMfnGci8taztBzQ 8uAA== X-Gm-Message-State: ABy/qLbMuFK3bjzgHE8U1naSTjDrMA7awNQjuLjIdqM26iKfn4dFQFwx R1VpMFuFmF+G8YAUvSp2W0lh7r5b7Q== X-Received: from rmoar-specialist.c.googlers.com ([fda3:e722:ac3:cc00:2b:7d90:c0a8:45d3]) (user=rmoar job=sendgmr) by 2002:a81:b60b:0:b0:576:af04:3495 with SMTP id u11-20020a81b60b000000b00576af043495mr3609ywh.9.1690320339157; Tue, 25 Jul 2023 14:25:39 -0700 (PDT) Date: Tue, 25 Jul 2023 21:25:17 +0000 In-Reply-To: <20230725212522.1622716-1-rmoar@google.com> Mime-Version: 1.0 References: <20230725212522.1622716-1-rmoar@google.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog Message-ID: <20230725212522.1622716-7-rmoar@google.com> Subject: [PATCH v3 6/9] kunit: memcpy: Mark tests as slow using test attributes From: Rae Moar To: shuah@kernel.org, davidgow@google.com, dlatypov@google.com, brendan.higgins@linux.dev Cc: linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, keescook@chromium.org, linux-hardening@vger.kernel.org, jstultz@google.com, tglx@linutronix.de, sboyd@kernel.org, Rae Moar Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mark slow memcpy KUnit tests using test attributes. Tests marked as slow are as follows: memcpy_large_test, memmove_test, memmove_large_test, and memmove_overlap_test. These tests were the slowest of the memcpy tests and relatively slower to most other KUnit tests. Most of these tests are already skipped when CONFIG_MEMCPY_SLOW_KUNIT_TEST is not enabled. These tests can now be filtered using the KUnit test attribute filtering feature. Example: --filter "speed>slow". This will run only the tests that have speeds faster than slow. The slow attribute will also be outputted in KTAP. Note: This patch is intended to replace the use of CONFIG_MEMCPY_SLOW_KUNIT_TEST and to potentially deprecate this feature. This patch does not remove the config option but does add a note to the config definition commenting on this future shift. Reviewed-by: David Gow Acked-by: Kees Cook Signed-off-by: Rae Moar --- Changes since v2: - No changes. Changes since v1: - No major changes Changes since RFC v2: - No changes. Changes since RFC v1: - Added note under CONFIG_MEMCPY_SLOW_KUNIT_TEST. lib/Kconfig.debug | 3 +++ lib/memcpy_kunit.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 550cb967b668..1b3894e861f2 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -2701,6 +2701,9 @@ config MEMCPY_SLOW_KUNIT_TEST and bit ranges. These can be very slow, so they are split out as a separate config, in case they need to be disabled. + Note this config option will be replaced by the use of KUnit test + attributes. + config IS_SIGNED_TYPE_KUNIT_TEST tristate "Test is_signed_type() macro" if !KUNIT_ALL_TESTS depends on KUNIT diff --git a/lib/memcpy_kunit.c b/lib/memcpy_kunit.c index 887926f04731..440aee705ccc 100644 --- a/lib/memcpy_kunit.c +++ b/lib/memcpy_kunit.c @@ -551,10 +551,10 @@ static void strtomem_test(struct kunit *test) static struct kunit_case memcpy_test_cases[] = { KUNIT_CASE(memset_test), KUNIT_CASE(memcpy_test), - KUNIT_CASE(memcpy_large_test), - KUNIT_CASE(memmove_test), - KUNIT_CASE(memmove_large_test), - KUNIT_CASE(memmove_overlap_test), + KUNIT_CASE_SLOW(memcpy_large_test), + KUNIT_CASE_SLOW(memmove_test), + KUNIT_CASE_SLOW(memmove_large_test), + KUNIT_CASE_SLOW(memmove_overlap_test), KUNIT_CASE(strtomem_test), {} }; -- 2.41.0.487.g6d72f3e995-goog