Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10640905imu; Thu, 6 Dec 2018 04:34:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/WMdgaAy3HEaOUQLZeCmEgPz4Bi+f/vZA+CxQREob0rMYq6BU0gTHUWwtNT4o+1JTN3IQbZ X-Received: by 2002:a63:af18:: with SMTP id w24mr24143342pge.385.1544099654648; Thu, 06 Dec 2018 04:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544099654; cv=none; d=google.com; s=arc-20160816; b=wIekhU1OaMz5SMm7pyVELDZnSJAw4yeor0DZa3Qx2Aqx0uad8m5xg2SBv8gkwXpOug qdfDLSxBDXs8XZtk4H7s914SY17vHbxJEFXtBKJwj6XxGfU7ae9Dk5h9CFZh1CbKIIzS DG+IguV2DzKZGELncoZqZODqi6A4yNxKLhAd0IFbGGQ8mjFGY2VP8zp9IjQ+tCaQkaaT DcVdB4QulymM0lBRYyiY+flIlxp7RGDOTvsppBK4BTyTEe969nVke9jEWBXkHiWaE1uo 98/i51ClLb9k1JTvp8Yxkb7++qs7RApHOfALIReFAkAquo9/abInU2hxseNMekUjiZO5 JgFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject:reply-to:dkim-signature; bh=d5twiOHOKv9Eu327OC1lH+GvfziWVxdkNiIK5+t9Ci8=; b=BRknuOZ8GXyRwy1brypIdTc6zLy56D9LheirQe0IsPtTGZFEPmus46dBsC/HRF2r6l ofpvoy77PaxWDFptwnXiMp1bppFxX3//kU5FpzDS8W3pD0YkNGA2fM414u4atbIrRllY nUoFWwccLmSXwYWjsZCCbwRHR5ZZHhNuxe+ek98ABXdW0NkR+VCzeC4xKTAriKQkyMMB NeUln6UHHNgo4nsS7SJfTUFswQLwo2CLL7qzm6DhH2cG3F/YSRB79qt1J0804aU0JZuZ s62vvoG8j5O7ZwiV8yBtrPmEO7iYuqpUwL7MGgbLBMeFy26TWn3YaquwGSVTt2+ipDF+ Jcig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=p2aXBVAh; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k20si178423pfb.215.2018.12.06.04.33.56; Thu, 06 Dec 2018 04:34:14 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=p2aXBVAh; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729537AbeLFMcz (ORCPT + 99 others); Thu, 6 Dec 2018 07:32:55 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:41492 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729409AbeLFMcz (ORCPT ); Thu, 6 Dec 2018 07:32:55 -0500 Received: from [192.168.0.21] (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E42CD595; Thu, 6 Dec 2018 13:32:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1544099571; bh=8EPqX/bcxJ4pUl68DoOSb6fQ2wMC+0TYgUztnGpilWk=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=p2aXBVAhoE5M73ougePAn37zXon5ZeSHqF/HwG/M52LX111eXvdbX9s/VCSPhh38N 6gVobRldQDfT4C7T5EKQdXV99YMAX0cew6J44Y/H326/lN1tMlHWWxzRpQ7IuehKRB 9jvcw8TXzUEhJpQ8VjCDR4bCF4nHUCYCfs66J01I= Reply-To: kieran.bingham@ideasonboard.com Subject: Re: [RFC v3 11/19] kunit: add Python libraries for handing KUnit config and kernel To: Luis Chamberlain , Brendan Higgins , Kent Overstreet , Matthew Wilcox , Eryu Guan , Eric Sandeen , jeffm@suse.com, Sasha Levin Cc: Greg KH , Kees Cook , shuah@kernel.org, Joel Stanley , mpe@ellerman.id.au, joe@perches.com, brakmo@fb.com, rostedt@goodmis.org, Tim.Bird@sony.com, khilman@baylibre.com, Julia Lawall , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Linux Kernel Mailing List , jdike@addtoit.com, richard@nod.at, linux-um@lists.infradead.org, Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Herring , dan.j.williams@intel.com, linux-nvdimm@lists.01.org, Frank Rowand , Knut Omang , Felix Guo , Petr Mladek , fsdevel@vger.kernel.org References: <20181128193636.254378-1-brendanhiggins@google.com> <20181128193636.254378-12-brendanhiggins@google.com> <841cf4ae-501b-05ae-5863-a51010709b67@ideasonboard.com> <20181204204701.GT28501@garbanzo.do-not-panic.com> From: Kieran Bingham Openpgp: preference=signencrypt Autocrypt: addr=kieran.bingham@ideasonboard.com; keydata= xsFNBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat V/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC rRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C potzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ cSAZRxqE49R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a+Xfzi9tRkwC29KMCoQOag1BhHChgqYaUH3yo UzaPwT/fY75iVI+yD0ih/e6j8qYvP8pvGwMQfrmN9YB0zB39YzCSdaUaNrWGD3iCBxg6lwSO LKeRhxxfiXCIYEf3vwOsP3YMx2JkD5doseXmWBGW1U0T/oJF+DVfKB6mv5UfsTzpVhJRgee7 4jkjqFq4qsUGxcvF2xtRkfHFpZDbRgRlVmiWkqDkT4qMA+4q1y/dWwshSKi/uwVZNycuLsz+ +OD8xPNCsMTqeUkAKfbD8xW4LCay3r/dD2ckoxRxtMD9eOAyu5wYzo/ydIPTh1QEj9SYyvp8 O0g6CpxEwyHUQtF5oh15O018z3ZLztFJKR3RD42VKVsrnNDKnoY0f4U0z7eJv2NeF8xHMuiU RCIzqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA JxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q sbsRB8KNNvVXBOVNwko86rQqF9drZuw= Organization: Ideas on Board Message-ID: Date: Thu, 6 Dec 2018 12:32:47 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181204204701.GT28501@garbanzo.do-not-panic.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Luis, On 04/12/2018 20:47, Luis Chamberlain wrote: > On Mon, Dec 03, 2018 at 03:48:15PM -0800, Brendan Higgins wrote: >> On Thu, Nov 29, 2018 at 5:54 AM Kieran Bingham >> wrote: >>> >>> Hi Brendan, >>> >>> Thanks again for this series! >>> >>> On 28/11/2018 19:36, Brendan Higgins wrote: >>>> The ultimate goal is to create minimal isolated test binaries; in the >>>> meantime we are using UML to provide the infrastructure to run tests, so >>>> define an abstract way to configure and run tests that allow us to >>>> change the context in which tests are built without affecting the user. >>>> This also makes pretty and dynamic error reporting, and a lot of other >>>> nice features easier. >>> >>> >>> I wonder if we could somehow generate a shared library object >>> 'libkernel' or 'libumlinux' from a UM configured set of headers and >>> objects so that we could create binary targets directly ? >> >> That's an interesting idea. I think it would be difficult to figure >> out exactly where to draw the line of what goes in there and what >> needs to be built specific to a test a priori. Of course, that leads >> into the biggest problem in general, needed to know what I need to >> build to test the thing that I want to test. >> >> Nevertheless, I could definitely imagine that being useful in a lot of cases. > > Whether or not we can abstract away the kernel into such a mechanism > with uml libraries is a good question worth exploring. > > Developers working upstream do modify their kernels a lot, so we'd have > to update such libraries quite a bit, but I think that's fine too. The > *real* value I think from the above suggestion would be enterprise / > mobile distros or stable kernel maintainers which have a static kernel > they need to support for a relatively *long time*, consider a 10 year > time frame. Running unit tests without qemu with uml and libraries for > respective kernels seems real worthy. I think any such library might be something generated by the kernel build system, so if someone makes substantial changes to a core component provided by the library - it can be up to them to build a corresponding userspace library as well. We could also consider to only provide *static* libraries rather than dynamic. So any one building some userspace tool / test with this would be required to compile against (the version of) the kernel they expect perhaps... - much like we expect modules to be compiled currently. And then the userspace binary would be sufficiently able to live it's life on it's own :) > The overhead for testing a unit test for said targets, *ideally*, would > just be to to reboot into the system with such libraries available, a > unit test would just look for the respective uname -r library and mimic > that kernel, much the same way enterprise distributions today rely on > having debugging symbols available to run against crash / gdb. Having > debug modules / kernel for crash requires such effort already, so this > would just be an extra layer of other prospect tests. Oh - although, yes - there are some good concepts there - but I'm a bit weary of how easy it would be to 'run' the said test against multiple kernel version libraries... there would be a lot of possible ABI conflicts perhaps. My main initial idea for a libumlinux is to provide infrastructure such as our linked-lists and other kernel formatting so that we can take kernel code directly to userspace for test and debug (assuming that there are no hardware dependencies or things that we can't mock out) I think all of this could complement kunit of course - this isn't suggesting an alternative implementation :-) > All ideaware for now, but the roadmap seems to be paving itself. I guess all great ideas start as ideaware somehow ... Now we just have to start the race to see who can tweak the kernel build system to produce an output library first :) (I won't be upset if I don't win the race) -- Regards -- Kieran