Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1091339imw; Thu, 14 Jul 2022 17:22:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vLzIk+8l+0yUUdGc0HN1KuvOhR+Gl+d/FTJPBnnFgki2pzt6LDxEeYpZzfobpAARcsSfft X-Received: by 2002:a05:6402:1003:b0:43a:75d8:a0e with SMTP id c3-20020a056402100300b0043a75d80a0emr15691450edu.303.1657844564866; Thu, 14 Jul 2022 17:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657844564; cv=none; d=google.com; s=arc-20160816; b=gfHrj8l9mfIY8qtCX+IJCakoi7/MPb3gdJp2Ci0bzDfcuZVNDfCanZ9k9Xdi9bjplW XS018FRnNijjrQXTHcCpdkaYLduzxE1kJeLTKQdyZH9Whf92NcXDmPSLNdMWOi70THvS g6iy9EHqMUjwOdKJS+RUbO6+7B0YyTjV1K4Lr8yuuU55jQ1I2ZXNOEiu7jp60Lm6PjtN a6kPxRkhHVktjs8fOwUqrxdez+Yqd53lXsJWbNnvtQE/eDxpr8cKlXB9a5QGH//HSkQN NiUmPHW92B2LtoiBUbggj9evGe52jsu1M4OGu/yryuI4JFAW2BeHKDoAKCHQaKTNrpJY Vzjg== 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=IyIlDk4W3kNLsc6EwzwzX2HL8L0b3ZfiT6dB513UuYM=; b=vdV4qUwj35yUes3UADYR1S0xYuMe57zvbX9LIcJhuFbRT5agJe9EV9Y4pTSeMcsJXP xtvCKpSKQRHTTmDpgNZ906R5uVdgW8md8lkRo4+h6WQXPsAVq/CQW9tIgDvHvtR2znc+ 7huEeWkPUtduZrHvrjUIMFNA8adAuAiwBPGS2qPM/almPyQhwQZr25+MK7W0t3JHxuj/ G6IS9rP/ZsHV6tA5sNJeRFTHBRt3SqHJAcH3Ty+ZpKdY7wQr+J0RwSiNEJIenTnrYe13 Tlz0rGJGwk9MVsWCja7ieI2NeUxIIRgMWo6SlDuQKec7zlCCu5V4/yEEqSBnJDJ9Xig7 8Lxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=dACUMMrT; 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 o11-20020aa7c50b000000b0043580071f5asi3573754edq.176.2022.07.14.17.22.19; Thu, 14 Jul 2022 17:22:44 -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=20210112 header.b=dACUMMrT; 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 S240667AbiGNXqN (ORCPT + 99 others); Thu, 14 Jul 2022 19:46:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232083AbiGNXqL (ORCPT ); Thu, 14 Jul 2022 19:46:11 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75A076D9DC for ; Thu, 14 Jul 2022 16:46:08 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id oy13so6194816ejb.1 for ; Thu, 14 Jul 2022 16:46:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IyIlDk4W3kNLsc6EwzwzX2HL8L0b3ZfiT6dB513UuYM=; b=dACUMMrTnZ8StS9Wk8a47jEtPZIugOyWZ7Vcvfp0a+6cmjwB3tl+YjORYLAZSAhAwh 3YnJRiFzgbMmS9MCckIQQ0mZx8LClTRChtf2ag6hIrS4t2kZGEv8DvJvNa9R6g+adwNt 2mXDFXA039575hMyK0Edw1x7YJXtv9Z57pwp2PugxU9Z7r1LCkyTn6m6NKG4kHQWIqyc PUgZB1Ud8L74oImS9H5eMf6RDzMODarA0TP1P+g+W+IsQzQZJeF13bZeMfXcAizGYVTU FEToUDLfE/KGCVoEHLvKa1dYcBpLpTjUcyzsIA1sNTRyI4Q5sKYKY6BILfGOTseQPqfg N98A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IyIlDk4W3kNLsc6EwzwzX2HL8L0b3ZfiT6dB513UuYM=; b=DMmx9CtHqNuAtbIMLgtL8lS2t7TYXRteLOJ2A+DTu5mY5JxcCNXkKQLaKlastfUg1+ 3jO4LsNatJfBgFQnONtxApRtyVnC37eka0iUdGedHnz1iugkLzePj5e2ktXoqkAucsUn mDKECoHRIksitaw3AdcO0NyPVy5J5xoWKDW9di4OernDtCzq1k/cOUmvwDYdn621whII iGyYimonCAlkJKulOw9Er1A8nRdnOOR1tNBzLGPh65QqOHKPOMmdjbdnoXMY4+BPeJSV JkH1uocuIHTwmN/sSipMMUockKYU1vJqgO4EsO/rkY9nP3JrZynwhOPYA2hCRoBfRinr UkkA== X-Gm-Message-State: AJIora+jSOCEzbgmaNVoe34EP4ekf48RwL0cWQgYtg8ZVjPb7ozLEAT5 BpSHpq7kdt3wgl97Z1Yw9dM88WKpP0R4NmsmJoTyLw== X-Received: by 2002:a17:907:2856:b0:72b:54bd:40eb with SMTP id el22-20020a170907285600b0072b54bd40ebmr10726416ejc.542.1657842366888; Thu, 14 Jul 2022 16:46:06 -0700 (PDT) MIME-Version: 1.0 References: <20220518073232.526443-1-davidgow@google.com> <20220518073232.526443-2-davidgow@google.com> In-Reply-To: From: Daniel Latypov Date: Thu, 14 Jul 2022 16:45:55 -0700 Message-ID: Subject: Re: [PATCH 2/2] kcsan: test: Add a .kunitconfig to run KCSAN tests To: Marco Elver Cc: David Gow , Brendan Higgins , Shuah Khan , Dmitry Vyukov , KUnit Development , kasan-dev , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Thu, Jul 14, 2022 at 2:41 PM Marco Elver wrote: > > On Thu, 14 Jul 2022 at 22:23, Daniel Latypov wrote: > > > > On Thu, May 19, 2022 at 6:24 AM Marco Elver wrote: > > > I'd keep it simple for now, and remove both lines i.e. make non-strict > > > the default. It's easy to just run with --kconfig_add > > > CONFIG_KCSAN_STRICT=y, along with other variations. I know that > > > rcutoruture uses KCSAN_STRICT=y by default, so it's already getting > > > coverage there. ;-) > > > > David decided to drop the parent patch (the new QEMU config) now > > --qemu_args was merged into the kunit tree. > > Did we want a standalone v2 of this patch? > > > > Based on Marco's comments, we'd change: > > * drop CONFIG_KCSAN_STRICT=y per this comment [1] > > * drop CONFIG_KCSAN_WEAK_MEMORY per previous comments > > Then for --qemu_args changes: > > * add CONFIG_SMP=y explicitly to this file > > * update the comment to show to include --qemu_args="-smp 8" > > > > Does this sound right? > > Yes, sounds good to me, and thanks for remembering this. I'd prefer a > close-to-default config. > > > [1] Note: there's also patches in kunit now so you could do > > --kconfig_add=CONFIG_KCSAN_STRICT=n to explicitly disable it. This > > wasn't possible before. Does that change what we want for the default? > > I'd just have KCSAN_STRICT=n by default, and if desired it can be > added per kconfig_add just the same way. Ack. So concretely, so then a final result like this? $ cat kernel/kcsan/.kunitconfig # Note that the KCSAN tests need to run on an SMP setup. # Under kunit_tool, this can be done by using the x86_64-smp # qemu-based architecture: # ./tools/testing/kunit/kunit.py run --kunitconfig=kernel/kcsan --arch=x86_64 --qemu_args='-smp 8' CONFIG_KUNIT=y CONFIG_DEBUG_KERNEL=y CONFIG_KCSAN=y CONFIG_KCSAN_KUNIT_TEST=y # Need some level of concurrency to test a concurrency sanitizer. CONFIG_SMP=y # This prevents the test from timing out on many setups. Feel free to remove # (or alter) this, in conjunction with setting a different test timeout with, # for example, the --timeout kunit_tool option. CONFIG_KCSAN_REPORT_ONCE_IN_MS=100