Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp372440pxu; Tue, 6 Oct 2020 08:23:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjnt7+FiN6hNZ6BMUMkrULBu23pJHISShOP5gk8OA7fy3OQLyYTvWAnIrr4VklfpvpD6Ht X-Received: by 2002:a17:906:590d:: with SMTP id h13mr24555ejq.226.1601997820532; Tue, 06 Oct 2020 08:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601997820; cv=none; d=google.com; s=arc-20160816; b=g/qePgYA4b4iflnSXjJXBlIPk1lWUGmMEl4rbZp1FT2qIgNLeSkljs6ga9h0ETvwqQ AuFOeV1MHfrbgTZfewz+y++DUEGxypkK4c9Kt0swSusSItEF4rqpkzAiwfx9kwGxwzJB 7bZWjVidHF1SSxNgoqAt15s9czE4Dg8LkwwhZ70IyONOSIn9W4c0GCmlrCUYf955v7Xz PVPeJKqWWSDfnlT9Yz9Zil7YewAEDsomotb9MflyjXS6wsazFA4eTJCh9uJ8MEVgsBN+ 2qGxEcN2lP8FwOenlisYrLXsO6VPP9R9edfHx4u5Z1d8YZvtTkteXDGicS+4BYhm5jXb bopg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=mmj7x7pJat8UNIIwIa7Sd+SRNOWKvcmn8r90tiL0s1A=; b=QWhJVy1cYAWJMvCzYPU/hWryG2yHszpJup4wpFc0f+3k6RdWH5/gFnjmXb2BfEVWsD ylEiH1LFkXejNbO9wQnXpiXXvCuXN+qKv1mtk+kGSHH5AqhR9dspiaYonwen2Mg//bzY 2EML7h8/Xwuz33hV8T6/ICH2EFZTI3dij5Rrq9whXApJLL80T/lZLsGoXFmQbpziNPrm syL4l5PJpSVtEpbiReVDC+WDLC8DVqZejqjLxkv68qZnaiM8f1H3RzDExLiOH7IHssFK Y5a1sKNiMzf43+pwlX+4Q660an5iM+yxMtN6tya1IYB6L3FgDlO1UykjAat8Gkkrr4xA tyTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=IXQwwVAi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si2652669edy.394.2020.10.06.08.23.15; Tue, 06 Oct 2020 08:23:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=IXQwwVAi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726482AbgJFPVI (ORCPT + 99 others); Tue, 6 Oct 2020 11:21:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbgJFPVG (ORCPT ); Tue, 6 Oct 2020 11:21:06 -0400 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA718C0613D2 for ; Tue, 6 Oct 2020 08:21:04 -0700 (PDT) Received: by mail-il1-x141.google.com with SMTP id o9so55528ilo.0 for ; Tue, 06 Oct 2020 08:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=mmj7x7pJat8UNIIwIa7Sd+SRNOWKvcmn8r90tiL0s1A=; b=IXQwwVAi7F6pRyGOUEQ8zaCzPCqLYGzR6fWH1AMiUEwCFiSYJ471FkLdAmCwbx2c54 ItJ9whV/AqUo+mM2d7MbaozYvKfTm/b80nFjzDVrSdzgt+4L5TPDPIQZWJW4+sAYwEpy BbucuKw8YdnI1BxGGqAvEq5di/ZoXDjLG4oTw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mmj7x7pJat8UNIIwIa7Sd+SRNOWKvcmn8r90tiL0s1A=; b=ipOsWcjku++mqjKlYBLwZpS8sbAhG7+okrnqq0q1XWquOlhCALCTPk0MTRPPflTgt3 KhjiuVQuWwrgsaCc/9Z6K3as6V8voWSdszVoBC/DefUorSUcuOs4mBfBtn8vdyD5uI8P TfSW99cO+ErqC53/tL/4A2Y041n0scCEiky/DOC+nGmbFtfIIK3HESy1AKQ7VAUs9VGi 5LBPxwsic+pUULi8Q9unvZ+tMGAPw20xN14RwArn3Tw9aU7/jCd9169/HNeHonAnVKPI ZAOSUyGUP/HrMOureB9UYynIDhPTq/nH97BYKkFDIl2e8GagcmMjslhzEn784XB4B7K6 c+mw== X-Gm-Message-State: AOAM531rOZokIdwq1lo435mL4Du6NFBh+eC2apzhNEgr7zwKq303m5vA e276aGp3Z2Ad5wHCmOt2h33+gg== X-Received: by 2002:a92:b50b:: with SMTP id f11mr4049407ile.109.1601997664092; Tue, 06 Oct 2020 08:21:04 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id z76sm349366ilf.76.2020.10.06.08.21.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Oct 2020 08:21:03 -0700 (PDT) Subject: Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters To: Kees Cook Cc: corbet@lwn.net, gregkh@linuxfoundation.org, shuah@kernel.org, rafael@kernel.org, johannes@sipsolutions.net, lenb@kernel.org, james.morse@arm.com, tony.luck@intel.com, bp@alien8.de, arve@android.com, tkjos@android.com, maco@android.com, joel@joelfernandes.org, christian@brauner.io, hridya@google.com, surenb@google.com, minyard@acm.org, arnd@arndb.de, mchehab@kernel.org, rric@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-acpi@vger.kernel.org, devel@driverdev.osuosl.org, openipmi-developer@lists.sourceforge.net, linux-edac@vger.kernel.org, Shuah Khan References: <202009260923.9A2606CFF6@keescook> <3929a023-eb7a-509c-50e1-ee72dca05191@linuxfoundation.org> <202009281612.EDC1C0078@keescook> From: Shuah Khan Message-ID: <700f0ed4-fe09-7610-b460-89b5ad08452c@linuxfoundation.org> Date: Tue, 6 Oct 2020 09:21:01 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <202009281612.EDC1C0078@keescook> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/28/20 5:13 PM, Kees Cook wrote: > On Mon, Sep 28, 2020 at 04:41:47PM -0600, Shuah Khan wrote: >> On 9/26/20 10:29 AM, Kees Cook wrote: >>> On Fri, Sep 25, 2020 at 05:47:14PM -0600, Shuah Khan wrote: >>>> 7. Verified that the test module compiles in kunit env. and test >>>> module can be loaded to run the test. >>> >>> I meant write it using KUnit interfaces (e.g. KUNIT_EXPECT*(), >>> kunit_test_suite(), etc): >>> https://www.kernel.org/doc/html/latest/dev-tools/kunit/ >>> >>> Though I see the docs are still not updated[1] to reflect the Kconfig >>> (CONFIG_foo_KUNIT_TEST) and file naming conventions (foo_kunit.c). >>> >> >> I would like to be able to run this test outside Kunit env., hence the >> choice to go with a module and kselftest script. It makes it easier to >> test as part of my workflow as opposed to doing a kunit and build and >> running it that way. > > It does -- you just load it normally like before and it prints out > everything just fine. This is how I use the lib/test_user_copy.c and > lib/test_overflow.c before/after their conversions. > I am not seeing any kunit links to either of these tests. I find the lib/test_overflow.c very hard to read. I am going to stick with what I have for now and handle conversion later. I think it might be a good idea to add tests for atomic_t and refcount_t APIS as well at some point. thanks, -- Shuah