Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1114506pxj; Sat, 15 May 2021 04:25:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOJGGP0eg8FasegLA0mkSNAPWn7xLEAZshokDqzS0z7eRKobwdps6vvc1JgJ5H7WNBeW+R X-Received: by 2002:a02:90cd:: with SMTP id c13mr46870828jag.18.1621077911624; Sat, 15 May 2021 04:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621077911; cv=none; d=google.com; s=arc-20160816; b=X7OPRlj9Ot0thHxPnEyfGbZghrOglm3Wn3u7xWDT/sgtR4cJ04y2PLithHTIdZV7V/ tBAHssNEu8oQ+KOHqTMjhIupHsJUmBlr7/KNNGKEBfgC0+RJgrB4wvYZsBlWh4VHhDRe RBAFzCd3Xzt4yEiB6IABoIA5s+Fm+WpRFSeesfhRPzjjQxjFlK/a1NQNjFLTwRSBAtr3 dTZRDLCPncKe4eu31HsskXBrIMfswHXrhW+MSe/S4vVKjKegGPyh6mACRjdLLmZL3+Do OJ98XlFUZdRPQbfvO+xTevC6zMNBUbuUow/LVqVfWM5LGmFbUbSo8hERRrJOsIN1/ehG J3iw== 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=tq38Icotj1wHpfaWQU7/v8RsQHtAETduCSXwxRLNNRE=; b=rkmk+KcCaaomzMrZmID6eckXftBJo/IePSSuRV5djdDcl9KEdvw2Sa4avJicucyPmd DNygJ3/hJMOvkTxW7KGrKt7Ll0AQ4s6YWjS0M16GMxPGZf9fsZQC0JQ2AACEbYC0I+r2 ayxhY2vxmGRokLdhUahRURN0oGU4YstjwORoM7rpBzl9gYTkjmvpeV1V6YuvKWAaRw2s CXI3lylkhP2SiXBbdak3UNT/5uNDPKpR+ebFb2Y8hoVROtyxpbMQZM+t8Ex3tsXSQPlB Ss9AQ1Rq05n+eWRXrx3yGOVxHHcd/dqxJLGf1LuuUWy6ewNLvmBtLiDziluJWpB5MCm9 tvGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EHHZ9yPf; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h127si8374729iof.102.2021.05.15.04.24.56; Sat, 15 May 2021 04:25:10 -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=@google.com header.s=20161025 header.b=EHHZ9yPf; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232048AbhEOIDE (ORCPT + 99 others); Sat, 15 May 2021 04:03:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230252AbhEOICt (ORCPT ); Sat, 15 May 2021 04:02:49 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2375C061756 for ; Sat, 15 May 2021 01:01:32 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id o6-20020a05600c4fc6b029015ec06d5269so822747wmq.0 for ; Sat, 15 May 2021 01:01:32 -0700 (PDT) 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=tq38Icotj1wHpfaWQU7/v8RsQHtAETduCSXwxRLNNRE=; b=EHHZ9yPfBkpAveIbuGXhw7NDbrmTVRir2upqvrUfFiilbJMenbFBQERig9Jc+x9Klh aEO5HTePBxSfjcqO8SoOdeguOo3xHqYRCm3iFyYW6nCmPARTu3mOf4Ufbxl+P9VH7kKw qWnbULWvh2al8iico/de+DPM3lTR2f35QHAsxZyzfJIZMZllApulzItRrjXQHYXkNhSJ rQ5LoIFN3kwDEcmp/hKcnJmpd2pHoJxlvgddm+ISK9cbrrT44B5s4KAiH9+bMI20uo1X R1ze2JEJtxRMkBeHnIhaGog5wTjX2XJ3Uy7PXNedUWTHNBmacc05a8UcJ+gHGWTmtlx2 wEaA== 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=tq38Icotj1wHpfaWQU7/v8RsQHtAETduCSXwxRLNNRE=; b=h2u5OGlBnaP6ATdNVR7zq869OR3c431FsDM2YsB7YnSHVKYF1wLIbcTEcZob1DcTG+ GPi2Qb2HRhsFXylV0jXxkJV7oUHaI4hQWrX2R811SK3Ci9STjJq4OLr0O/T3GRgsJNqu QAhGBn+IAJPjauNcDf9j6WRC+YLyokp7mEIB/jUH1edx9SBmGNmdaoj+1OaHhzA/kn1v 9aXQFTUS/s/I2NLXqfjCII5y1CY2XS0LW5at3/rCeWMFRc6irblOO1k6G7+0655ankVc Zi4nbFFpNFHJaRSUrzmbcalRCXDO2Vt2X7J51VjuAyDfI6B57FZES+i8cJMmyt98mB5h A7Tw== X-Gm-Message-State: AOAM533h+4edNKrEarrsCAxZ9AbxQqeo9rOo09PxFv1PQObgtwqtCqO1 VYliuups9s/9YDmGAqhD7zVonxFgqDj3W+juOR6EJw== X-Received: by 2002:a05:600c:3205:: with SMTP id r5mr53380672wmp.78.1621065691477; Sat, 15 May 2021 01:01:31 -0700 (PDT) MIME-Version: 1.0 References: <20210507213110.155492-1-brendanhiggins@google.com> <20210507213110.155492-5-brendanhiggins@google.com> In-Reply-To: <20210507213110.155492-5-brendanhiggins@google.com> From: David Gow Date: Sat, 15 May 2021 16:01:20 +0800 Message-ID: Subject: Re: [PATCH v1 4/4] Documentation: kunit: document support for QEMU in kunit_tool To: Brendan Higgins Cc: Shuah Khan , "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , Linux Kernel Mailing List , Jonathan Corbet , "open list:DOCUMENTATION" , Stephen Boyd , Kees Cook , Frank Rowand , Daniel Latypov Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000b888cb05c259c472" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000b888cb05c259c472 Content-Type: text/plain; charset="UTF-8" On Sat, May 8, 2021 at 5:31 AM Brendan Higgins wrote: > > Document QEMU support, what it does, and how to use it in kunit_tool. > > Signed-off-by: Brendan Higgins > --- This is a good start, and probably meets the minimum requirements, but I do have a number of comments and suggestions below. Cheers, -- David > Documentation/dev-tools/kunit/usage.rst | 37 +++++++++++++++++++++---- > 1 file changed, 31 insertions(+), 6 deletions(-) > > diff --git a/Documentation/dev-tools/kunit/usage.rst b/Documentation/dev-tools/kunit/usage.rst > index 650f99590df57..b74bd7c87cc20 100644 > --- a/Documentation/dev-tools/kunit/usage.rst > +++ b/Documentation/dev-tools/kunit/usage.rst > @@ -612,14 +612,39 @@ only things to be aware of when doing so. > The biggest impediment will likely be that certain KUnit features and > infrastructure may not support your target environment. For example, at this > time the KUnit Wrapper (``tools/testing/kunit/kunit.py``) does not work outside > -of UML. Unfortunately, there is no way around this. Using UML (or even just a > -particular architecture) allows us to make a lot of assumptions that make it > -possible to do things which might otherwise be impossible. > +of UML and QEMU. Unfortunately, there is no way around this. Using UML and QEMU > +(or even just a particular architecture) allows us to make a lot of assumptions > +that make it possible to do things which might otherwise be impossible. This is a bit more awkward now, and I don't think gives quite the right impression. Particularly the "Unfortunately, there is no way around this." bit: there's no fundamental reason that someone couldn't implement support for some other emulator (or even a setup which pushed to real hardware and read results over serial), it'd just take a bit of work to implement (like this patch series has done for qemu). Personally, I think it'd be easiest to simplify this section and say that kunit_tool currently only fully supports some architectures, via UML and QEMU. > > Nevertheless, all core KUnit framework features are fully supported on all > -architectures, and using them is straightforward: all you need to do is to take > -your kunitconfig, your Kconfig options for the tests you would like to run, and > -merge them into whatever config your are using for your platform. That's it! > +architectures, and using them is straightforward: Most popular architectures > +are supported directly in the KUnit Wrapper via QEMU. Currently, supported > +architectures on QEMU include: > + > +* i386 > +* x86_64 > +* arm > +* arm64 > +* alpha > +* powerpc > +* riscv > +* s390 > +* sparc > + > +In order to run KUnit tests on one of these architectures via QEMU with the > +KUnit wrapper, all you need to do is specify the flags ``--arch`` and > +``--cross_compile`` when invoking the KUnit Wrapper. For example, we could run > +the default KUnit tests on ARM in the following manner (assuming we have an ARM > +toolchain installed): > + > +.. code-block:: bash > + > + tools/testing/kunit/kunit.py run --timeout=60 --jobs=12 --arch=arm --cross_compile=arm-linux-gnueabihf- > + Is it worth also documenting the --qemu_config option here? (Particularly given the restriction on its path?) Or is that something best added to the kunit_tool page? That being said, changes to the kunit_tool page are probably worth adding as a section in the updated page: https://patchwork.kernel.org/project/linux-kselftest/patch/20210417034553.1048895-1-davidgow@google.com/ At the very least, it'd be nice to have the new QEMU-related options documented there. > +Alternatively, if you want to run your tests on real hardware or in some other > +emulation environment, all you need to do is to take your kunitconfig, your > +Kconfig options for the tests you would like to run, and merge them into > +whatever config your are using for your platform. That's it! > > For example, let's say you have the following kunitconfig: > > -- > 2.31.1.607.g51e8a6a459-goog > --000000000000b888cb05c259c472 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIPnAYJKoZIhvcNAQcCoIIPjTCCD4kCAQExDzANBglghkgBZQMEAgEFADALBg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