Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp530186ybl; Wed, 29 Jan 2020 05:09:24 -0800 (PST) X-Google-Smtp-Source: APXvYqw/kJ1PPT979Wahn6+AIjwTdl+v3aVhUYk7cfeexLjCvwiny7jrj3YSgHfIIZd0LRYrCRTb X-Received: by 2002:a9d:7304:: with SMTP id e4mr14176320otk.99.1580303363898; Wed, 29 Jan 2020 05:09:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580303363; cv=none; d=google.com; s=arc-20160816; b=Q42S/9IGbo/Beq66Socb7vwFJUecDNiSmwa+j12ZDEcW+WSuuz4XsBqdZ7fl8k6YwW rxD65UIi+KZr4CnM8qsZI/+LLUaoc9MdIwjjd/9yKTAgocqUgEUIYu2pU6o9TzAZAyC1 LfRFTdAKUDfypX/mQyGQ+jj1/N1gUxp33fMijocZQ1XCPofwi2mX6PwMChGOafqPXgnB Apon6fKNwtgswwz3i6TpZdH6muHbKnb03emr8QRPfCunUxu9TbUMDAqZASiFqj9ySc8O SeRbLSQNm7tQAqhp3ZnhkqTRCSmIJsUttKxKR5xq/rnvdNCe8ChYRrMy0WKqSDfxDEgi 6Oeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=Ti8ZyKANi8j7nbulPgsnFv9qnobLhcvfN7U/r0qXW7E=; b=TeaWHnG1aFhsSJpZMWb5ivNsok05VEFOGYM87rHOcO5/opNbQjDDF6KTsbl2Vo1tRK lv08w+JlTNUSEv67BuID4zGH5cGN69rv9Nxh75ETAmleSTkdEWd4saueYjFNTxzw58oJ HnDmrVTeKuE2aTGKHmUAaEAZaX+Aqm8xKLJRySZ75akfJDhV+5gJ2Pr9W5mGG4WpQZLx e19YSd9BMUpFKAOTzQoIPOB2gzZFurzsjO/cnDjNyhv49/Rm4PtcykD8Ws9y6MQR1VPG EZ5Rhki64fkTF8acujmUXnyMAt81GoJv9Kb0Kw5gf/5ICgDh/M0KKMrL8up+V3VbO6w2 2A1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=LBahahea; 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=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w81si970107oig.107.2020.01.29.05.08.54; Wed, 29 Jan 2020 05:09:23 -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=@oracle.com header.s=corp-2019-08-05 header.b=LBahahea; 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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726692AbgA2NHj (ORCPT + 99 others); Wed, 29 Jan 2020 08:07:39 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:40160 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726069AbgA2NHj (ORCPT ); Wed, 29 Jan 2020 08:07:39 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00TCrF6V012228; Wed, 29 Jan 2020 13:06:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : in-reply-to : message-id : references : mime-version : content-type; s=corp-2019-08-05; bh=Ti8ZyKANi8j7nbulPgsnFv9qnobLhcvfN7U/r0qXW7E=; b=LBahaheaQvC3glSE4e8w07NZ4e3ZMriTaXdGJFAtdGuB2GraI+YteA2MAbZxwfBTY40l HuZOessuTUnU1X5x8qqSgOHwbIT3he0G7GFxjbucwmqWYzAg9vrCZOtPyYtgwsZaELFN 38ehsE4YZg7gSOr3FVgmNTR78IouMyz495eIB+OVXsAXUX4nhPY3Si8mx674EUqUspNb oTfEjDX3f6tkSraJ5DpYPTZ6L2R/BZPFU1ipG/iplPG/0uvRjWxioS0A3mPFCuB/5W// 4D0PM+bSYqdUSdkw5oRq90y+YnxoCvbLbLHTlrpR8hNTmumssS+LR4PhOD3m4SjzFvFO Fg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2xrdmqn5ff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jan 2020 13:06:54 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00TD2TvJ000907; Wed, 29 Jan 2020 13:06:54 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2xtmr94ng4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jan 2020 13:06:53 +0000 Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 00TD6lGS005320; Wed, 29 Jan 2020 13:06:47 GMT Received: from dhcp-10-175-173-43.vpn.oracle.com (/10.175.173.43) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 29 Jan 2020 05:06:46 -0800 Date: Wed, 29 Jan 2020 13:06:34 +0000 (GMT) From: Alan Maguire X-X-Sender: alan@dhcp-10-175-173-43.vpn.oracle.com To: Frank Rowand cc: Brendan Higgins , Luis Chamberlain , Jeff Dike , Richard Weinberger , Anton Ivanov , Arnd Bergmann , Kees Cook , Shuah Khan , Alan Maguire , Iurii Zaikin , David Gow , Andrew Morton , rppt@linux.ibm.com, Greg KH , Stephen Boyd , Logan Gunthorpe , Knut Omang , linux-um , linux-arch@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , Linux Kernel Mailing List Subject: Re: [RFC v1 0/6] kunit: create a centralized executor to dispatch all KUnit tests In-Reply-To: Message-ID: References: <20191216220555.245089-1-brendanhiggins@google.com> <20200106224022.GX11244@42.do-not-panic.com> <594b7815-0611-34ea-beb5-0642114b5d82@gmail.com> User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9514 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001290108 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9514 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001290107 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Jan 2020, Frank Rowand wrote: > On 1/28/20 1:19 AM, Brendan Higgins wrote: > > On Mon, Jan 27, 2020 at 9:40 AM Frank Rowand wrote: > >> > >> On 1/23/20 4:40 PM, Brendan Higgins wrote: > >>> Sorry for the late reply. I am still catching up from being on vacation. > >>>>> On Mon, Jan 6, 2020 at 2:40 PM Luis Chamberlain wrote: > >>>> It does beg the question if this means kunit is happy to not be a tool > >>>> to test pre basic setup stuff (terminology used in init.c, meaning prior > >>>> to running all init levels). I suspect this is the case. > >>> > >>> Not sure. I still haven't seen any cases where this is necessary, so I > >>> am not super worried about it. Regardless, I don't think this patchset > >>> really changes anything in that regard, we are moving from late_init > >>> to after late_init, so it isn't that big of a change for most use > >>> cases. > >>> > >>> Please share if you can think of some things that need to be tested in > >>> early init. > >> > >> I don't have a specific need for this right now. I had not thought about > >> how the current kunit implementation forces all kunit tests to run at a > >> specific initcall level before reading this email thread. > >> > >> I can see the value of being able to have some tests run at different > >> initcall levels to verify what functionality is available and working > >> at different points in the boot sequence. > > > > Let's cross that bridge when we get there. It should be fairly easy to > > add that functionality. > > Yes. I just wanted to add the thought to the back of your mind so that > it does not get precluded by future changes to the kunit architecture. > > > > >> But more important than early initcall levels, I do not want the > >> framework to prevent using or testing code and data that are marked > >> as '__init'. So it is important to retain a way to invoke the tests > >> while __init code and data are available, if there is also a change > >> to generally invoke the tests later. > > > > Definitely. For now that still works as long as you don't build KUnit > > as a module, but I think Alan's new patches which allow KUnit to be > > run at runtime via debugfs could cause some difficulty there. Again, > > Yes, Alan's patches are part of what triggered me thinking about the > issues I raised. > > As Brendan says, any such tests probably shouldn't be buildable as modules, but I wonder if we need to add some sort of way to ensure execution from debugfs is not allowed for such cases? Even if a test suite is builtin, it can be executed via debugfs in the patches I sent out, allowing suites to be re-run. Sounds like we need a way to control that behaviour based on the desired test suite execution environment. Say, for example, the "struct kunit_suite" definitions associated with the tests was marked as __initdata; are there any handy macros to identify it as being in the __init section? If so, we could simply avoid adding a "run" file to the debugfs representation for such suites. Failing that, perhaps we need some sort of flags field in "struct kunit_suite" to specify execution environment constraints? Thanks! Alan