Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4189878ybf; Tue, 3 Mar 2020 22:24:17 -0800 (PST) X-Google-Smtp-Source: ADFU+vvUSwm4PkEtiW9Qfv/ieDQ85c1QAXdjcCFr+GZqFfevxJ15Wwlmjf7T3bBtG2dpht5Um1yJ X-Received: by 2002:a05:6830:1ca:: with SMTP id r10mr1150298ota.319.1583303057406; Tue, 03 Mar 2020 22:24:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583303057; cv=none; d=google.com; s=arc-20160816; b=oBQBNTyFLhvOjX52zUdxwUV1KENsyJ0gFCt8lLxTvUeOWNuhZ29CmYObsVjhrJz1SS 26e2OA3Ob2hKvQZU8eC4lVD7QTomE8xFm57t50xint5ApOBi0PlzwmCuhMalAkrCT3oR ov5Z43ahXwpBvBivUf8tydlm/BpDWUvYBXrLjg95demGx1oS6q9z20ELv2KWDAsDR3M9 Pcq44TcURtFmk1eTrNI3TD3MiW4MlW36KDOYovpkuOSLyB/KTh55b7qYCJybVdYr0wu9 N2RgnQ8X8oZ40t/pt17CEHosq5+CUt28zuHdAXf8CKkc+33sorCMQGE8QNhVKimpsDRq 4MdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9rIcuItk/t0HMMdxbMcrzdoYnAXfgWsnodSuFT2EgNI=; b=WQ8UxrVRE851z9lQJjYuRExOi/UUe/IoXwhpY14biQsKV2pDq5CXNMARo52qfAxtFY ibwmLW5yEDrAcaPfiRQ5qJ9eWzMTXJwfyOT33tYOTWXkpghnTo7zsO9efv4diIDPN9Vb rd+R03c2tgQuG/Y5M4aiqjuCS6dPyQ8Jqs2OAurmjRdop6gwupSwaNmF02obi8GkTab+ qH9x1RdUluvQvmbeuuu4U69W5PDHSJ86q9RMNj1DX0dOTJfO2tmfEHKHT+hZKUTBH3RG wZhOXIhqbvtYH0KHNAqqEqOI+mVNQK2hkMrwAgONa6F9qklvLs7/62tiK2cgrjuSmo8i /V0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=HBrmEvdV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si574428otq.50.2020.03.03.22.24.05; Tue, 03 Mar 2020 22:24:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=HBrmEvdV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726957AbgCDGXz (ORCPT + 99 others); Wed, 4 Mar 2020 01:23:55 -0500 Received: from mail-qv1-f65.google.com ([209.85.219.65]:33759 "EHLO mail-qv1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725271AbgCDGXz (ORCPT ); Wed, 4 Mar 2020 01:23:55 -0500 Received: by mail-qv1-f65.google.com with SMTP id p3so321328qvq.0 for ; Tue, 03 Mar 2020 22:23:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9rIcuItk/t0HMMdxbMcrzdoYnAXfgWsnodSuFT2EgNI=; b=HBrmEvdVsAvyY8mE22JX9d+oGnKWDDKD/2V00s0FfVmdNkIYiqIAa01Nj5qN2cKJ6h nfViDJBV/rE4Gvpb+txw9uCf9da1fWuhyd+pnYkoPAiok+8f06PbMA96EkEwY68frEwh gPw9k5y9txAYY832kj2oBOnU/kN6LeM0ZL27ptiE7Vle2Gl23ZBueZNnggwj8rjP3wbd slEH9NJKMWvNtAQkWozM+E81TyfLV6DPlVq1ct89+BbYjfzrROYv26Voxu0Sf3lyeDmG pYOCtuqr7NzRQHPK4jMzySI/fNcUl71dlDXTTO8J8zZF/EdXgJbW8M3gra5uEjTZSOaW 53ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9rIcuItk/t0HMMdxbMcrzdoYnAXfgWsnodSuFT2EgNI=; b=e1FOGQ4Vy0cVZugDLTq43SZSN9zev1nQu2znHXmdjgXzfQw807ym4SpZVFcKdFD9id JbJdixTdH6+CDwEfuehc1Fws7TVLvJVT70vUJFv/MNABW0N5Hd/h0jwVcqcB/eCJDL75 Yss2vYhR6Vhq+2ntJCEDq7v3tgpuvG7DCJU/jEIdsI8ySpwPRB42/82HpMq7yIP0efo6 i3kowTpQvTEFfa43zs/xei1S51mxtO1jkCq6fwkGX6WxG5O4KBroU+POhXMGY3jQg7uz XPTDRPI2SCdU5fil47HT7BiRdC1ZI1rpfNIRyiZ4+qPrmRGXe9ac7h7Ou66P3Pt0I/3B fLQA== X-Gm-Message-State: ANhLgQ1+T/IkmeQMBc4yN4MxMWZvnGdEocKrvA5qCQnaSVYwNxhiI4nw 8pOJpBLjQiB+U34RAa5yW4WTeR6i3xNjHZib9Eicag== X-Received: by 2002:a0c:f892:: with SMTP id u18mr906230qvn.159.1583303032372; Tue, 03 Mar 2020 22:23:52 -0800 (PST) MIME-Version: 1.0 References: <20200227024301.217042-1-trishalfonso@google.com> <20200227024301.217042-2-trishalfonso@google.com> In-Reply-To: From: Dmitry Vyukov Date: Wed, 4 Mar 2020 07:23:41 +0100 Message-ID: Subject: Re: [RFC PATCH 2/2] KUnit: KASAN Integration To: Patricia Alfonso Cc: Andrey Ryabinin , Brendan Higgins , David Gow , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , LKML , kasan-dev , "open list:KERNEL SELFTEST FRAMEWORK" , kunit-dev@googlegroups.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 4, 2020 at 2:26 AM Patricia Alfonso wrote: > > On Sat, Feb 29, 2020 at 10:29 PM Dmitry Vyukov wrote: > > > > On Sat, Feb 29, 2020 at 2:23 AM Patricia Alfonso > > wrote: > > > > > > > > On Thu, Feb 27, 2020 at 3:44 AM 'Patricia Alfonso' via kasan-dev > > > > wrote: > > > > > > > > > > --- a/tools/testing/kunit/kunit_kernel.py > > > > > +++ b/tools/testing/kunit/kunit_kernel.py > > > > > @@ -141,7 +141,7 @@ class LinuxSourceTree(object): > > > > > return True > > > > > > > > > > def run_kernel(self, args=[], timeout=None, build_dir=''): > > > > > - args.extend(['mem=256M']) > > > > > + args.extend(['mem=256M', 'kasan_multi_shot']) > > > > > > > > This is better done somewhere else (different default value if > > > > KASAN_TEST is enabled or something). Or overridden in the KASAN tests. > > > > Not everybody uses tools/testing/kunit/kunit_kernel.py and this seems > > > > to be a mandatory part now. This means people will always hit this, be > > > > confused, figure out they need to flip the value, and only then be > > > > able to run kunit+kasan. > > > > > > > I agree. Is the best way to do this with "bool multishot = > > > kasan_save_enable_multi_shot();" and > > > "kasan_restore_multi_shot(multishot);" inside test_kasan.c like what > > > was done in the tests before? > > > > This will fix KASAN tests, but not non-KASAN tests running under KUNIT > > and triggering KASAN reports. > > You set kasan_multi_shot for all KUNIT tests. I am reading this as > > that we don't want to abort on the first test that triggered a KASAN > > report. Or not? > > I don't think I understand the question, but let me try to explain my > thinking and see if that resonates with you. We know that the KASAN > tests will require more than one report, and we want that. For most > users, since a KASAN error can cause unexpected kernel behavior for > anything after a KASAN error, it is best for just one unexpected KASAN > error to be the only error printed to the user, unless they specify > kasan-multi-shot. The way I understand it, the way to implement this > is to use "bool multishot = kasan_save_enable_multi_shot();" and > "kasan_restore_multi_shot(multishot);" around the KASAN tests so that > kasan-multi-shot is temporarily enabled for the tests we expect > multiple reports. I assume "kasan_restore_multi_shot(multishot);" > restores the value to what the user input was so after the KASAN tests > are finished, if the user did not specify kasan-multi-shot and an > unexpected kasan error is reported, it will print the full report and > only that first one. Is this understanding correct? If you have a > better way of implementing this or a better expected behavior, I > appreciate your thoughts. Everything you say is correct. What I tried to point at is that this new behavior is different from the original behavior of your change. Initially you added kasan_multi_shot to command line for _all_ kunit tests (not just KASAN). The question is: do we want kasan_multi_shot for non-KASAN tests or not?