From patchwork Thu Sep 26 18:35:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 11163285 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A70F614ED for ; Thu, 26 Sep 2019 18:53:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 373CC222C3 for ; Thu, 26 Sep 2019 18:53:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Mw1bv4Vu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 373CC222C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:42874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDYtI-00028U-41 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 26 Sep 2019 14:53:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45445) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDYmA-0002Ix-Eb for qemu-devel@nongnu.org; Thu, 26 Sep 2019 14:46:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDYm8-00053u-LS for qemu-devel@nongnu.org; Thu, 26 Sep 2019 14:46:02 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:45061) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDYm4-0004vs-QL for qemu-devel@nongnu.org; Thu, 26 Sep 2019 14:45:58 -0400 Received: by mail-wr1-x444.google.com with SMTP id r5so3612873wrm.12 for ; Thu, 26 Sep 2019 11:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VYw966nJJ2hpRmmeKqunnrmY8rWAa8RXw4YQKvCOc7g=; b=Mw1bv4VuLCrM88xdbnGcDQJUiBwq06LDSe68UHsXpiJG14S0H49HVBowg2qqgVOvH3 28luVGbSHGTwMawIg3xizUxDbW6CNLYDymap0QO3NTDAkvn6KLnAQ33Z7VvLpSWe+Ve4 LotM/sXP6e4YQ4rlOzDhtRnENSgRaht0iLEPJrG99649aJHXLBxsNLBFHmKrrwYmNSnb fzaIPQlUiFbrLn386YlL/o4Zf1r36Vul8E5Zi0AuyrCj46mwJAtz9rvk1cqFd6NLCEmY x3btdS3qFOCuNOMaqxY10/5kWcQkWEwg5iUDPQ1/oUSDgqDu+q6qiMNVkBA64liMgqZe 4tlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VYw966nJJ2hpRmmeKqunnrmY8rWAa8RXw4YQKvCOc7g=; b=E2ZdxWVXZuB/kd9RvDW6czyZ93LmnLIaTiu1FOhXBBenHZwczYVB7ULLGLWcC78Hjd ZToJTtaFjk9PmQKNWIBnPQe87KIwm+UYXhhuon7LjlPSzE88QLLEmu4aYwlK+ta6WcM1 aOH4cxyrtbZFGNDkhQjvsEr5FAAOHPUrXm7q9YUOM+P3UmDUfytwBWHlPIxwRL9Obkzc M4wKyXt+V9jEYHtNdBUHvdqoGdn9u0kAvr9VUsv6+3SQ6WCy2M+wig+p6EZK1e8FXQVJ qKEq+HNxuIRwe2LufaNXhAX0n/mmcxrqRV8Wj0OFWxLWiYI+89Jg/o5IS8NMWidqJUuF +Ljg== X-Gm-Message-State: APjAAAWwGLyWs0M0B/YLGqFgaaT61X+ogkJMwWuimxF+lVe+Mn0OFcIE 6urVxmpArHbRvvlnrOVJsXE4yQ== X-Google-Smtp-Source: APXvYqw0NppToZMt3egznkL76hyneOSOtB7G6+9Asej3K1bg4EgNcmz+ruKSgD0fTQM4fDowx1LGyA== X-Received: by 2002:a5d:4689:: with SMTP id u9mr4153825wrq.78.1569523551544; Thu, 26 Sep 2019 11:45:51 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e30sm165595wra.48.2019.09.26.11.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 11:45:48 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 169911FFA9; Thu, 26 Sep 2019 19:35:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 20/28] docs/devel: add "check-tcg" to testing.rst Date: Thu, 26 Sep 2019 19:35:45 +0100 Message-Id: <20190926183553.13895-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190926183553.13895-1-alex.bennee@linaro.org> References: <20190926183553.13895-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" It was pointed out we haven't documented the check-tcg part of the build system. Attempt to rectify that now. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index bf75675fb0..8e981e062d 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -266,6 +266,8 @@ another application on the host may have locked the file, possibly leading to a test failure. If using such devices are explicitly desired, consider adding ``locking=off`` option to disable image locking. +.. _docker-ref: + Docker based tests ================== @@ -799,3 +801,77 @@ And remove any package you want with:: If you've used ``make check-acceptance``, the Python virtual environment where Avocado is installed will be cleaned up as part of ``make check-clean``. + +Testing with "make check-tcg" +============================= + +The check-tcg tests are intended for simple smoke tests of both +linux-user and softmmu TCG functionality. However to build test +programs for guest targets you need to have cross compilers available. +If your distribution supports cross compilers you can do something as +simple as:: + + apt install gcc-aarch64-linux-gnu + +The configure script will automatically pick up their presence. +Sometimes compilers have slightly odd names so the availability of +them can be prompted by passing in the appropriate configure option +for the architecture in question, for example:: + + $(configure) --cross-cc-aarch64=aarch64-cc + +There is also a ``--cross-cc-flags-ARCH`` flag in case additional +compiler flags are needed to build for a given target. + +If you have the ability to run containers as the user you can also +take advantage of the build systems "Docker" support. It will then use +containers to build any test case for an enabled guest where there is +no system compiler available. See :ref: `_docker-ref` for details. + +Running subset of tests +----------------------- + +You can build the tests for one architecture:: + + make build-tcg-tests-$TARGET + +And run with:: + + make run-tcg-tests-$TARGET + +Adding ``V=1`` to the invocation will show the details of how to +invoke QEMU for the test which is useful for debugging tests. + +TCG test dependencies +--------------------- + +The TCG tests are deliberately very light on dependencies and are +either totally bare with minimal gcc lib support (for softmmu tests) +or just glibc (for linux-user tests). This is because getting a cross +compiler to work with additional libraries can be challenging. + +Other TCG Tests +--------------- + +There are a number of out-of-tree test suites that are used for more +extensive testing of processor features. + +KVM Unit Tests +~~~~~~~~~~~~~~ + +The KVM unit tests are designed to run as a Guest OS under KVM but +there is no reason why they can't exercise the TCG as well. It +provides a minimal OS kernel with hooks for enabling the MMU as well +as reporting test results via a special device:: + + https://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git + +Linux Test Project +~~~~~~~~~~~~~~~~~~ + +The LTP is focused on exercising the syscall interface of a Linux +kernel. It checks that syscalls behave as documented and strives to +exercise as many corner cases as possible. It is a useful test suite +to run to exercise QEMU's linux-user code:: + + https://linux-test-project.github.io/