Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp526277qtb; Wed, 19 Oct 2022 08:07:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7HGXll7LaXheoeQIAQXmXTwpwVx4YlKqiPsafG9iazxTsj0Vtcbt+pvIV1qLwLCscIyBdX X-Received: by 2002:a17:907:86a2:b0:791:910e:cce4 with SMTP id qa34-20020a17090786a200b00791910ecce4mr7276272ejc.36.1666192053096; Wed, 19 Oct 2022 08:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666192053; cv=none; d=google.com; s=arc-20160816; b=0R2+DCtelL5uMNWzU6EAwzb6aU8HqWzvkA6kyXZb9vWn4xzdHGtuEEVQzOxLZrvOWu HjagIXku6bAKcoDBuLtFp7nyOB6km+BBcZOfyOaR7js0qxYRLUNimlUrQ0vAcLxSnEVZ EVdSdC6MKeORc8gfAqQUc4CHs3uKK0AKjuteg/5EPztHqEuScLZoK79zliiYjjdsvUgs ODarrL+IPDT9CU9wk9Jk8b0tnvCrm2PrJ5hfo6e9aYER7VESzczYSvkX2Xnq6Kbeh11R LDTKYxifgqnjPiaMzwd1HmpNMVSLzINPcq/LmJDVN4OQwH4qRiH6VpmLToW0PguIqWvV 5qGg== 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=cknIal1Dqn0NuUAETBIEQ0lkMDHrEUKWbBRZZcSw1O0=; b=tiuyGmy4qrIpbKTZUEsKdwGu7+N7vjJln3Vpbzsv+fel4My8F3lFL5oyYT4NoNBuRW Pef9+wAww3FsowkA/1NdSYv3OjAgACqporS7lMcI09GekodvYTGQVd57EKI2wNo6xCcn 6s7gL5PIdfZuXwAPGtfIHs+lyoOncDZpO5gsrKPB0ysI4N5Layem+NlSb13wBIX4oCA1 7OgfAjyJ0Nd4+vOHWktUDuPFXiAqY8NSFyJi3kVjGscCIUK25QRr3zQzjuw7aLXx0PnB ZyaQKohM+CW+Wxg7MKBSo8zC8U2TZrQeuSGBsw+czs9cW3yuNdk9ACQm83AMxch/gfSu NYOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=orl3WtaD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l1-20020a1709067d4100b00782c1d273cbsi13012838ejp.392.2022.10.19.08.07.03; Wed, 19 Oct 2022 08:07:33 -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=@gmail.com header.s=20210112 header.b=orl3WtaD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231290AbiJSOef (ORCPT + 99 others); Wed, 19 Oct 2022 10:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231575AbiJSOdh (ORCPT ); Wed, 19 Oct 2022 10:33:37 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DA42159A07; Wed, 19 Oct 2022 07:18:12 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id 8so10767318qka.1; Wed, 19 Oct 2022 07:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=cknIal1Dqn0NuUAETBIEQ0lkMDHrEUKWbBRZZcSw1O0=; b=orl3WtaDUNcCVULI1fi76dsgEpQKIF0G7LTX3izYm28mr8jzmmUbBsZXMKVAEqJZxl 9UokjFoKhOnsPeZto0hchT9sGCBY5MNhrO+zFqeoZ6DeraDl4WqSiK7qVOdCTXiEjTcs YSqlFNsNc1cXt3F2AT522djFUeXczOgztyZjbmN/SQCWXxoN3JuUhUzbFfkp2he/K0q6 +6T6vae37EAuX7dNTC6j6DPbZf96EGjUl1U555sZIvvGSA5bIKwrLXr3Cx8MPZ3orUUN Hda6Rp6RISqHOKYTBCyjtsn1qD9IzEJAAtaEeDeaa+uMJIlMiKe5cQGexlqa2NigJZ74 Ix1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cknIal1Dqn0NuUAETBIEQ0lkMDHrEUKWbBRZZcSw1O0=; b=XA29hhfKs9NnmMdrtWbS2LP25PbuGkNHpCLsR9JVGGW5QQQK0AT8DM1rL9S828Rp7I FMrjk+3OJAkhLi8nRFPGm4uE+2dKXwN5MSYHz29yBprOT9tasjnz38bY1SdvR2IP0Ub1 HVtNJgUL3fobb56ADv+ixSRsFpm6uHyLyTQm3Y7NN8YZ+HuGX/zjbjnpT4GzJjkfjWBL hFN8FYSWmyuc+nMqWZ1+hsZeZvmWIHPyo0g+/4cWI8bbTMisZ4agMt5yDjRhXqygr5wI aK58pZNBWlNS08h7Q0b8A2mVWsszWgXGG2PptM7Vn8Dd11Ov45922EvpLaeFeO8D3yUH IDNg== X-Gm-Message-State: ACrzQf3h+AQY9dN6QGRO+mTgTtSjHbR5+TxQ+jA4O2mveHwZJeeINKOc 81hG2/gXMnaNY2j27fDTiDXFID3Dcb3wHLFA0yc= X-Received: by 2002:a37:b2c5:0:b0:6df:f8d6:6ea0 with SMTP id b188-20020a37b2c5000000b006dff8d66ea0mr5676134qkf.386.1666189080171; Wed, 19 Oct 2022 07:18:00 -0700 (PDT) MIME-Version: 1.0 References: <20221019085747.3810920-1-davidgow@google.com> In-Reply-To: <20221019085747.3810920-1-davidgow@google.com> From: Andrey Konovalov Date: Wed, 19 Oct 2022 16:17:49 +0200 Message-ID: Subject: Re: [PATCH] kasan: Enable KUnit integration whenever CONFIG_KUNIT is enabled To: David Gow Cc: Andrey Konovalov , Alexander Potapenko , Andrey Ryabinin , Dmitry Vyukov , Andrew Morton , Vincenzo Frascino , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Daniel Latypov , Brendan Higgins , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On Wed, Oct 19, 2022 at 10:58 AM 'David Gow' via kasan-dev wrote: > > Enable the KASAN/KUnit integration even when the KASAN tests are > disabled, as it's useful for testing other things under KASAN. > Essentially, this reverts commit 49d9977ac909 ("kasan: check CONFIG_KASAN_KUNIT_TEST instead of CONFIG_KUNIT"). > > To mitigate the performance impact slightly, add a likely() to the check > for a currently running test. > > There's more we can do for performance if/when it becomes more of a > problem, such as only enabling the "expect a KASAN failure" support wif > the KASAN tests are enabled, or putting the whole thing behind a "kunit > tests are running" static branch (which I do plan to do eventually). > > Fixes: 49d9977ac909 ("kasan: check CONFIG_KASAN_KUNIT_TEST instead of CONFIG_KUNIT") > Signed-off-by: David Gow > --- > > Basically, hiding the KASAN/KUnit integration broke being able to just > pass --kconfig_add CONFIG_KASAN=y to kunit_tool to enable KASAN > integration. We didn't notice this, because usually > CONFIG_KUNIT_ALL_TESTS is enabled, which in turn enables > CONFIG_KASAN_KUNIT_TEST. However, using a separate .kunitconfig might > result in failures being missed. > > Take, for example: > ./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_KASAN=y \ > --kunitconfig drivers/gpu/drm/tests > > This should run the drm tests with KASAN enabled, but even if there's a > KASAN failure (such as the one fixed by [1]), kunit_tool will report > success. Hi David, How does KUnit detect a KASAN failure for other tests than the KASAN ones? I thought this was only implemented for KASAN tests. At least, I don't see any code querying kunit_kasan_status outside of KASAN tests. I'm currently switching KASAN tests from using KUnit resources to console tracepoints [1], and those patches will be in conflict with yours. Thanks! [1] https://lore.kernel.org/linux-mm/ebf96ea600050f00ed567e80505ae8f242633640.1666113393.git.andreyknvl@google.com/