From patchwork Fri Feb 11 16:02:59 2022 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: 541788 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp3205430imo; Fri, 11 Feb 2022 08:07:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMCft0wADykw1r1s+DFRwfHiKwj6XJSrpgz9PXlImmZifH+T9/hEmUlrGOL8coWJoW6wTM X-Received: by 2002:a25:d141:: with SMTP id i62mr2038461ybg.86.1644595620877; Fri, 11 Feb 2022 08:07:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644595620; cv=none; d=google.com; s=arc-20160816; b=VDHxVNsNF38psCsQwqNYkbIIRXF19yPQmNXxH3mYftLuZaBGAHv9jpvvR0tFiVc7F1 yiEXkhMDMMIMJ0b0TyNajB8ujIC1RIZdkwIK9J4rBfpSECorpnUFZeQiMersCoDxbzWp PQ76ZAIW10IwmrNUYl69g+dpfDmTMRwNuVSlHV2O6RBQYlb8x85z94uFUFXhn8E7tsdb om+jqyysgZaEsoyMdL210AIkphwNItwar98V16m+R6pqFeMEP76jjKBnc5r2qWdt2WUl RjsNfHPiV2R40pYrsRqZ5WDX9jG/3DAonaK1mdfpSAYltf8cBZHerBoa0BHQZkKA/0yd d4xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=95VUsInsBJkWydqDjFNp5aZcy3HHZ58V16PSGr8vvHk=; b=FHBK/GI01+qbwxnq1QuE8mBJGzwyJ5iJMp+1QvwiMOfvQbwhddYFA2lojDHvWCg19c g+4xC6vBmDMufZqrgRBe6ajhxn7OHPXuFZy3Qdx5nWPiwgJf6O3vd7IbUVJgnEq01xyT aadTvu0K5Ky6G1AiX9CQ6j8GZQmMyhWGjDxuxfOMFA2TBohHvnFGuG6h+5g9WQhFeHa6 EiRQijrtSRlD22MEFeOo+/+uawltOLLyIzSUWZSrOFu4MsvN/62vVB4N9YONi0WXA+iO yhWDvYCMHiRA0h1eHvHQRfVIWhDz0p3Vk/eLaWSoupaKyJ5LwkNXhVnB2EUw1q8KnL09 G6Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SWCLT1Rl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bd18si25891895ywb.110.2022.02.11.08.07.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Feb 2022 08:07:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SWCLT1Rl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIYRn-0008Ob-AL for patch@linaro.org; Fri, 11 Feb 2022 11:07:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIYOT-0007NK-Bn for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:36 -0500 Received: from [2a00:1450:4864:20::533] (port=38671 helo=mail-ed1-x533.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIYOK-0005AS-NO for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:29 -0500 Received: by mail-ed1-x533.google.com with SMTP id g7so1173183edb.5 for ; Fri, 11 Feb 2022 08:03:12 -0800 (PST) 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=95VUsInsBJkWydqDjFNp5aZcy3HHZ58V16PSGr8vvHk=; b=SWCLT1Rl8lgIhNBXbIwPNtQQyLjdUsyR8/Jk/fFedZuER+FRi/LHW94eot9qVlRFFG BD/rgKChTBgeH4CSD+4jaMY2v3migqWMbYxTpqiGugzhevXtnpD04EgUDoSJCFTw9Cu6 Bs4l8fPmYobg4Cucfe5dEpbH+ij9XlJCtbxnvgQ0X+fjvoNh4MtnU62Bkn4nO5txm7lq yy5NDzEPvODUQGmdBArG/UIkiOb4zZKE5cJ5ic4jw/1Y9NKaJ+oVVLVaDcnuaG5bWmzk uy2U+JQksJ/KOOy5r3hTq3gT/mMic+ua4xmMrOM/W+2GBCPeTuahEBoGCZ2+rXqurQU9 eGjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=95VUsInsBJkWydqDjFNp5aZcy3HHZ58V16PSGr8vvHk=; b=IxCpEEqx6O9fUz3XnsnSggts6zbVg6XoQHf/FiMpDOtqNX27+G1FteirlbkFdOVHHv hRXtLxzUYqnJWmyRoOBtGcl3PJbcOGw37Sf6qiB6jL+hFOgSfdFNTUzzfMdreczR0gJ6 53z7wHsTs/QTFAnXIMRX/W9vPAgrl13KLoHNoUWsDwWtM29wpQwnMuY+QTD6mqan84yR CPevNGA+3EFDUXzKlQLhFZ9vjq2rF8ZC+OifPGdDWLf5C3/lXumrS4NR4H5M06j9k7kZ mQSSZUa+V0/Km9uFJ2UyyTdcCzio4b3e6Ve3JG6AWHw+5fLEDZcKWFhjKAp9nL9rrm/n xk8w== X-Gm-Message-State: AOAM533oflu9hdfU3RzGYdm2NzSi2R3HmXg3Z6R1xY2K+qh2uSPrM7ex fEdgBAS/lqxhLCIqXqXKR8McQg== X-Received: by 2002:a05:6402:4c2:: with SMTP id n2mr2555589edw.247.1644595391359; Fri, 11 Feb 2022 08:03:11 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f16sm7703389eds.0.2022.02.11.08.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 08:03:10 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B25611FFB8; Fri, 11 Feb 2022 16:03:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 01/11] tests/docker: restore TESTS/IMAGES filtering Date: Fri, 11 Feb 2022 16:02:59 +0000 Message-Id: <20220211160309.335014-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211160309.335014-1-alex.bennee@linaro.org> References: <20220211160309.335014-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::533 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x533.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , berrange@redhat.com, Beraldo Leal , f4bug@amsat.org, Wainer dos Santos Moschetta , Alex Williamson , qemu-arm@nongnu.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This was broken in the re-factor: e86c9a64f4 ("tests/docker/Makefile.include: add a generic docker-run target") Rather than unwind the changes just apply the filters to the total set of available images and tests. That way we don't inadvertently build images only not to use them later. Signed-off-by: Alex Bennée Reported-by: Alex Williamson --- tests/docker/Makefile.include | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index f1a0c5db7a..0ec59b2193 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -8,13 +8,19 @@ COMMA := , HOST_ARCH = $(if $(ARCH),$(ARCH),$(shell uname -m)) +# These variables can be set by the user to limit the set of docker +# images and tests to a more restricted subset +TESTS ?= % +IMAGES ?= % + DOCKER_SUFFIX := .docker DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles # we don't run tests on intermediate images (used as base by another image) DOCKER_PARTIAL_IMAGES := debian10 debian11 # we don't directly build virtual images (they are used to build other images) DOCKER_VIRTUAL_IMAGES := debian-bootstrap debian-toolchain empty -DOCKER_IMAGES := $(sort $(filter-out $(DOCKER_VIRTUAL_IMAGES), $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker))))) +__IMAGES := $(sort $(filter-out $(DOCKER_VIRTUAL_IMAGES), $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker))))) +DOCKER_IMAGES := $(if $(IMAGES), $(filter $(IMAGES), $(__IMAGES)), $(__IMAGES)) DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES)) # Use a global constant ccache directory to speed up repetitive builds DOCKER_CCACHE_DIR := $$HOME/.cache/qemu-docker-ccache @@ -23,16 +29,14 @@ DOCKER_DEFAULT_REGISTRY := registry.gitlab.com/qemu-project/qemu endif DOCKER_REGISTRY := $(if $(REGISTRY),$(REGISTRY),$(DOCKER_DEFAULT_REGISTRY)) -DOCKER_TESTS := $(notdir $(shell \ - find $(SRC_PATH)/tests/docker/ -name 'test-*' -type f)) +__TESTS := $(notdir $(shell \ + find $(SRC_PATH)/tests/docker/ -name 'test-*' -type f)) +DOCKER_TESTS := $(if $(TESTS), $(filter $(TESTS), $(__TESTS)), $(__TESTS)) ENGINE := auto DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(ENGINE) -TESTS ?= % -IMAGES ?= % - CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$) DOCKER_SRC_COPY := $(BUILD_DIR)/docker-src.$(CUR_TIME) @@ -274,8 +278,8 @@ endif @echo ' TARGET_LIST=a,b,c Override target list in builds.' @echo ' EXTRA_CONFIGURE_OPTS="..."' @echo ' Extra configure options.' - @echo ' IMAGES="a b c ..": Filters which images to build or run.' - @echo ' TESTS="x y z .." Filters which tests to run (for docker-test).' + @echo ' IMAGES="a b c ..": Restrict available images to subset.' + @echo ' TESTS="x y z .." Restrict available tests to subset.' @echo ' J=[0..9]* Overrides the -jN parameter for make commands' @echo ' (default is 1)' @echo ' DEBUG=1 Stop and drop to shell in the created container' From patchwork Fri Feb 11 16:03:00 2022 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: 541787 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp3205330imo; Fri, 11 Feb 2022 08:06:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQF5iZriGyvbTCu6/dbmk4vQAewhlZd3QhvwjoZCwk+CtV3oiHYp3zDpvJOdaAMAOgLNjN X-Received: by 2002:a81:e241:: with SMTP id z1mr2393972ywl.62.1644595614846; Fri, 11 Feb 2022 08:06:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644595614; cv=none; d=google.com; s=arc-20160816; b=aTIsFM9/BMSNOn3LwPsSTFrS/Wlti3h+cHUg35h6G0mCMkgagQCGC//fM/nnGCfSMP ObsSofrtzMas4oqbjxcNV78Z9lwaCgaARL1RsUDHbUeENtZxoodwXdknhTIlACj1aG01 28RhuG8Tn9RydeYlh8ur65JSMW3hmyQxwd9/Nd2FaGpd9Xyu0Bz3YYVzx/EZ52aqmbbk Gk8OH+B58Qh+27gz3ZzUiUdI+66+7rYS25tU05davlaWSJdEG9KRz++Bdd3foSEP3bsG wPFiqPE33z1UhaHw9OnrxlE3IUOH90Q4GBTSBuJxyN3he/dxLzyz5365iSYQW0nzs+g4 qyVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=r2fP8uSb/eYaDLZpEznfNBVAbpBrXdH2X5eOjJpJH0s=; b=duuEQJ9sha8xrkbca1B8y/sy6/coTZGBWpOdjK0FZRGQu1+mZhpvWUth/uheo6LGKN LciD8VSrtrM6zjkACcG9vF3wrkzClKB0MiTvyuRlgUe5Y/gR9ImCo+0AHuxh1A0W87EU uAv/LZUxWds/VtytDaToM6r6u+VYASbHVG40MIlqkUPEL2+g81SIRe4Pz95fY6tqXTu1 hBdlxGRolvwWrOXDreGExiXEvNTAzNzwdilVJTHBdW2711wjh09O5MvBlQhgtZTzD1yl U4awnmr9z3ew2OKgYMOSJDhhmYEHDLFiQLNYHCQFd7DS8iRXZY0QpCkXb0N7IRFHFcXQ Chng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Yd1J6dL1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 20si15922388ywb.155.2022.02.11.08.06.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Feb 2022 08:06:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Yd1J6dL1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIYRi-0008MA-BM for patch@linaro.org; Fri, 11 Feb 2022 11:06:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIYOV-0007NQ-3L for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:38 -0500 Received: from [2a00:1450:4864:20::62b] (port=33683 helo=mail-ej1-x62b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIYON-0005As-9u for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:34 -0500 Received: by mail-ej1-x62b.google.com with SMTP id fy20so23742843ejc.0 for ; Fri, 11 Feb 2022 08:03:15 -0800 (PST) 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=r2fP8uSb/eYaDLZpEznfNBVAbpBrXdH2X5eOjJpJH0s=; b=Yd1J6dL19Urjlnlcorl/amncph7Pns1rQuUHGfx9YZraTHmJl4FKvKTAohB9nRsTsZ ZN9NpresTpYDiLwtSvDLENhrVXKJoRecoPF/Mnby9qM7TWeBFb3BnkbfpPHkQ0k5Ip0e +8xS+yN4eEvZvaqzCYxikkmYm6fDAFoKloR0y7YfqUSX3eNEgdJ4YXCwxb0dF+7l/01+ sGx69w/kl6eYXcVci2yHlAkXcpddtoOT1kxz1FXVM4RSb7iGgtwn4pSmmabKjI9R9dd2 cXKQnC30+/onID/+hSudPuduugnVpQccs36OtoRsE7UVqvzGBY7qgwL9tMLA/SNd1FDX dBfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r2fP8uSb/eYaDLZpEznfNBVAbpBrXdH2X5eOjJpJH0s=; b=LI0hkLL+eaLRFAOSvSaOb9dIsYJFdPMdzNzS1AlKtTobqmGm65Nita8YxEuIOkJoTj ukPv4wS1bkC6/jl2QXaz28dI4rnTpm2yK/XwOYw8ISP3eT7RNv1eA4U2oLZP0VVH+ODg +N2JICrA+PYZXWfN+evCBJHxEUmhJQ7TsdnXmIu52Cq3DM95BWCHXDbRMSp1CA63QaT+ 9BJvgaE82odm6mK5X0YHw96zCCwfZ8Vqwq/B5Dfb0LoSu7QmboAB1eGzRY1gshn7Stc9 dTyOnMLl0hmYzX4p74EXJ/dih1rlKHrwfitz+8CetkYWvH9Y97+jkrtAsS3ilZ1KTns2 VDFQ== X-Gm-Message-State: AOAM532BBsC6IOaGeJdrAD2vgPIqvltnpbySB5QZl7b7F3lDcet/eTvf oBd+QeWbtJnGh8Dk+jxxi1uhCg== X-Received: by 2002:a17:907:1610:: with SMTP id hb16mr1961695ejc.449.1644595394369; Fri, 11 Feb 2022 08:03:14 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id eq6sm6794188edb.83.2022.02.11.08.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 08:03:10 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C8D461FFBA; Fri, 11 Feb 2022 16:03:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 02/11] tests/docker: add NOUSER for alpine image Date: Fri, 11 Feb 2022 16:03:00 +0000 Message-Id: <20220211160309.335014-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211160309.335014-1-alex.bennee@linaro.org> References: <20220211160309.335014-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62b (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62b.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , berrange@redhat.com, Beraldo Leal , f4bug@amsat.org, Wainer dos Santos Moschetta , qemu-arm@nongnu.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The alpine image doesn't have a standard useradd binary so disable this convenience feature for it. Signed-off-by: Alex Bennée Reviewed-by: Daniel P. Berrangé --- tests/docker/Makefile.include | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 0ec59b2193..286f0ac5b5 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -158,6 +158,9 @@ docker-image-debian-native: DOCKER_REGISTRY= docker-image-debian10: NOUSER=1 docker-image-debian11: NOUSER=1 +# alpine has no adduser +docker-image-alpine: NOUSER=1 + # # The build rule for hexagon-cross is special in so far for most of # the time we don't want to build it. While dockers caching does avoid From patchwork Fri Feb 11 16:03:01 2022 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: 541789 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp3209273imo; Fri, 11 Feb 2022 08:10:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxm6naauqcXw1oQU39cCl1wsVCytlT7U4Ac2eQ8FLlXkIe/obZ8HLsENnThkosIAZD5FQ5A X-Received: by 2002:a25:4ed7:: with SMTP id c206mr2117922ybb.105.1644595847750; Fri, 11 Feb 2022 08:10:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644595847; cv=none; d=google.com; s=arc-20160816; b=Au6eZplUfdcaUEnaV3dDHW28VC+99s1Z7qpVHoGYh5mgkMLZgKHPrWWbplKg4B+2Jl VkwmbMODxwJDPs+93J9GdH10UCYzZ5xwJGiG2w3Hes7OkUVSzLADb1D7ETxP2I1ddtDS y1AHlYGMCTwANqGpwfZhlpGoXfU6v4zS+RgVo9LN3DscaNhtNXtXRTWethvYF8lDI4zX Eg8P6x3ZERDVtB7N14K5n6H8rEM+Enf7IsyuZFslPhKP6SQs/LZXMxLBdfNAt5vQZ/2y p1cY4g/whFcIIBmmcxseY5wie9OUMB/Bs88/RKrGQRRGn5D3ghGMgNRp8oBime9f7phG bNkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=bL3dfSbrVaSF01NjO7Q6NEgAL3df4nWWTbEBQql8YEM=; b=IAWT7pEnJJ3VzwvEcoRWNUk0iJHFcAKruLym3LStPArS9Yzq1gxvtnC6CfnJpWKB88 vNuoDYTIjQaK6kjaUTPvQxzL5FkccniRNCX/3XYzkfB/UX2FajnimMvetWe4aGH0r92n HbHOQpddCgcvslm6109rknn6ThF3JqUBj1NvS2P1rHTP3+eWox1IJANKeDU3M7bOlsei m5M7sBIrNEze74IPmQN8CiogVl/W9Tm3STq9Ccs1GRF8IXMrdZ56/jpXDv3gF5Qls+8g 0Uf/vxeih/VWnlRFgjxy6gg+hyCJlq2wWIXxZqhc+jbE4cSzVr2C2t/I1NjECi8KIdbe 8MOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SzUJ9T1B; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a2si16713827ywf.531.2022.02.11.08.10.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Feb 2022 08:10:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SzUJ9T1B; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIYVT-0005Fc-3L for patch@linaro.org; Fri, 11 Feb 2022 11:10:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIYOT-0007NH-5r for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:36 -0500 Received: from [2a00:1450:4864:20::535] (port=33470 helo=mail-ed1-x535.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIYOK-0005B4-Fc for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:26 -0500 Received: by mail-ed1-x535.google.com with SMTP id b13so17348736edn.0 for ; Fri, 11 Feb 2022 08:03:17 -0800 (PST) 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=bL3dfSbrVaSF01NjO7Q6NEgAL3df4nWWTbEBQql8YEM=; b=SzUJ9T1BZLNqrDDSMXIHEGiYL19oQ+S2Vi1srJmZb1jFft0TZNnASH52voGBG5bpBo N21+KyyAiJXSNV4ebjim9SIetZYU6WzBH5f4YmWC0VNiS+kuVph1d4y+2tPxeVuZ2S23 mDq//ecE+2ZkozRQvqT8ZVfLHuslPQ353smpLw2ffpW75QgeLiGiwAx9nJbPxg7lBhqi Lbrw0jxMDmAKAecFMrjOYtWgs+59LalJglmJzZqPMHFGZBMSyWHdCTcruMs2UTBTvJ6a pZOxDNfLsiB9jPswkS2Qceq595MvyOQHqAzlONkmW7GKzsnVg5rX5obIS9t24bkOY5La 0L7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bL3dfSbrVaSF01NjO7Q6NEgAL3df4nWWTbEBQql8YEM=; b=To+1ziKYBCvWhm4tpZDrrWW7wy9251wBFEupcYd0Nw6nV6dkqxO4zXucZSpodpZ1EV QWsoOtsa3kS9Nq7lHTF0UcdJ6ozFw7OcbLE2fJjUlFjheXEUEr+QLm6dgd2/yu7ODf7V 1GKgd4KkYmZmBpP9Vkb4rV7WUTSwrSI6uJe0dO0HlQQRPHN+PA19ALfZAPSBW2Yq7hKS IlbhUSwUNONEjMXhXojdi6zem/DSRtIpi+H+Nhj2UeXaKLvEqhc3r14ihUVsz3SW6mP3 2gRnuWzZEZ0Z2uOYa5/xN9jEAFw3kZ9bAPzMkmUHyhNMq5xGAVkp3mAH0jZGp6luR1OB vzSA== X-Gm-Message-State: AOAM532D15svMJCrkSvaOv6Lt3MEBQOrQlbAMuxlrVIkjJHXVw/tP6V6 +RMuteaLIBshHzq5gpENpbk7Iw== X-Received: by 2002:aa7:d84e:: with SMTP id f14mr2621539eds.46.1644595396073; Fri, 11 Feb 2022 08:03:16 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e18sm11586801edj.85.2022.02.11.08.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 08:03:14 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id ECC0E1FFBB; Fri, 11 Feb 2022 16:03:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 03/11] tests/lcitool: update to latest version Date: Fri, 11 Feb 2022 16:03:01 +0000 Message-Id: <20220211160309.335014-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211160309.335014-1-alex.bennee@linaro.org> References: <20220211160309.335014-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::535 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x535.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , berrange@redhat.com, Beraldo Leal , f4bug@amsat.org, Wainer dos Santos Moschetta , qemu-arm@nongnu.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We will need an update shortly for some new images. Signed-off-by: Alex Bennée --- tests/docker/dockerfiles/opensuse-leap.docker | 3 +-- tests/docker/dockerfiles/ubuntu1804.docker | 3 +-- tests/docker/dockerfiles/ubuntu2004.docker | 3 +-- tests/lcitool/libvirt-ci | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/docker/dockerfiles/opensuse-leap.docker b/tests/docker/dockerfiles/opensuse-leap.docker index 1b78d8369a..e1ad9434a3 100644 --- a/tests/docker/dockerfiles/opensuse-leap.docker +++ b/tests/docker/dockerfiles/opensuse-leap.docker @@ -127,8 +127,7 @@ RUN zypper update -y && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc -RUN pip3 install \ - meson==0.56.0 +RUN pip3 install meson==0.56.0 ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/tests/docker/dockerfiles/ubuntu1804.docker b/tests/docker/dockerfiles/ubuntu1804.docker index 699f2dfc6a..0a622b467c 100644 --- a/tests/docker/dockerfiles/ubuntu1804.docker +++ b/tests/docker/dockerfiles/ubuntu1804.docker @@ -134,8 +134,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc -RUN pip3 install \ - meson==0.56.0 +RUN pip3 install meson==0.56.0 ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker index 87513125b8..b9d06cb040 100644 --- a/tests/docker/dockerfiles/ubuntu2004.docker +++ b/tests/docker/dockerfiles/ubuntu2004.docker @@ -136,8 +136,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc -RUN pip3 install \ - meson==0.56.0 +RUN pip3 install meson==0.56.0 ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci index 6dd9b6fab1..f83b916d5e 160000 --- a/tests/lcitool/libvirt-ci +++ b/tests/lcitool/libvirt-ci @@ -1 +1 @@ -Subproject commit 6dd9b6fab1fe081b16bc975485d7a02c81ba5fbe +Subproject commit f83b916d5efa4bd33fbf4b7ea41bf6d535cc63fb From patchwork Fri Feb 11 16:03:02 2022 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: 541792 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp3211452imo; Fri, 11 Feb 2022 08:13:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwAURHUgpX+4G/QgLhc+HP19si6hY1Y+Z7a5grbkLwFA3LTmueITSeVNo+hyD9O+cZemleA X-Received: by 2002:a25:9f87:: with SMTP id u7mr2126635ybq.354.1644595998066; Fri, 11 Feb 2022 08:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644595998; cv=none; d=google.com; s=arc-20160816; b=QKtLCgDDUd6XbBrwDKzxnaOspVgijjZc0x+ghcOg117pHhq1HYok0gzTZB9D0svXN/ HBVYFHGm/rtMpfqek4EZnCfxuOr67oR9xTcFPGjIqkhcSgfds3Dk0+AU/DdPJ8mF8mt3 Bndrdw3GrcSX2vWy/m5sTgOA9uV0WjynSbjasVNE7s9rjyIIee5lBMoZ9bVSK+WcDwip JRCF2GuDtLdMnuVetQgFpejEAq/wVgXJqiP6ctPQ9uusMZ1djdH8YbMj4059fgCeI6Pk 5wZ7kGwpwVP0f0gsqLi1Dv3ig1FHw2ENEr34depNTRCBtA5oEGE+mkgnQxG3r23j8mWA Q5lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=2sWoeetDIjwXtHMyhNXgDPW/P84etH8UfOQ6AyZPyYM=; b=xu87zxknwc1n7n1VDKHiyRhXWIlqhij4F8+2MpKMw4T9DkAq+lsC4XkH05ORq3n9id t/Fhw3XRJclH3KWCaScOFBuUBppF4XJc2qJOoj2ht9nFl0TluUeRTDeFoYRIbf457Bte Q1BjrZb6FAwE4f4341ZJWMxLcAl6kvcvowmGy8PHHc5GlXVhbbXPo1y4Y/b3pZY01PZR noxzBW+gfMMWf7jzAF68RWPEeNbTSQsDaeDfFg1qhHg9gW/abM6rOz8A5u24aOALv5PB NZvpbblGBBpts85Vku4BfErZJ3Op6qtxsPmodgXuNFPU8vlDeuUFNerwIhrnL3gNJL9Z nN3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=T8FGsiTW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z13si13201521ybm.429.2022.02.11.08.13.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Feb 2022 08:13:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=T8FGsiTW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIYXt-0000jt-H9 for patch@linaro.org; Fri, 11 Feb 2022 11:13:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIYOh-0007ZI-Jr for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:47 -0500 Received: from [2a00:1450:4864:20::636] (port=37744 helo=mail-ej1-x636.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIYOe-0005BJ-6w for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:47 -0500 Received: by mail-ej1-x636.google.com with SMTP id fj5so20970565ejc.4 for ; Fri, 11 Feb 2022 08:03:18 -0800 (PST) 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=2sWoeetDIjwXtHMyhNXgDPW/P84etH8UfOQ6AyZPyYM=; b=T8FGsiTWV36NjaR4PLogzJPwBPZ95VsZveXb+cSLRvhFDuiomTScpZ0ii546YNwK/2 7LTAPY+U5NsBI07N7ZUnm0GDAZLEBhV3gn0F6BMOQfwXLpFZC9q7xeMv1U7UkqzBSX2k zqEYnTbNtvoqmH248tTsBFPzsKaaWxwrMn2lpgXd/Q/NB3DAZ4BLnH+eFysu5pugFdmd Bul3rfEH/7/UXEsWPLjZTueZAKNB9OYAyLSxCij8IgwZJvwn1KWjPnHx6Z8AwaLW5dMH L6h/EzOIZQdrno+OfBiUUPoL3P5LCVyaCZQcJ2Mjv41B65Qsi4LCcEAcKFvuQIb5qUiV aTYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2sWoeetDIjwXtHMyhNXgDPW/P84etH8UfOQ6AyZPyYM=; b=Z7moNz+o2/VD0Wop8Hf5QQtLdLSWQaWT1WHuuOndW49IFRYu/fUjRjiezVTorbubta 7qiqTYQBDllScnlP66a1Y7JazcOUAHoZA2Z7Zuf3QeODeAGGY/NSGo5owWD5NBMYRuo+ brj0NoNnEaxcDgdHRXHchOZca3LyOkVz/gw8kdAJvm2hd5KhTrgP72IQUYqC8LeMivki 4ZwYCDxWy2U5iqPLbj38x/pv45tFfuznYX+HNyjcck+3BesqbVcOi/bEkEnSFF+udgV/ 9HJ33nwpHgXzUScADpnMEGtr55qADCklMPJXtlG5aIB1bNprQLgSIZu0TaydFfQpMVla V2Gg== X-Gm-Message-State: AOAM5309PJlj2FNC5NsQmB94oetcD+aBut+TUKD1SZXv5ernfUTNjzna LS8OKUsmiK7RLaw+fRMcC87UjA== X-Received: by 2002:a17:907:984e:: with SMTP id jj14mr1915994ejc.223.1644595397076; Fri, 11 Feb 2022 08:03:17 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o3sm6269677edt.67.2022.02.11.08.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 08:03:14 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1F7D21FFBC; Fri, 11 Feb 2022 16:03:10 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 04/11] tests/docker: update debian-arm64-cross with lci-tool Date: Fri, 11 Feb 2022 16:03:02 +0000 Message-Id: <20220211160309.335014-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211160309.335014-1-alex.bennee@linaro.org> References: <20220211160309.335014-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::636 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x636.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , berrange@redhat.com, Beraldo Leal , f4bug@amsat.org, Wainer dos Santos Moschetta , qemu-arm@nongnu.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Using lci-tool update debian-arm64-cross to a Debian 11 based system. As a result we can drop debian-arm64-test-cross just for building tests. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- .gitlab-ci.d/container-cross.yml | 10 +- tests/docker/Makefile.include | 3 - .../dockerfiles/debian-arm64-cross.docker | 186 +++++++++++++++--- .../debian-arm64-test-cross.docker | 13 -- tests/lcitool/refresh | 11 ++ tests/tcg/configure.sh | 2 +- 6 files changed, 173 insertions(+), 52 deletions(-) delete mode 100644 tests/docker/dockerfiles/debian-arm64-test-cross.docker diff --git a/.gitlab-ci.d/container-cross.yml b/.gitlab-ci.d/container-cross.yml index a3b5b90552..ed620620f8 100644 --- a/.gitlab-ci.d/container-cross.yml +++ b/.gitlab-ci.d/container-cross.yml @@ -21,18 +21,10 @@ amd64-debian-user-cross-container: arm64-debian-cross-container: extends: .container_job_template - stage: containers-layer2 - needs: ['amd64-debian10-container'] + stage: containers variables: NAME: debian-arm64-cross -arm64-test-debian-cross-container: - extends: .container_job_template - stage: containers-layer2 - needs: ['amd64-debian11-container'] - variables: - NAME: debian-arm64-test-cross - armel-debian-cross-container: extends: .container_job_template stage: containers-layer2 diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 286f0ac5b5..eeee1e6bdf 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -137,7 +137,6 @@ DOCKER_PARTIAL_IMAGES += fedora endif docker-image-debian-alpha-cross: docker-image-debian10 -docker-image-debian-arm64-cross: docker-image-debian10 docker-image-debian-armel-cross: docker-image-debian10 docker-image-debian-armhf-cross: docker-image-debian10 docker-image-debian-hppa-cross: docker-image-debian10 @@ -213,14 +212,12 @@ docker-image-debian-nios2-cross: $(DOCKER_FILES_DIR)/debian-toolchain.docker \ # Specialist build images, sometimes very limited tools docker-image-debian-tricore-cross: docker-image-debian10 docker-image-debian-all-test-cross: docker-image-debian10 -docker-image-debian-arm64-test-cross: docker-image-debian11 docker-image-debian-microblaze-cross: docker-image-debian10 docker-image-debian-nios2-cross: docker-image-debian10 docker-image-debian-powerpc-test-cross: docker-image-debian11 # These images may be good enough for building tests but not for test builds DOCKER_PARTIAL_IMAGES += debian-alpha-cross -DOCKER_PARTIAL_IMAGES += debian-arm64-test-cross DOCKER_PARTIAL_IMAGES += debian-powerpc-test-cross DOCKER_PARTIAL_IMAGES += debian-hppa-cross DOCKER_PARTIAL_IMAGES += debian-m68k-cross debian-mips64-cross diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/docker/dockerfiles/debian-arm64-cross.docker index 166e24df13..589510a7be 100644 --- a/tests/docker/dockerfiles/debian-arm64-cross.docker +++ b/tests/docker/dockerfiles/debian-arm64-cross.docker @@ -1,32 +1,166 @@ +# THIS FILE WAS AUTO-GENERATED # -# Docker arm64 cross-compiler target +# $ lcitool dockerfile --layers all --cross aarch64 debian-11 qemu # -# This docker target builds on the debian Buster base image. -# -FROM qemu/debian10 +# https://gitlab.com/libvirt/libvirt-ci -# Add the foreign architecture we want and install dependencies -RUN dpkg --add-architecture arm64 -RUN apt update && \ - DEBIAN_FRONTEND=noninteractive eatmydata \ - apt install -y --no-install-recommends \ - crossbuild-essential-arm64 -RUN apt update && \ - DEBIAN_FRONTEND=noninteractive eatmydata \ - apt build-dep -yy -a arm64 --arch-only qemu +FROM docker.io/library/debian:11-slim -# Specify the cross prefix for this image (see tests/docker/common.rc) -ENV QEMU_CONFIGURE_OPTS --cross-prefix=aarch64-linux-gnu- -ENV DEF_TARGET_LIST aarch64-softmmu,aarch64-linux-user +RUN export DEBIAN_FRONTEND=noninteractive && \ + apt-get update && \ + apt-get install -y eatmydata && \ + eatmydata apt-get dist-upgrade -y && \ + eatmydata apt-get install --no-install-recommends -y \ + bash \ + bc \ + bsdextrautils \ + bzip2 \ + ca-certificates \ + ccache \ + dbus \ + debianutils \ + diffutils \ + exuberant-ctags \ + findutils \ + gcovr \ + genisoimage \ + gettext \ + git \ + hostname \ + libpcre2-dev \ + libspice-protocol-dev \ + libtest-harness-perl \ + llvm \ + locales \ + make \ + meson \ + ncat \ + ninja-build \ + openssh-client \ + perl-base \ + pkgconf \ + python3 \ + python3-numpy \ + python3-opencv \ + python3-pillow \ + python3-pip \ + python3-sphinx \ + python3-sphinx-rtd-theme \ + python3-venv \ + python3-yaml \ + rpm2cpio \ + sed \ + sparse \ + tar \ + tesseract-ocr \ + tesseract-ocr-eng \ + texinfo && \ + eatmydata apt-get autoremove -y && \ + eatmydata apt-get autoclean -y && \ + sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ + dpkg-reconfigure locales -RUN apt update && \ - DEBIAN_FRONTEND=noninteractive eatmydata \ - apt install -y --no-install-recommends \ - libbz2-dev:arm64 \ - liblzo2-dev:arm64 \ - librdmacm-dev:arm64 \ - libsnappy-dev:arm64 \ - libxen-dev:arm64 +ENV LANG "en_US.UTF-8" +ENV MAKE "/usr/bin/make" +ENV NINJA "/usr/bin/ninja" +ENV PYTHON "/usr/bin/python3" +ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" -# nettle -ENV QEMU_CONFIGURE_OPTS $QEMU_CONFIGURE_OPTS --enable-nettle +RUN export DEBIAN_FRONTEND=noninteractive && \ + dpkg --add-architecture arm64 && \ + eatmydata apt-get update && \ + eatmydata apt-get dist-upgrade -y && \ + eatmydata apt-get install --no-install-recommends -y dpkg-dev && \ + eatmydata apt-get install --no-install-recommends -y \ + g++-aarch64-linux-gnu \ + gcc-aarch64-linux-gnu \ + libaio-dev:arm64 \ + libasan5:arm64 \ + libasound2-dev:arm64 \ + libattr1-dev:arm64 \ + libbpf-dev:arm64 \ + libbrlapi-dev:arm64 \ + libbz2-dev:arm64 \ + libc6-dev:arm64 \ + libcacard-dev:arm64 \ + libcap-ng-dev:arm64 \ + libcapstone-dev:arm64 \ + libcurl4-gnutls-dev:arm64 \ + libdaxctl-dev:arm64 \ + libdrm-dev:arm64 \ + libepoxy-dev:arm64 \ + libfdt-dev:arm64 \ + libffi-dev:arm64 \ + libfuse3-dev:arm64 \ + libgbm-dev:arm64 \ + libgcrypt20-dev:arm64 \ + libglib2.0-dev:arm64 \ + libglusterfs-dev:arm64 \ + libgnutls28-dev:arm64 \ + libgtk-3-dev:arm64 \ + libibumad-dev:arm64 \ + libibverbs-dev:arm64 \ + libiscsi-dev:arm64 \ + libjemalloc-dev:arm64 \ + libjpeg62-turbo-dev:arm64 \ + liblttng-ust-dev:arm64 \ + liblzo2-dev:arm64 \ + libncursesw5-dev:arm64 \ + libnfs-dev:arm64 \ + libnuma-dev:arm64 \ + libpam0g-dev:arm64 \ + libpixman-1-dev:arm64 \ + libpng-dev:arm64 \ + libpulse-dev:arm64 \ + librbd-dev:arm64 \ + librdmacm-dev:arm64 \ + libsasl2-dev:arm64 \ + libsdl2-dev:arm64 \ + libsdl2-image-dev:arm64 \ + libseccomp-dev:arm64 \ + libselinux1-dev:arm64 \ + libslirp-dev:arm64 \ + libsnappy-dev:arm64 \ + libspice-server-dev:arm64 \ + libssh-gcrypt-dev:arm64 \ + libsystemd-dev:arm64 \ + libtasn1-6-dev:arm64 \ + libubsan1:arm64 \ + libudev-dev:arm64 \ + liburing-dev:arm64 \ + libusb-1.0-0-dev:arm64 \ + libusbredirhost-dev:arm64 \ + libvdeplug-dev:arm64 \ + libvirglrenderer-dev:arm64 \ + libvte-2.91-dev:arm64 \ + libxen-dev:arm64 \ + libzstd-dev:arm64 \ + nettle-dev:arm64 \ + systemtap-sdt-dev:arm64 \ + xfslibs-dev:arm64 \ + zlib1g-dev:arm64 && \ + eatmydata apt-get autoremove -y && \ + eatmydata apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\n\ +c = '/usr/bin/aarch64-linux-gnu-gcc'\n\ +ar = '/usr/bin/aarch64-linux-gnu-gcc-ar'\n\ +strip = '/usr/bin/aarch64-linux-gnu-strip'\n\ +pkgconfig = '/usr/bin/aarch64-linux-gnu-pkg-config'\n\ +\n\ +[host_machine]\n\ +system = 'linux'\n\ +cpu_family = 'aarch64'\n\ +cpu = 'aarch64'\n\ +endian = 'little'" > /usr/local/share/meson/cross/aarch64-linux-gnu && \ + dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \ + mkdir -p /usr/libexec/ccache-wrappers && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/aarch64-linux-gnu-c++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/aarch64-linux-gnu-cc && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/aarch64-linux-gnu-g++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/aarch64-linux-gnu-gcc + +ENV ABI "aarch64-linux-gnu" +ENV MESON_OPTS "--cross-file=aarch64-linux-gnu" +ENV QEMU_CONFIGURE_OPTS --cross-prefix=aarch64-linux-gnu- +ENV DEF_TARGET_LIST aarch64-softmmu,aarch64-linux-user diff --git a/tests/docker/dockerfiles/debian-arm64-test-cross.docker b/tests/docker/dockerfiles/debian-arm64-test-cross.docker deleted file mode 100644 index 53a9012beb..0000000000 --- a/tests/docker/dockerfiles/debian-arm64-test-cross.docker +++ /dev/null @@ -1,13 +0,0 @@ -# -# Docker arm64 cross-compiler target (tests only) -# -# This docker target builds on the debian Bullseye base image. -# -FROM qemu/debian11 - -# Add the foreign architecture we want and install dependencies -RUN dpkg --add-architecture arm64 -RUN apt update && \ - DEBIAN_FRONTEND=noninteractive eatmydata \ - apt install -y --no-install-recommends \ - crossbuild-essential-arm64 gcc-10-aarch64-linux-gnu diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh index 4ab90a310a..ada73f7045 100755 --- a/tests/lcitool/refresh +++ b/tests/lcitool/refresh @@ -76,6 +76,12 @@ ubuntu2004_tsanhack = [ "RUN sed -i 's/^const/static const/g' /usr/lib/llvm-10/lib/clang/10.0.0/include/sanitizer/tsan_interface.h\n" ] +def debian_cross_build(prefix, targets): + conf = "ENV QEMU_CONFIGURE_OPTS --cross-prefix=%s\n" % (prefix) + targets = "ENV DEF_TARGET_LIST %s\n" % (targets) + return "".join([conf, targets]) + + try: generate_dockerfile("centos8", "centos-stream-8") generate_dockerfile("fedora", "fedora-35") @@ -86,6 +92,11 @@ try: generate_dockerfile("opensuse-leap", "opensuse-leap-152") generate_dockerfile("alpine", "alpine-edge") + generate_dockerfile("debian-arm64-cross", "debian-11", + cross="aarch64", + trailer=debian_cross_build("aarch64-linux-gnu-", + "aarch64-softmmu,aarch64-linux-user")) + generate_cirrus("freebsd-12") generate_cirrus("freebsd-13") generate_cirrus("macos-11") diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index 763e9b6ad8..adc95d6a44 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -97,7 +97,7 @@ for target in $target_list; do aarch64-*) # We don't have any bigendian build tools so we only use this for AArch64 container_hosts="x86_64 aarch64" - container_image=debian-arm64-test-cross + container_image=debian-arm64-cross container_cross_cc=aarch64-linux-gnu-gcc-10 ;; alpha-*) From patchwork Fri Feb 11 16:03:03 2022 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: 541795 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp3212829imo; Fri, 11 Feb 2022 08:14:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0UZhlHSlBCPKWD0Hnf4zivQvUxvN+PnzQmZjT/eaPMShrs6bCa3miZSbmPTKI8WXH+qIs X-Received: by 2002:a81:611:: with SMTP id 17mr2351956ywg.511.1644596088063; Fri, 11 Feb 2022 08:14:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644596088; cv=none; d=google.com; s=arc-20160816; b=nCh7BQPHSHsJrbLZ+BwQ61rEXq46td3zt45wHTKvFsOXFdYIh/1HOYuBn/wUFItNm4 z5io1O3nQ3kZixK632c4AzMPYLvTgiMltxyyFdPu7nNqFvCFEZu7MC63z1NoA8QMveKG 5atXnLbbeM7uGsKUW1Iv+GjAwYgdXJg/jaowaTH82q2I9gVKD/+y+oiGDxamWvJmEw6x /zqy8DhpMf0034Xm6skTaiLRGhg9HNkch5HTiG/juxAh1ZgLuQipXcLzKwKv5pfAj/k1 GRO0YKHiNvmZdoATz2DDOGgzIzk/RPhIfsjFVesY/9ccTYU51fVxlptvdPb0h8tuBdM6 ZDIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=UTRCyQOf19YxllG63yzv6vaS7/CLeP7yg7egCWkgLEI=; b=F0VZ3NqSqBNmuOaebqthh9egBhzk6K3od+TZnsYVjs2u3sDd8cyfA9cH5/nwuFsn3m n5ckhlVBWx0odyp17JnsAiGIAjwPnii/F52gtwqQGx7Cmfq3VDRYKdzXy8GDLifP9g9m wKe/URkPulqdzBHgLKe1Lersubqc168p9WaxF7tjAw9C4pX0g5LjVFpNh2corB2+/ANL eGPGIL/kSkFAqVOkqEWhXJnubYVQwA7Ap+lEvyj9BZYQiLhnVuhDCyFhhYgbtLymqyj5 TpIeWhNvuvWqIoYCCpBKC+4QZ2C1M93DTecIXpHBIi6Sr0Ou45HpjXB/nf19q8w3Zp+u CjHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aQt3qGt2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h64si17007889ywh.94.2022.02.11.08.14.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Feb 2022 08:14:48 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aQt3qGt2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIYZL-0004ZK-Ex for patch@linaro.org; Fri, 11 Feb 2022 11:14:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIYOf-0007U4-UU for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:45 -0500 Received: from [2a00:1450:4864:20::62f] (port=41593 helo=mail-ej1-x62f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIYOb-0005BV-Pl for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:45 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a8so23890034ejc.8 for ; Fri, 11 Feb 2022 08:03:20 -0800 (PST) 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=UTRCyQOf19YxllG63yzv6vaS7/CLeP7yg7egCWkgLEI=; b=aQt3qGt2wZzIWDspxAVAE/LXEPi+mUPus0lWHPyix3z1EzgvZNOXpjgbDKSs1G/M3d rNKVqu7Rsd0bWuLZDfzx1o1EbGcN3hUT5mUhPmm7bB61HNy4mXTXDtyh8FJOC/9lWI3W rncq+Z3nqwyb8rAbUFJnxETxJRHXGY9Q0zgOlvbvsJjjXP+7gPfbJo8Wr0ov/lirK/9o SqYX2pFNcELRQqYG7v7NnEAjFyCmJvSglixR1Q/OHabuCyMl08BWtvZic4NNewQb3kf3 Kk0E6p9nxpubI4mVI+ycLnCuuaCA9wWffKvVBBh1VT+YWFj8rryVnNHq/NofkavhL2VS mG1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UTRCyQOf19YxllG63yzv6vaS7/CLeP7yg7egCWkgLEI=; b=CUfiQqvUm+tcIPxGvTeQOQOuW/q2yUhPxJr+Xam30tStxaRqwGk2jz0Z/utYAXfGLI swt+DO8+XXrDZaceKk4Unz/WXcAuU6Fydjiuo+u59PboMZcfr8EUZpVHc64ndLqu0/un XLYvRMCkjO1GKjdqevVn7ng8qpK/UUiYfWkV1A57kh5riHwYKg7XEF2uhkyeKcZUxLbs Z8LbRJJlUVkY3v10U/YxbLZ/0TbGEg8y+fSm/402oPlmCwQDCbOhuwgxBmgnWR5/IOm3 4pg7FPX1ZYj18uQ4wgkDk0hTpTWlOxFRKRkZnM3XsjMGqTE2jKlgqqpgwezHUaa+XvNS WIeA== X-Gm-Message-State: AOAM531RoR8zpvB70EAbbiEHT5giUu5yvyUJrbOg+QkF4NZ3SoYW2SZi sczT/kxf+bl0Rx8cYnpLPGOp1A== X-Received: by 2002:a17:906:29cb:: with SMTP id y11mr2053904eje.49.1644595399078; Fri, 11 Feb 2022 08:03:19 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c1sm8209726ejn.203.2022.02.11.08.03.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 08:03:14 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 343671FFBD; Fri, 11 Feb 2022 16:03:10 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 05/11] tests/docker: introduce debian-riscv64-test-cross Date: Fri, 11 Feb 2022 16:03:03 +0000 Message-Id: <20220211160309.335014-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211160309.335014-1-alex.bennee@linaro.org> References: <20220211160309.335014-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62f (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62f.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , berrange@redhat.com, Beraldo Leal , f4bug@amsat.org, Wainer dos Santos Moschetta , qemu-arm@nongnu.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Cross building QEMU for riscv64 still involves messing about with sid and ports. However for building tests we can have a slimmer compiler only container which should be more stable. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- .gitlab-ci.d/container-cross.yml | 7 +++++++ tests/docker/Makefile.include | 2 ++ .../dockerfiles/debian-riscv64-test-cross.docker | 12 ++++++++++++ tests/tcg/configure.sh | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/docker/dockerfiles/debian-riscv64-test-cross.docker diff --git a/.gitlab-ci.d/container-cross.yml b/.gitlab-ci.d/container-cross.yml index ed620620f8..65fc689a6b 100644 --- a/.gitlab-ci.d/container-cross.yml +++ b/.gitlab-ci.d/container-cross.yml @@ -131,6 +131,13 @@ riscv64-debian-cross-container: variables: NAME: debian-riscv64-cross +# we can however build TCG tests using a non-sid base +riscv64-debian-test-cross-container: + extends: .container_job_template + stage: containers-layer2 + variables: + NAME: debian-riscv64-test-cross + s390x-debian-cross-container: extends: .container_job_template stage: containers-layer2 diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index eeee1e6bdf..2ac2ea95f9 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -215,6 +215,7 @@ docker-image-debian-all-test-cross: docker-image-debian10 docker-image-debian-microblaze-cross: docker-image-debian10 docker-image-debian-nios2-cross: docker-image-debian10 docker-image-debian-powerpc-test-cross: docker-image-debian11 +docker-image-debian-riscv64-test-cross: docker-image-debian11 # These images may be good enough for building tests but not for test builds DOCKER_PARTIAL_IMAGES += debian-alpha-cross @@ -223,6 +224,7 @@ DOCKER_PARTIAL_IMAGES += debian-hppa-cross DOCKER_PARTIAL_IMAGES += debian-m68k-cross debian-mips64-cross DOCKER_PARTIAL_IMAGES += debian-microblaze-cross DOCKER_PARTIAL_IMAGES += debian-nios2-cross +DOCKER_PARTIAL_IMAGES += debian-riscv64-test-cross DOCKER_PARTIAL_IMAGES += debian-sh4-cross debian-sparc64-cross DOCKER_PARTIAL_IMAGES += debian-tricore-cross DOCKER_PARTIAL_IMAGES += debian-xtensa-cross diff --git a/tests/docker/dockerfiles/debian-riscv64-test-cross.docker b/tests/docker/dockerfiles/debian-riscv64-test-cross.docker new file mode 100644 index 0000000000..1d90901298 --- /dev/null +++ b/tests/docker/dockerfiles/debian-riscv64-test-cross.docker @@ -0,0 +1,12 @@ +# +# Docker cross-compiler target +# +# This docker target builds on the Debian Bullseye base image. +# +FROM qemu/debian11 + +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive eatmydata \ + apt install -y --no-install-recommends \ + gcc-riscv64-linux-gnu \ + libc6-dev-riscv64-cross diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index adc95d6a44..0663bd19f4 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -180,7 +180,7 @@ for target in $target_list; do ;; riscv64-*) container_hosts=x86_64 - container_image=debian-riscv64-cross + container_image=debian-riscv64-test-cross container_cross_cc=riscv64-linux-gnu-gcc ;; s390x-*) From patchwork Fri Feb 11 16:03:04 2022 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: 541793 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp3212380imo; Fri, 11 Feb 2022 08:14:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyN8xX2kKIC/RAfdBkHna4nm/Red0sH+6yRhepGUOysGFFbxt7LCxTZt3ryh7cgj+apmnwq X-Received: by 2002:a81:1084:: with SMTP id 126mr2397672ywq.231.1644596053571; Fri, 11 Feb 2022 08:14:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644596053; cv=none; d=google.com; s=arc-20160816; b=fazlS6aN2MpOoqF1iHZE+p+gyLGw4FT2ry9JrtnWRsxpTstGC9yWdePcC4wuf+Z5hB Eg1hWcCvEtyDRFKZaJg5ap3adkUTuY15PN4jp5OhhTU9fhP4QNnnisB3RcjJOinIeWZ0 no2M9H/qp/hfC3ARvAtCmRydBd/NWif77IoPe519sknaAm+KJmvjxz963BD5+z/1EbtL HL8GqjmbGq1sd85Jh5IErxS3wD3JEWPTnp0dswfx/JaMFfCFH+UI6sRs3v9w/qWv6OYS b5aI863zzObus78Aru0UBp6wVY3g/QxYEIbjjJBfFK9R8383iv+Ps0G82ynS7+851rsJ KU/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=YXsis8WuMNaivDbN1qF2633lGkq2Q3P7dp1n5KkzK9E=; b=Mn0jRA+Wbt8kPq6GkSpZs9nQFC9dw4ucteOnO2N0aCDEWHGqTNNUoGXKgYfv5nH6fi TLyvqzQ6S+nfT1GZw+hn3nTTP/YV3xhJbLzvdjNMRf1NPed+sAn2hwNIvNFZor8bU5Fs u2nthdM6dPKxInix7vnSCeZevIk/TT9+OY5VPYx77prR1XzpnUZAiIabAkwLWJ/PZiuZ LoqXMWrVB2Qwy2u8EhsjSVZ64vSIfMynZ0KRL/tm9HYCzdjm4MYnq+sXrXodqxC8VE61 NtgmjMY0zJmxxiJqa8KCX5XfRh5HIdVaaYWsIUE2SddUAKSlQcQIqNC9bduGJ6ul/d/u r2Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ilN8hcA7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u77si8062497ywu.142.2022.02.11.08.14.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Feb 2022 08:14:13 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ilN8hcA7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIYYn-0002i5-3X for patch@linaro.org; Fri, 11 Feb 2022 11:14:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIYOe-0007Rv-MW for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:44 -0500 Received: from [2a00:1450:4864:20::52f] (port=37588 helo=mail-ed1-x52f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIYOY-0005Bc-I0 for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:40 -0500 Received: by mail-ed1-x52f.google.com with SMTP id da4so17152465edb.4 for ; Fri, 11 Feb 2022 08:03:20 -0800 (PST) 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=YXsis8WuMNaivDbN1qF2633lGkq2Q3P7dp1n5KkzK9E=; b=ilN8hcA7C6Dn9hsO6+gYi5aNzONSJEkQyd/B0MMunRlCNhtrJCWKTrj1PWgk9u2K/6 DUC3TcmqhpI3K9n1873zW873pnahWrmUCPbGmw/tTvzzUFt7fcPIqLqsdbMZxvIPtFBj uO9SmDzcw5pJc9OvXjsZoQZi0YnxGeeKan9ls9FNHajbYbW7DT8xW5sfdgn9e4rEnPSW HWMRqYKF9/xMLNKeW+sTPg1giK50UvqUd5P9cdFGwfOJhaRbSRLffmWx2lEjvAAfvmis 0sY+KM4s7KrPcY/5RZm438kv0A+cMg2lHzkDFO35t5oUxO/28WwyrkYoDz3T0K+6YfPv w8uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YXsis8WuMNaivDbN1qF2633lGkq2Q3P7dp1n5KkzK9E=; b=EyUkizL2raV/Uy8KvPTYxahTu8UTkjDv3+IqXpgMEQdiYh2KxpihHrHEyxl5Og3UBp XNAlzpoovqsuCFmmdu3N51uPvwFXnQeogMssrnbB7w+QjbaCRxEB/jVz7aB38Lvcy9eB yb9nBagsx9RGmGV7TMeEX5YzcfpfW25P1jFlAvgUCGb5groEBJDKq7E6WO59RaiMXa4k hMpqK+ggOW9iBYIC13RcCB6bbUSOGtcHlOtOvwa/OJYAFrfzEuRYuivw+AAEPRbpE0fZ bB+C77Tq5nnrKHdcQrFF+2hTwbi0r/jY3cx3uDgTdI1NQlrrxhrUlTKnMHqXKb3/Ad0o luGA== X-Gm-Message-State: AOAM530MeVQ+/zjzMknP+wlO84mpzcLLymIFUsftdjSccNTEHKhrzOYD 3OpUfYkhTT9HbQU75TXlSZOGiQ== X-Received: by 2002:a50:d70e:: with SMTP id t14mr2698223edi.19.1644595399844; Fri, 11 Feb 2022 08:03:19 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id j6sm11090893edl.98.2022.02.11.08.03.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 08:03:14 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4ACC41FFBE; Fri, 11 Feb 2022 16:03:10 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 06/11] scripts/ci: add build env rules for aarch32 on aarch64 Date: Fri, 11 Feb 2022 16:03:04 +0000 Message-Id: <20220211160309.335014-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211160309.335014-1-alex.bennee@linaro.org> References: <20220211160309.335014-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52f (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52f.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , berrange@redhat.com, Beraldo Leal , f4bug@amsat.org, Wainer dos Santos Moschetta , qemu-arm@nongnu.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" At least the current crop of Aarch64 HW can support running 32 bit EL0 code. Before we can build and test we need a minimal set of packages installed. We can't use "apt build-dep" because it currently gets confused trying to keep two sets of build-deps installed at once. Instead we install a minimal set of libraries that will allow us to continue. Signed-off-by: Alex Bennée --- scripts/ci/setup/build-environment.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/scripts/ci/setup/build-environment.yml b/scripts/ci/setup/build-environment.yml index 599896cc5b..9182e0c253 100644 --- a/scripts/ci/setup/build-environment.yml +++ b/scripts/ci/setup/build-environment.yml @@ -19,6 +19,13 @@ - '((ansible_version.major == 2) and (ansible_version.minor >= 8)) or (ansible_version.major >= 3)' msg: "Unsuitable ansible version, please use version 2.8.0 or later" + - name: Add armhf foreign architecture to aarch64 hosts + command: dpkg --add-architecture armhf + when: + - ansible_facts['distribution'] == 'Ubuntu' + - ansible_facts['architecture'] == 'aarch64' + - ansible_facts['distribution_version'] == '20.04' + - name: Update apt cache / upgrade packages via apt apt: update_cache: yes @@ -115,6 +122,24 @@ - ansible_facts['distribution'] == 'Ubuntu' - ansible_facts['distribution_version'] == '20.04' + - name: Install armhf cross-compile packages to build QEMU on AArch64 Ubuntu 20.04 + package: + name: + - binutils-arm-linux-gnueabihf + - gcc-arm-linux-gnueabihf + - libblkid-dev:armhf + - libc6-dev:armhf + - libffi-dev:armhf + - libglib2.0-dev:armhf + - libmount-dev:armhf + - libpcre2-dev:armhf + - libpixman-1-dev:armhf + - zlib1g-dev:armhf + when: + - ansible_facts['distribution'] == 'Ubuntu' + - ansible_facts['distribution_version'] == '20.04' + - ansible_facts['architecture'] == 'aarch64' + - name: Install basic packages to build QEMU on EL8 dnf: # This list of packages start with tests/docker/dockerfiles/centos8.docker From patchwork Fri Feb 11 16:03:05 2022 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: 541796 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp3215054imo; Fri, 11 Feb 2022 08:17:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxU9l6/aFcPSQlcl3+JG03FbKQRsdoAgvgfoRDcgW1oAjFFgIsNfD28RDb+o2N2ybIvxVS0 X-Received: by 2002:a25:ad51:: with SMTP id l17mr2076515ybe.20.1644596244459; Fri, 11 Feb 2022 08:17:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644596244; cv=none; d=google.com; s=arc-20160816; b=PPtGoBhSP7Cobx0a1stM92fHj6yn9LMwClqRXGbnKuQsX++5lEFga8pbpB9CWpYDPS S2gl9b/VKIffgdn1CIumN6LKooMZh1yE4bjTik3gaDvizbifYr/eCS+GIv0aT5sCO2vK MQCWc1Gf1NcX+aX0Ldv/60cd0BBbfFIguJJG2QSxN/vKmlfHsC27b/iLqtaZCF9h2sT7 B37g/Sf9wgd0r7AURuCkpSudRHiyPOFkyNsFQMk+I1ZwDMmgyCyYtJ8qLvseODLmwOgC 6K6OTCEtSB7XuvOWcy00WiZ/ahcxEERYJWUKy8vsPISbxjvYK5Ylo2Kdo4vBV3yIIeJ9 /Vgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=X17x3KU6beheAfejIvxhbu9cw9YerrgA4KVgbGt68ew=; b=qX31KyBJ9wg2MZfO6SY8GyY85NNStTl9WCfPJBSTSfEiHnYwn2KjKeP8FjPWMil8Ic IJMYlZDef3dNmLVqPXdfIoa90VuGqNw9yJ5v8RnQQbZr107QXz7/WGwqoPXnWnPXsdAL bfN8dhyyWL/RIfFWJiNJyITWtuf1BgUBD81s2oSE8iTFrwTFZboEd+t4XuHd/ToUm4Vx +46DaBBu4CKA4kBfIDfCZvxUlgHH6YW8SpjK2EOQgY0mpxW2E79KDmabp0xdSUg+4/fK BZTznayNHixcJUPKJMoR0bsuvBhczmh3kjWagVpVQOyGee10kIcQKIyauxOOtZ1GXmFb cFyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rQmg7Cbg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o19si8824644ybg.705.2022.02.11.08.17.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Feb 2022 08:17:24 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rQmg7Cbg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIYbr-0001Gy-W9 for patch@linaro.org; Fri, 11 Feb 2022 11:17:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIYOe-0007S0-Ni for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:44 -0500 Received: from [2a00:1450:4864:20::630] (port=43563 helo=mail-ej1-x630.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIYOY-0005C1-K1 for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:41 -0500 Received: by mail-ej1-x630.google.com with SMTP id d10so23858557eje.10 for ; Fri, 11 Feb 2022 08:03:24 -0800 (PST) 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=X17x3KU6beheAfejIvxhbu9cw9YerrgA4KVgbGt68ew=; b=rQmg7CbgBRutRfk8t0mnqag3PVCdqByjAuGlk1Z3EC8ea4WVRFABvONDmMUghYTsqf SuPwDKh4xU0ED9YGZAweUC14MdJmAJSyp+UQ30uzanlR9Dkpec6UHdR+x2tyzPmjm4dJ sjebIYkddasXE5iCN4CFMI8PeSKigpK7z92pa3y0AjFZ4X1kttTXsgw8s1t9oVj6sHnt AbFqnlbuVCF9uFxc5oPzhn9wYW1uYOg4emjap/DltWxFM1RIlu6kGR50xL0qsND4mYf2 hgUJ/OCwuVp+OIK10YixD+Znfx0ceNA6v+ScH2bpTFg1hZPFb5IOOoxcXtZnd2U0mSt5 kxYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X17x3KU6beheAfejIvxhbu9cw9YerrgA4KVgbGt68ew=; b=e8QcwvX38kKa3O6mRDKxVN6rTY5dzwqZoR2Pp7hP13b+HeWVlX+ECV/mEH5+uanvh0 thOsPYe04MlPY1laCwGAkWyZ7nszSP0XgFJ+9OB2tiVyLM8o/ouldWwfGqnHM9yJXjCW Ln2eY8hKb0+qmoMwW+n8IyPaSZ+Eut5c6Jy8L6GHMngpnv9kW0z3rxM8bUoqnzJqqCuX 5X9liwURWEQyDpE9QLIvTDAjV/ZL3qjsTQaecdi9Y0tWFsfTR0rzKuE94172leQAdz5x TkMaPVLCLKupuUzhw4xyRY9pPTTDNAANaAfg2zX81AaZI/w0tydNEEsYt0gVxxPuh0Co ht3w== X-Gm-Message-State: AOAM531tQhJYvM0xruXY7yeNkp56EExJMPbNOobbHj1ldXvhGun5FcZ4 1IczkeozHaRquXzXi/rmhrZVLA== X-Received: by 2002:a17:907:1c01:: with SMTP id nc1mr2021536ejc.322.1644595402976; Fri, 11 Feb 2022 08:03:22 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id gk6sm5210778ejb.159.2022.02.11.08.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 08:03:14 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6B2FF1FFBF; Fri, 11 Feb 2022 16:03:10 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 07/11] scripts/ci: allow for a secondary runner Date: Fri, 11 Feb 2022 16:03:05 +0000 Message-Id: <20220211160309.335014-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211160309.335014-1-alex.bennee@linaro.org> References: <20220211160309.335014-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::630 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x630.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , berrange@redhat.com, Beraldo Leal , f4bug@amsat.org, Wainer dos Santos Moschetta , qemu-arm@nongnu.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Some HW can run multiple architecture profiles so we can install a secondary runner to build and run tests for those profiles. This allows setting up secondary service. [AJB: this is a fairly ugly hack, I'm sure this could be expressed in a neater way] Signed-off-by: Alex Bennée --- scripts/ci/setup/gitlab-runner.yml | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/scripts/ci/setup/gitlab-runner.yml b/scripts/ci/setup/gitlab-runner.yml index 1127db516f..19bfd68f7e 100644 --- a/scripts/ci/setup/gitlab-runner.yml +++ b/scripts/ci/setup/gitlab-runner.yml @@ -69,3 +69,37 @@ name: gitlab-runner state: started enabled: yes + + - name: Download secondary gitlab-runner + get_url: + dest: /usr/local/bin/gitlab-runner-arm + url: "https://s3.amazonaws.com/gitlab-runner-downloads/v{{ gitlab_runner_version }}/binaries/gitlab-runner-{{ gitlab_runner_os }}-arm" + owner: gitlab-runner + group: gitlab-runner + mode: u=rwx,g=rwx,o=rx + when: + - ansible_facts['distribution'] == 'Ubuntu' + - ansible_facts['architecture'] == 'aarch64' + - ansible_facts['distribution_version'] == '20.04' + + - name: Register secondary gitlab-runner + command: "/usr/local/bin/gitlab-runner-arm register --non-interactive --url {{ gitlab_runner_server_url }} --registration-token {{ gitlab_runner_registration_token }} --executor shell --tag-list aarch32,{{ ansible_facts[\"distribution\"]|lower }}_{{ ansible_facts[\"distribution_version\"] }} --description '{{ ansible_facts[\"distribution\"] }} {{ ansible_facts[\"distribution_version\"] }} {{ ansible_facts[\"architecture\"] }} ({{ ansible_facts[\"os_family\"] }})'" + + - name: Install the secondary gitlab-runner service using its own functionality + command: /usr/local/bin/gitlab-runner-arm install --user gitlab-runner --working-directory /home/gitlab-runner/arm -n gitlab-runner-arm + register: gitlab_runner_install_service_result + failed_when: "gitlab_runner_install_service_result.rc != 0 and \"already exists\" not in gitlab_runner_install_service_result.stderr" + when: + - ansible_facts['distribution'] == 'Ubuntu' + - ansible_facts['architecture'] == 'aarch64' + - ansible_facts['distribution_version'] == '20.04' + + - name: Enable the secondary gitlab-runner service + service: + name: gitlab-runner-arm + state: started + enabled: yes + when: + - ansible_facts['distribution'] == 'Ubuntu' + - ansible_facts['architecture'] == 'aarch64' + - ansible_facts['distribution_version'] == '20.04' From patchwork Fri Feb 11 16:03:06 2022 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: 541786 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp3205031imo; Fri, 11 Feb 2022 08:06:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsayCMx5J9pi/ZI59JBo8CmkIAIrzzhreTPoVtIVfW6Fqgf5mF44+RjZZHBSFR44Nafh3F X-Received: by 2002:a05:622a:612:: with SMTP id z18mr1551789qta.517.1644595596396; Fri, 11 Feb 2022 08:06:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644595596; cv=none; d=google.com; s=arc-20160816; b=d6C6Ue0voItskA4gBya2LjSJgOxqdq02+bKfrgkNxxyImiRfGWkzUTMULF5krVQpfh P92YKms7dsXlMH3VX42+2lN6nyP7ofQNahXUEhRv6q05VYexFgv/hCXozvRRDaIGUx1y lNhy3wac/HKbhPETuuqVxJ3VhHMx0lL3Y2bIsm6XqDunur/K9y36srLXGjLXxEuAti37 3fTSZmXXkwwjVkQ+EWkX4vvW+DI87I6ek/bJyzix6zl6j8P3cgaIfpf5uWG0SnP+WFPv tJNpuGUwDShDz78auQKR8hWI+GcG4iLryZW39P6mUK3S/0IZPBm++4pgjUpqGNfJxBKN 6Z6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=VXFQUYvPfMrD6ElMMpTu3MsKFqVvKrPYQNG+wDG/hYw=; b=hKCbTBuBhUqp7LcrbN/LPZUM5AmLYtpJGk6OQHQ4eFtsg33zl5G4Fb8BJxC2XRWZEZ ku3rSkGhY++1x2eGCEPB5EcMmHvX1LULqQ5kfl/DJeiSj+4NF6bMDhSGlzoIZZu579DT lTI7sqh7jxYIPZ4zI/eyxnBh0alGF1O+6FrLCDzE7ES0CpYTgWuqOy6waqf177kRwfy5 msZgUUQKQSQRmN0nfWNCqOsW27FThL451WB1jH1RPCHGzry9b0b3a1+4ku49D3TWYwjU Q+st4qy2WceI49xi2fSBN4Lg5YZ55AEs2jmWoSEt0gtZsc9+39sT4k/rDuknctgRdgGF kt4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xg+l1GBx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q8si1530383ybo.49.2022.02.11.08.06.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Feb 2022 08:06:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xg+l1GBx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIYRP-0007Tc-To for patch@linaro.org; Fri, 11 Feb 2022 11:06:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIYOY-0007OT-TU for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:39 -0500 Received: from [2a00:1450:4864:20::529] (port=45608 helo=mail-ed1-x529.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIYOS-0005Bp-C6 for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:35 -0500 Received: by mail-ed1-x529.google.com with SMTP id ch26so17055927edb.12 for ; Fri, 11 Feb 2022 08:03:22 -0800 (PST) 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=VXFQUYvPfMrD6ElMMpTu3MsKFqVvKrPYQNG+wDG/hYw=; b=xg+l1GBxMTGg1zmz+xor1Tl8qimil1O8lmbvpHU6pwO3U3kVco+GlOhWwBjzEvWARw WXWeBUYNQJ/yZOeFq8MYgodwW1EWIZ1a+zrDMydjr1keAshCHZJEKCNj8Ofm+QEnHqXl LgC8QXYfEkBMg/di45dtQg/TKwimO3ipsT3trl0pvl41l1ZAx39KAcPxrxKjotCmb/G9 6U1+En7/gyhhqOzq+dWCzE112SKlIfiJSJCnN4o684kAqRWjw61n7sIakd/PMQFJWTdr 3hXl8Sz0U9hgIFJO1tWBomnnjbzzoFkoDE7W43ZX36TJLjkDTE0fUbLdsNO8C6b0CFeh PWBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VXFQUYvPfMrD6ElMMpTu3MsKFqVvKrPYQNG+wDG/hYw=; b=vvwyWmUYetml/C3226SCeWjP2+YWwETmEaahZZ1+7b9c0cAqieoFQ0KDWaJxZObTln 73murts2Hxsbp40MnvUzS3GjUT86nt6IO/Q1nP8FKz1VQqpvmV8Q66EMSCAWK46sT32r CdHc7V2XbdQb7wbnsyT93hTnG1jjQpTbWhCxrK1X+pyLIKVlOUDFVcrI2UNw7psvgk57 zMAHsal2GV8Ojkv+s5PYid61vN2pwnSaq7r2LfPVcfHMYzYWmYTqn4LUQ6diiQQeoqGr vlSkgi8p+DzJ90TdpNNhrmjJ++QLWGwWVokevuMGP6qOKGB999ETDJ4eq41QHQOUTVEO mj4A== X-Gm-Message-State: AOAM533bWv2hlkCwlDk4Sn73Eib5+93VDvFNuDIne9c0KpUc3aw8uZMh C6YkWTj/koGroHG4z2dqEGjvhw== X-Received: by 2002:a05:6402:4392:: with SMTP id o18mr2691493edc.338.1644595402014; Fri, 11 Feb 2022 08:03:22 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e8sm1499948ejm.117.2022.02.11.08.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 08:03:14 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7AF251FFC0; Fri, 11 Feb 2022 16:03:10 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 08/11] gitlab: add a new aarch32 custom runner definition Date: Fri, 11 Feb 2022 16:03:06 +0000 Message-Id: <20220211160309.335014-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211160309.335014-1-alex.bennee@linaro.org> References: <20220211160309.335014-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::529 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x529.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , berrange@redhat.com, Beraldo Leal , f4bug@amsat.org, Wainer dos Santos Moschetta , qemu-arm@nongnu.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Although running on aarch64 hardware we can still target 32bit builds with a cross compiler and run the resulting binaries. Signed-off-by: Alex Bennée --- docs/devel/ci-jobs.rst.inc | 7 ++++++ .../custom-runners/ubuntu-20.40-aarch32.yml | 23 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .gitlab-ci.d/custom-runners/ubuntu-20.40-aarch32.yml diff --git a/docs/devel/ci-jobs.rst.inc b/docs/devel/ci-jobs.rst.inc index db3f571d5f..92e25872aa 100644 --- a/docs/devel/ci-jobs.rst.inc +++ b/docs/devel/ci-jobs.rst.inc @@ -44,6 +44,13 @@ If you've got access to an aarch64 host that can be used as a gitlab-CI runner, you can set this variable to enable the tests that require this kind of host. The runner should be tagged with "aarch64". +AARCH32_RUNNER_AVAILABLE +~~~~~~~~~~~~~~~~~~~~~~~~ +If you've got access to an armhf host or an arch64 host that can run +aarch32 EL0 code to be used as a gitlab-CI runner, you can set this +variable to enable the tests that require this kind of host. The +runner should be tagged with "aarch32". + S390X_RUNNER_AVAILABLE ~~~~~~~~~~~~~~~~~~~~~~ If you've got access to an IBM Z host that can be used as a gitlab-CI diff --git a/.gitlab-ci.d/custom-runners/ubuntu-20.40-aarch32.yml b/.gitlab-ci.d/custom-runners/ubuntu-20.40-aarch32.yml new file mode 100644 index 0000000000..9c589bc4cf --- /dev/null +++ b/.gitlab-ci.d/custom-runners/ubuntu-20.40-aarch32.yml @@ -0,0 +1,23 @@ +# All ubuntu-20.04 jobs should run successfully in an environment +# setup by the scripts/ci/setup/qemu/build-environment.yml task +# "Install basic packages to build QEMU on Ubuntu 18.04/20.04" + +ubuntu-20.04-aarch32-all: + needs: [] + stage: build + tags: + - ubuntu_20.04 + - aarch32 + rules: + - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/' + when: manual + allow_failure: true + - if: "$AARCH32_RUNNER_AVAILABLE" + when: manual + allow_failure: true + script: + - mkdir build + - cd build + - ../configure --cross-prefix=arm-linux-gnueabihf- + - make --output-sync -j`nproc` + - make --output-sync -j`nproc` check V=1 From patchwork Fri Feb 11 16:03:07 2022 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: 541790 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp3210131imo; Fri, 11 Feb 2022 08:11:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+qREABh7NC0BP7+8vD8izMFJoRXRh+LdUODLCoqh04pU3xxzHy4BnELgyN7y12SBMoPHS X-Received: by 2002:a0d:dcc1:: with SMTP id f184mr2471277ywe.41.1644595905827; Fri, 11 Feb 2022 08:11:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644595905; cv=none; d=google.com; s=arc-20160816; b=p7gcZQIDx8qqK8mZ+uT+hYZuswxCsz9A/qpzTCIRVCxZbBo0uKVjv1f+Bqdwhfjkd3 ZRL98CqSu+z6tE42E8HJvah3tpsQd0I9Qg3j/GxCK1Cz1Kb8hgzL0PlmbfbZHs2dxTyQ V8Lyv7r3tomnYjLl8H3jbVNKhitFdFWxIMmS4RYVNYsj9/szU2vSQnvIfthSwL52jvFF dS/D8Bp24p+wox1ZH/GxxpqD44tPx0mhf1w72R1RgziW6aB5grJBJHJJh0e8itiRY5XL bgcwTE23dFUv2WezjGv0pq9D5FPQSAaAliWPw9wuoMEsa1mPRBnNvChtDxK3rncLC1Gi Jxsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=nsg6iN0TxVUYy9wfwn7Nl3aLnZ8BcKzvxieM1PeZndE=; b=rKSwOCgQWbZloi55btLsWCONJO6S6GxOpEaAMssPOfBHIxYA0ekqtD4j8tfvkwqora vbM6IHY4tgYUTe0R+sr1UhA6RhZ99TmP1AbIlzOD5t6H/rq30Gz9TsZCkZgltG+t6B8S 2sN6rk0p+GUYnVdSNSc5FFZjDyrJry9LKX4RwOQXR5OURcnBqnw7YQdiOXNmxVRk/HiO hUTyNWB1Xz06h4KpFCcXooqmAPeoO5SF9DFDJl0DkyyL4Nrc9XZV0i+GZpnF1fwlZltK sKXokDBj3OVTBZC1UA9wskbMLI9Ynt4p6ERngx0ThODP3kDhMfzZBIFTbA03HP9MKkXP 8GYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="bw2Y0G/k"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g63si16463295ywg.233.2022.02.11.08.11.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Feb 2022 08:11:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="bw2Y0G/k"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIYWP-0006EI-Az for patch@linaro.org; Fri, 11 Feb 2022 11:11:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIYOY-0007OX-VJ for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:39 -0500 Received: from [2a00:1450:4864:20::52c] (port=43605 helo=mail-ed1-x52c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIYOT-0005CB-2t for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:37 -0500 Received: by mail-ed1-x52c.google.com with SMTP id y17so15254900edd.10 for ; Fri, 11 Feb 2022 08:03:25 -0800 (PST) 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=nsg6iN0TxVUYy9wfwn7Nl3aLnZ8BcKzvxieM1PeZndE=; b=bw2Y0G/k2cn0jwtqkvcOji9Kq7kj2TMbIA1WFfe+4Sg95zOC8Rm23qUSUj7m+/KXr6 tXLROioQVZX256IXVcVhJ/qxfhxEWnYEjdk97Pqq9BkDg9gb+Q3McuzgbQ6TzaIqbVak YXu45F4FFnxB8tU4AJ3DSbtP3D0x7B/SiAE+Zv8KWX6cdn7t6unZ26WIzm7D5Kufer2t 4Sxh21Yh2b7goNFD/r9VAKOF8wzxtb/VPC3mNcRVDiUxsJQr5qf9aktGrsXYkkHtfgom i3mI24eRhrLV2Va5HczppIrHjnWFYtIsdzMpFYfDjobjnZQ9Zx74a8cCizlAfRMFcDIj RPTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nsg6iN0TxVUYy9wfwn7Nl3aLnZ8BcKzvxieM1PeZndE=; b=GFAelVX6IMsbkEvdPQBEDkj05Ys48sWNariapTNoo4+thNksW3KW3V4ifQb9PZJKHi fGMHi+HZtvA3CvWt9pUHGdrJJg2Aar/6me6qcWnYhV4QQdYEMVlFIWhlg+G6eVyAgoOP FzBMMR23jopkqEZC2jZlvH2JetL3DYPlkqMln9sXDMLe7G6ybQYcUQvmEboFuJ1MNgkG DkK4m50F2zkglZKKU5Zpjh+Rz53hKwOanM44popvrbUcZUfqLCbSE1kFDE5KpQB0Uz56 4txHuNVQA/jNaFPpWWvegYkwBZtGzDxua2QbwhP8SahM4tWGGoMEI3uJYnzBNRidEWEX rdDA== X-Gm-Message-State: AOAM532fTYb/2kN1u27iS0GKxzanFFQPaBGYgxBV+/I/lkCL2GNtv2nN 4CHiCC5x4xwHJXfsdBEgwohwHg== X-Received: by 2002:a05:6402:1a52:: with SMTP id bf18mr2647127edb.428.1644595404313; Fri, 11 Feb 2022 08:03:24 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c10sm6891142edr.6.2022.02.11.08.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 08:03:23 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 92E321FFC1; Fri, 11 Feb 2022 16:03:10 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 09/11] tests/tcg: build sha1-vector with O3 and compare Date: Fri, 11 Feb 2022 16:03:07 +0000 Message-Id: <20220211160309.335014-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211160309.335014-1-alex.bennee@linaro.org> References: <20220211160309.335014-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52c (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52c.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Peter Maydell , berrange@redhat.com, f4bug@amsat.org, qemu-arm@nongnu.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The aim of this is to test code generation for vectorised operations. Unfortunately gcc struggles to do much with the messy sha1 code (try -fopt-info-vec-missed to see why). However it's better than nothing. We assume the non-vectorised output is gold and baring compiler bugs the outputs should match. Signed-off-by: Alex Bennée Message-Id: <20220202191242.652607-3-alex.bennee@linaro.org> Reviewed-by: Richard Henderson --- tests/tcg/aarch64/Makefile.target | 10 ++++++++++ tests/tcg/arm/Makefile.target | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target index 1d967901bd..df3f8e9438 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -50,6 +50,16 @@ sysregs: CFLAGS+=-march=armv8.1-a+sve AARCH64_TESTS += sve-ioctls sve-ioctls: CFLAGS+=-march=armv8.1-a+sve +# Vector SHA1 +sha1-vector: CFLAGS=-O3 +sha1-vector: sha1.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) +run-sha1-vector: sha1-vector run-sha1 + $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<, "$< on $(TARGET_NAME)") + $(call diff-out, sha1-vector, sha1.out) + +TESTS += sha1-vector + ifneq ($(HAVE_GDB_BIN),) GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index f509d823d4..2dc94931c3 100644 --- a/tests/tcg/arm/Makefile.target +++ b/tests/tcg/arm/Makefile.target @@ -70,6 +70,15 @@ endif ARM_TESTS += commpage +# Vector SHA1 +sha1-vector: CFLAGS=-O3 +sha1-vector: sha1.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) +run-sha1-vector: sha1-vector run-sha1 + $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<, "$< on $(TARGET_NAME)") + $(call diff-out, sha1-vector, sha1.out) + +ARM_TESTS += sha1-vector TESTS += $(ARM_TESTS) # On ARM Linux only supports 4k pages From patchwork Fri Feb 11 16:03:08 2022 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: 541791 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp3210748imo; Fri, 11 Feb 2022 08:12:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrmFvPD8rfRrcuJwOJfnNkQLW+/8gGQ88k+m9LsM71wXqS3vovJuRNe99cwnmoRdtW6Sgv X-Received: by 2002:a5b:b52:: with SMTP id b18mr2113273ybr.208.1644595951784; Fri, 11 Feb 2022 08:12:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644595951; cv=none; d=google.com; s=arc-20160816; b=YDu6ukfB7y+oNkMAMvRg6ejx5I8+/glfyButjmP8dmjZ7Xj6ckSffqH56GRnbvVlY4 qnf7AfvkNv7kls+rrANO3WsECxZNaMEX2kx8kd5ir9ZSZecSXehKfK98/0l6Z29x+WRR SYf2/cur4LTZxfBG6meSyGmDiY9ChGh8GkTVxz1jvApXW4S5sSyKTwa1c76a7KFBMQFh iyEIuSE/zF4EBcrrNVb0aHKDcOGQFDeq8jtFnosQwueUfAZuOfWRyRYcZIeUoIJAIreq BU7V7lbkwDRLadMJ/AgsPYFK7JXvgBRubwDDwuaNMgY56t5DsJjBSECfb/6WZDzcQ4Ul z+PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=fPkFBTVTLeXXFld2k8QPhsCObZw7Jl66Dmei5HgsqY0=; b=nJU1w5QyENKzhDqnV1LEC148vSohRYwuNHfBf/UYEwdWMVylORZe/iwChWFSGsEcSY RloZSmoneXiVf4RlMEhckaE+e7HayTjxWK9KV2b7MgrrtmrHmjJysdZ7BUFbDeScCy/1 qEEdVf6n/Gws4JLWQRM67HRdikm+r97HErDppEmPLNnNdymInb/9BqBUyRr3lsiTSvKA QnQzru2tXTG0Tb9ajc1yNBYU8SjcIzEiFlubR82oOjM7NZwxdd8RNShPI8LRI3wl7T0i ffxI2Tay0nCoRBK4hzy8lFD2eY3L9raXL+vtYZI1999Yj/uih3TwJM6aNJvXe+fBOOqB IabQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kToqBT9o; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z16si6030403ybm.193.2022.02.11.08.12.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Feb 2022 08:12:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kToqBT9o; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIYX9-0006nj-6F for patch@linaro.org; Fri, 11 Feb 2022 11:12:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIYOa-0007Pu-SA for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:40 -0500 Received: from [2a00:1450:4864:20::635] (port=45889 helo=mail-ej1-x635.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIYOU-0005DN-6n for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:38 -0500 Received: by mail-ej1-x635.google.com with SMTP id h22so5801034ejl.12 for ; Fri, 11 Feb 2022 08:03:28 -0800 (PST) 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=fPkFBTVTLeXXFld2k8QPhsCObZw7Jl66Dmei5HgsqY0=; b=kToqBT9oOFTmX8fICBqQfGUiDM4gFGXQY/s5SL4yVmJFohhh8YU/tVwnOstY8mMb99 /sJZ38vokJWyHcPVwEESSIJDvGEjKlBzclNGUU6Ls7X1bc3IpnLSRa7mOGzfFlA2pJ/v OvMqOay/fQtSl/y9I2Lk/0wlAcEPuifhfqtl1zQrOtM/wsPq9ZpNw4NijRfvQpRRY+rY UpiPYvRcR/+7quitFs2tgKtun14o6eUfy0zvXl5O7/B7LH/rfwC6lBzK73bn2RVKyj0m +hXgIJ4ui8RO3dDNkcoQZ7pSvfE5c8dAd1sHJMp1Gr674SMlXM0onLK1KhQ7a+8XcDjt qHTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fPkFBTVTLeXXFld2k8QPhsCObZw7Jl66Dmei5HgsqY0=; b=xFhrdH++DL/zckdhEFsX27+Pme4HwqbfsbwS5gQcQ3KHc7i8cZMppnE0z0iOCUwWtD Yxu6Pz86H5zn3eDVF+BH1FTkc+6wggs07ln6gh+zfGRqO8BieY4IpwpP/BTZcX679Frj rDyAOvqD/J/p0xGjOKTSvS3CxdcZCoBGyv2xcSjCDuqsoyYR0kDtRVOE+fUZ8rh3BK68 4urdUEFkQoc6TA9+mXowNvSSAB8XVkxf27duIwiL046wfzQAOkZKfbs8ttJJglbtW1YJ FO9+x12OeWqc8KwCwo57gkz4Ggj3oMltZAMZLkHeXNbUjPEkJ94T0ga4LDxdrW9tk1RJ 4Dbg== X-Gm-Message-State: AOAM532WCRE6WKbwKVD+49EHIIgXlIQsyyY/gYm1wYYDMPG/fqT35xX2 ooNSCCYG20GQLABedQl/A2kt04NVxSFe3Q== X-Received: by 2002:a17:906:64d8:: with SMTP id p24mr1962107ejn.136.1644595406862; Fri, 11 Feb 2022 08:03:26 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c11sm11890336edx.42.2022.02.11.08.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 08:03:23 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A74FF1FFC2; Fri, 11 Feb 2022 16:03:10 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 10/11] tests/tcg: add sha512 test Date: Fri, 11 Feb 2022 16:03:08 +0000 Message-Id: <20220211160309.335014-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211160309.335014-1-alex.bennee@linaro.org> References: <20220211160309.335014-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::635 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x635.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, berrange@redhat.com, Richard Henderson , f4bug@amsat.org, qemu-arm@nongnu.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This imports the sha512 algorithm and related tests from ccan which offers a cleaner hash implementation with its own validation tests with which we can exercise TCG code generations. [AJB: this exercise in copy and paste does raise the question of should we add ccan as a module to use for writing TCG tests?] Signed-off-by: Alex Bennée Acked-by: Richard Henderson Message-Id: <20220202191242.652607-4-alex.bennee@linaro.org> --- tests/tcg/multiarch/sha512.c | 990 +++++++++++++++++++++++++++++++++++ 1 file changed, 990 insertions(+) create mode 100644 tests/tcg/multiarch/sha512.c diff --git a/tests/tcg/multiarch/sha512.c b/tests/tcg/multiarch/sha512.c new file mode 100644 index 0000000000..d61942d1e0 --- /dev/null +++ b/tests/tcg/multiarch/sha512.c @@ -0,0 +1,990 @@ +/* + * sha512 test based on CCAN: https://ccodearchive.net/info/crypto/sha512.html + * + * src/crypto/sha512.cpp commit f914f1a746d7f91951c1da262a4a749dd3ebfa71 + * Copyright (c) 2014 The Bitcoin Core developers + * Distributed under the MIT software license, see: + * http://www.opensource.org/licenses/mit-license.php. + * + * SPDX-License-Identifier: MIT CC0-1.0 + */ +#define _GNU_SOURCE /* See feature_test_macros(7) */ + +#include +#include +#include +#include +#include +#include + +/* Required portions from endian.h */ + +/** + * BSWAP_64 - reverse bytes in a constant uint64_t value. + * @val: constantvalue whose bytes to swap. + * + * Designed to be usable in constant-requiring initializers. + * + * Example: + * struct mystruct { + * char buf[BSWAP_64(0xff00000000000000ULL)]; + * }; + */ +#define BSWAP_64(val) \ + ((((uint64_t)(val) & 0x00000000000000ffULL) << 56) \ + | (((uint64_t)(val) & 0x000000000000ff00ULL) << 40) \ + | (((uint64_t)(val) & 0x0000000000ff0000ULL) << 24) \ + | (((uint64_t)(val) & 0x00000000ff000000ULL) << 8) \ + | (((uint64_t)(val) & 0x000000ff00000000ULL) >> 8) \ + | (((uint64_t)(val) & 0x0000ff0000000000ULL) >> 24) \ + | (((uint64_t)(val) & 0x00ff000000000000ULL) >> 40) \ + | (((uint64_t)(val) & 0xff00000000000000ULL) >> 56)) + + +typedef uint64_t beint64_t; + +#if BYTE_ORDER == BIG_ENDIAN + +/** + * CPU_TO_BE64 - convert a constant uint64_t value to big-endian + * @native: constant to convert + */ +#define CPU_TO_BE64(native) ((beint64_t)(native)) +/** + * BE64_TO_CPU - convert a big-endian uint64_t constant + * @le_val: big-endian constant to convert + */ +#define BE64_TO_CPU(le_val) ((uint64_t)(le_val)) + +#else /* ... HAVE_LITTLE_ENDIAN */ +#define CPU_TO_BE64(native) ((beint64_t)BSWAP_64(native)) +#define BE64_TO_CPU(le_val) BSWAP_64((uint64_t)le_val) +#endif /* HAVE_LITTE_ENDIAN */ + +/** + * cpu_to_be64 - convert a uint64_t value to big endian. + * @native: value to convert + */ +static inline beint64_t cpu_to_be64(uint64_t native) +{ + return CPU_TO_BE64(native); +} + +/** + * be64_to_cpu - convert a big-endian uint64_t value + * @be_val: big-endian value to convert + */ +static inline uint64_t be64_to_cpu(beint64_t be_val) +{ + return BE64_TO_CPU(be_val); +} + +/* From compiler.h */ + +#ifndef UNUSED +/** + * UNUSED - a parameter is unused + * + * Some compilers (eg. gcc with -W or -Wunused) warn about unused + * function parameters. This suppresses such warnings and indicates + * to the reader that it's deliberate. + * + * Example: + * // This is used as a callback, so needs to have this prototype. + * static int some_callback(void *unused UNUSED) + * { + * return 0; + * } + */ +#define UNUSED __attribute__((__unused__)) +#endif + +/* From sha512.h */ + +/** + * struct sha512 - structure representing a completed SHA512. + * @u.u8: an unsigned char array. + * @u.u64: a 64-bit integer array. + * + * Other fields may be added to the union in future. + */ +struct sha512 { + union { + uint64_t u64[8]; + unsigned char u8[64]; + } u; +}; + +/** + * sha512 - return sha512 of an object. + * @sha512: the sha512 to fill in + * @p: pointer to memory, + * @size: the number of bytes pointed to by @p + * + * The bytes pointed to by @p is SHA512 hashed into @sha512. This is + * equivalent to sha512_init(), sha512_update() then sha512_done(). + */ +void sha512(struct sha512 *sha, const void *p, size_t size); + +/** + * struct sha512_ctx - structure to store running context for sha512 + */ +struct sha512_ctx { + uint64_t s[8]; + union { + uint64_t u64[16]; + unsigned char u8[128]; + } buf; + size_t bytes; +}; + +/** + * sha512_init - initialize an SHA512 context. + * @ctx: the sha512_ctx to initialize + * + * This must be called before sha512_update or sha512_done, or + * alternately you can assign SHA512_INIT. + * + * If it was already initialized, this forgets anything which was + * hashed before. + * + * Example: + * static void hash_all(const char **arr, struct sha512 *hash) + * { + * size_t i; + * struct sha512_ctx ctx; + * + * sha512_init(&ctx); + * for (i = 0; arr[i]; i++) + * sha512_update(&ctx, arr[i], strlen(arr[i])); + * sha512_done(&ctx, hash); + * } + */ +void sha512_init(struct sha512_ctx *ctx); + +/** + * SHA512_INIT - initializer for an SHA512 context. + * + * This can be used to statically initialize an SHA512 context (instead + * of sha512_init()). + * + * Example: + * static void hash_all(const char **arr, struct sha512 *hash) + * { + * size_t i; + * struct sha512_ctx ctx = SHA512_INIT; + * + * for (i = 0; arr[i]; i++) + * sha512_update(&ctx, arr[i], strlen(arr[i])); + * sha512_done(&ctx, hash); + * } + */ +#define SHA512_INIT \ + { { 0x6a09e667f3bcc908ull, 0xbb67ae8584caa73bull, \ + 0x3c6ef372fe94f82bull, 0xa54ff53a5f1d36f1ull, \ + 0x510e527fade682d1ull, 0x9b05688c2b3e6c1full, \ + 0x1f83d9abfb41bd6bull, 0x5be0cd19137e2179ull }, \ + { { 0 } }, 0 } + +/** + * sha512_update - include some memory in the hash. + * @ctx: the sha512_ctx to use + * @p: pointer to memory, + * @size: the number of bytes pointed to by @p + * + * You can call this multiple times to hash more data, before calling + * sha512_done(). + */ +void sha512_update(struct sha512_ctx *ctx, const void *p, size_t size); + +/** + * sha512_done - finish SHA512 and return the hash + * @ctx: the sha512_ctx to complete + * @res: the hash to return. + * + * Note that @ctx is *destroyed* by this, and must be reinitialized. + * To avoid that, pass a copy instead. + */ +void sha512_done(struct sha512_ctx *sha512, struct sha512 *res); + +/* From sha512.c */ + +/* + * SHA512 core code translated from the Bitcoin project's C++: + * + * src/crypto/sha512.cpp commit f914f1a746d7f91951c1da262a4a749dd3ebfa71 + * Copyright (c) 2014 The Bitcoin Core developers + * Distributed under the MIT software license, see the accompanying + * file COPYING or http://www.opensource.org/licenses/mit-license.php. + */ +/* #include */ +/* #include */ +#include +#include +#include + +static void invalidate_sha512(struct sha512_ctx *ctx) +{ + ctx->bytes = (size_t)-1; +} + +static void check_sha512(struct sha512_ctx *ctx UNUSED) +{ + assert(ctx->bytes != (size_t)-1); +} + +static uint64_t Ch(uint64_t x, uint64_t y, uint64_t z) +{ + return z ^ (x & (y ^ z)); +} +static uint64_t Maj(uint64_t x, uint64_t y, uint64_t z) +{ + return (x & y) | (z & (x | y)); +} +static uint64_t Sigma0(uint64_t x) +{ + return (x >> 28 | x << 36) ^ (x >> 34 | x << 30) ^ (x >> 39 | x << 25); +} +static uint64_t Sigma1(uint64_t x) +{ + return (x >> 14 | x << 50) ^ (x >> 18 | x << 46) ^ (x >> 41 | x << 23); +} +static uint64_t sigma0(uint64_t x) +{ + return (x >> 1 | x << 63) ^ (x >> 8 | x << 56) ^ (x >> 7); +} +static uint64_t sigma1(uint64_t x) +{ + return (x >> 19 | x << 45) ^ (x >> 61 | x << 3) ^ (x >> 6); +} + +/** One round of SHA-512. */ +static void Round(uint64_t a, uint64_t b, uint64_t c, uint64_t *d, uint64_t e, uint64_t f, uint64_t g, uint64_t *h, uint64_t k, uint64_t w) +{ + uint64_t t1 = *h + Sigma1(e) + Ch(e, f, g) + k + w; + uint64_t t2 = Sigma0(a) + Maj(a, b, c); + *d += t1; + *h = t1 + t2; +} + +/** Perform one SHA-512 transformation, processing a 128-byte chunk. */ +static void Transform(uint64_t *s, const uint64_t *chunk) +{ + uint64_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7]; + uint64_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; + + Round(a, b, c, &d, e, f, g, &h, 0x428a2f98d728ae22ull, w0 = be64_to_cpu(chunk[0])); + Round(h, a, b, &c, d, e, f, &g, 0x7137449123ef65cdull, w1 = be64_to_cpu(chunk[1])); + Round(g, h, a, &b, c, d, e, &f, 0xb5c0fbcfec4d3b2full, w2 = be64_to_cpu(chunk[2])); + Round(f, g, h, &a, b, c, d, &e, 0xe9b5dba58189dbbcull, w3 = be64_to_cpu(chunk[3])); + Round(e, f, g, &h, a, b, c, &d, 0x3956c25bf348b538ull, w4 = be64_to_cpu(chunk[4])); + Round(d, e, f, &g, h, a, b, &c, 0x59f111f1b605d019ull, w5 = be64_to_cpu(chunk[5])); + Round(c, d, e, &f, g, h, a, &b, 0x923f82a4af194f9bull, w6 = be64_to_cpu(chunk[6])); + Round(b, c, d, &e, f, g, h, &a, 0xab1c5ed5da6d8118ull, w7 = be64_to_cpu(chunk[7])); + Round(a, b, c, &d, e, f, g, &h, 0xd807aa98a3030242ull, w8 = be64_to_cpu(chunk[8])); + Round(h, a, b, &c, d, e, f, &g, 0x12835b0145706fbeull, w9 = be64_to_cpu(chunk[9])); + Round(g, h, a, &b, c, d, e, &f, 0x243185be4ee4b28cull, w10 = be64_to_cpu(chunk[10])); + Round(f, g, h, &a, b, c, d, &e, 0x550c7dc3d5ffb4e2ull, w11 = be64_to_cpu(chunk[11])); + Round(e, f, g, &h, a, b, c, &d, 0x72be5d74f27b896full, w12 = be64_to_cpu(chunk[12])); + Round(d, e, f, &g, h, a, b, &c, 0x80deb1fe3b1696b1ull, w13 = be64_to_cpu(chunk[13])); + Round(c, d, e, &f, g, h, a, &b, 0x9bdc06a725c71235ull, w14 = be64_to_cpu(chunk[14])); + Round(b, c, d, &e, f, g, h, &a, 0xc19bf174cf692694ull, w15 = be64_to_cpu(chunk[15])); + + Round(a, b, c, &d, e, f, g, &h, 0xe49b69c19ef14ad2ull, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, &c, d, e, f, &g, 0xefbe4786384f25e3ull, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, &b, c, d, e, &f, 0x0fc19dc68b8cd5b5ull, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, &a, b, c, d, &e, 0x240ca1cc77ac9c65ull, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, &h, a, b, c, &d, 0x2de92c6f592b0275ull, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, &g, h, a, b, &c, 0x4a7484aa6ea6e483ull, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, &f, g, h, a, &b, 0x5cb0a9dcbd41fbd4ull, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, &e, f, g, h, &a, 0x76f988da831153b5ull, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, &d, e, f, g, &h, 0x983e5152ee66dfabull, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, &c, d, e, f, &g, 0xa831c66d2db43210ull, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, &b, c, d, e, &f, 0xb00327c898fb213full, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, &a, b, c, d, &e, 0xbf597fc7beef0ee4ull, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, &h, a, b, c, &d, 0xc6e00bf33da88fc2ull, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, &g, h, a, b, &c, 0xd5a79147930aa725ull, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, &f, g, h, a, &b, 0x06ca6351e003826full, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, &e, f, g, h, &a, 0x142929670a0e6e70ull, w15 += sigma1(w13) + w8 + sigma0(w0)); + + Round(a, b, c, &d, e, f, g, &h, 0x27b70a8546d22ffcull, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, &c, d, e, f, &g, 0x2e1b21385c26c926ull, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, &b, c, d, e, &f, 0x4d2c6dfc5ac42aedull, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, &a, b, c, d, &e, 0x53380d139d95b3dfull, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, &h, a, b, c, &d, 0x650a73548baf63deull, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, &g, h, a, b, &c, 0x766a0abb3c77b2a8ull, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, &f, g, h, a, &b, 0x81c2c92e47edaee6ull, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, &e, f, g, h, &a, 0x92722c851482353bull, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, &d, e, f, g, &h, 0xa2bfe8a14cf10364ull, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, &c, d, e, f, &g, 0xa81a664bbc423001ull, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, &b, c, d, e, &f, 0xc24b8b70d0f89791ull, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, &a, b, c, d, &e, 0xc76c51a30654be30ull, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, &h, a, b, c, &d, 0xd192e819d6ef5218ull, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, &g, h, a, b, &c, 0xd69906245565a910ull, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, &f, g, h, a, &b, 0xf40e35855771202aull, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, &e, f, g, h, &a, 0x106aa07032bbd1b8ull, w15 += sigma1(w13) + w8 + sigma0(w0)); + + Round(a, b, c, &d, e, f, g, &h, 0x19a4c116b8d2d0c8ull, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, &c, d, e, f, &g, 0x1e376c085141ab53ull, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, &b, c, d, e, &f, 0x2748774cdf8eeb99ull, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, &a, b, c, d, &e, 0x34b0bcb5e19b48a8ull, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, &h, a, b, c, &d, 0x391c0cb3c5c95a63ull, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, &g, h, a, b, &c, 0x4ed8aa4ae3418acbull, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, &f, g, h, a, &b, 0x5b9cca4f7763e373ull, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, &e, f, g, h, &a, 0x682e6ff3d6b2b8a3ull, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, &d, e, f, g, &h, 0x748f82ee5defb2fcull, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, &c, d, e, f, &g, 0x78a5636f43172f60ull, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, &b, c, d, e, &f, 0x84c87814a1f0ab72ull, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, &a, b, c, d, &e, 0x8cc702081a6439ecull, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, &h, a, b, c, &d, 0x90befffa23631e28ull, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, &g, h, a, b, &c, 0xa4506cebde82bde9ull, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, &f, g, h, a, &b, 0xbef9a3f7b2c67915ull, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, &e, f, g, h, &a, 0xc67178f2e372532bull, w15 += sigma1(w13) + w8 + sigma0(w0)); + + Round(a, b, c, &d, e, f, g, &h, 0xca273eceea26619cull, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, &c, d, e, f, &g, 0xd186b8c721c0c207ull, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, &b, c, d, e, &f, 0xeada7dd6cde0eb1eull, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, &a, b, c, d, &e, 0xf57d4f7fee6ed178ull, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, &h, a, b, c, &d, 0x06f067aa72176fbaull, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, &g, h, a, b, &c, 0x0a637dc5a2c898a6ull, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, &f, g, h, a, &b, 0x113f9804bef90daeull, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, &e, f, g, h, &a, 0x1b710b35131c471bull, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, &d, e, f, g, &h, 0x28db77f523047d84ull, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, &c, d, e, f, &g, 0x32caab7b40c72493ull, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, &b, c, d, e, &f, 0x3c9ebe0a15c9bebcull, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, &a, b, c, d, &e, 0x431d67c49c100d4cull, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, &h, a, b, c, &d, 0x4cc5d4becb3e42b6ull, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, &g, h, a, b, &c, 0x597f299cfc657e2aull, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, &f, g, h, a, &b, 0x5fcb6fab3ad6faecull, w14 + sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, &e, f, g, h, &a, 0x6c44198c4a475817ull, w15 + sigma1(w13) + w8 + sigma0(w0)); + + s[0] += a; + s[1] += b; + s[2] += c; + s[3] += d; + s[4] += e; + s[5] += f; + s[6] += g; + s[7] += h; +} + +static bool alignment_ok(const void *p UNUSED, size_t n UNUSED) +{ +#if HAVE_UNALIGNED_ACCESS + return true; +#else + return ((size_t)p % n == 0); +#endif +} + +static void add(struct sha512_ctx *ctx, const void *p, size_t len) +{ + const unsigned char *data = p; + size_t bufsize = ctx->bytes % 128; + + if (bufsize + len >= 128) { + /* Fill the buffer, and process it. */ + memcpy(ctx->buf.u8 + bufsize, data, 128 - bufsize); + ctx->bytes += 128 - bufsize; + data += 128 - bufsize; + len -= 128 - bufsize; + Transform(ctx->s, ctx->buf.u64); + bufsize = 0; + } + + while (len >= 128) { + /* Process full chunks directly from the source. */ + if (alignment_ok(data, sizeof(uint64_t))) + Transform(ctx->s, (const uint64_t *)data); + else { + memcpy(ctx->buf.u8, data, sizeof(ctx->buf)); + Transform(ctx->s, ctx->buf.u64); + } + ctx->bytes += 128; + data += 128; + len -= 128; + } + + if (len) { + /* Fill the buffer with what remains. */ + memcpy(ctx->buf.u8 + bufsize, data, len); + ctx->bytes += len; + } +} + +void sha512_init(struct sha512_ctx *ctx) +{ + struct sha512_ctx init = SHA512_INIT; + *ctx = init; +} + +void sha512_update(struct sha512_ctx *ctx, const void *p, size_t size) +{ + check_sha512(ctx); + add(ctx, p, size); +} + +void sha512_done(struct sha512_ctx *ctx, struct sha512 *res) +{ + static const unsigned char pad[128] = { 0x80 }; + uint64_t sizedesc[2] = { 0, 0 }; + size_t i; + + sizedesc[1] = cpu_to_be64((uint64_t)ctx->bytes << 3); + + /* Add '1' bit to terminate, then all 0 bits, up to next block - 16. */ + add(ctx, pad, 1 + ((256 - 16 - (ctx->bytes % 128) - 1) % 128)); + /* Add number of bits of data (big endian) */ + add(ctx, sizedesc, sizeof(sizedesc)); + for (i = 0; i < sizeof(ctx->s) / sizeof(ctx->s[0]); i++) + res->u.u64[i] = cpu_to_be64(ctx->s[i]); + invalidate_sha512(ctx); +} + +void sha512(struct sha512 *sha, const void *p, size_t size) +{ + struct sha512_ctx ctx; + + sha512_init(&ctx); + sha512_update(&ctx, p, size); + sha512_done(&ctx, sha); +} + +/* From hex.h */ +/** + * hex_decode - Unpack a hex string. + * @str: the hexidecimal string + * @slen: the length of @str + * @buf: the buffer to write the data into + * @bufsize: the length of @buf + * + * Returns false if there are any characters which aren't 0-9, a-f or A-F, + * of the string wasn't the right length for @bufsize. + * + * Example: + * unsigned char data[20]; + * + * if (!hex_decode(argv[1], strlen(argv[1]), data, 20)) + * printf("String is malformed!\n"); + */ +bool hex_decode(const char *str, size_t slen, void *buf, size_t bufsize); + +/** + * hex_encode - Create a nul-terminated hex string + * @buf: the buffer to read the data from + * @bufsize: the length of @buf + * @dest: the string to fill + * @destsize: the max size of the string + * + * Returns true if the string, including terminator, fit in @destsize; + * + * Example: + * unsigned char buf[] = { 0x1F, 0x2F }; + * char str[5]; + * + * if (!hex_encode(buf, sizeof(buf), str, sizeof(str))) + * abort(); + */ +bool hex_encode(const void *buf, size_t bufsize, char *dest, size_t destsize); + +/** + * hex_str_size - Calculate how big a nul-terminated hex string is + * @bytes: bytes of data to represent + * + * Example: + * unsigned char buf[] = { 0x1F, 0x2F }; + * char str[hex_str_size(sizeof(buf))]; + * + * hex_encode(buf, sizeof(buf), str, sizeof(str)); + */ +static inline size_t hex_str_size(size_t bytes) +{ + return 2 * bytes + 1; +} + +/* From hex.c */ +static bool char_to_hex(unsigned char *val, char c) +{ + if (c >= '0' && c <= '9') { + *val = c - '0'; + return true; + } + if (c >= 'a' && c <= 'f') { + *val = c - 'a' + 10; + return true; + } + if (c >= 'A' && c <= 'F') { + *val = c - 'A' + 10; + return true; + } + return false; +} + +bool hex_decode(const char *str, size_t slen, void *buf, size_t bufsize) +{ + unsigned char v1, v2; + unsigned char *p = buf; + + while (slen > 1) { + if (!char_to_hex(&v1, str[0]) || !char_to_hex(&v2, str[1])) + return false; + if (!bufsize) + return false; + *(p++) = (v1 << 4) | v2; + str += 2; + slen -= 2; + bufsize--; + } + return slen == 0 && bufsize == 0; +} + +static char hexchar(unsigned int val) +{ + if (val < 10) + return '0' + val; + if (val < 16) + return 'a' + val - 10; + abort(); +} + +bool hex_encode(const void *buf, size_t bufsize, char *dest, size_t destsize) +{ + size_t i; + + if (destsize < hex_str_size(bufsize)) + return false; + + for (i = 0; i < bufsize; i++) { + unsigned int c = ((const unsigned char *)buf)[i]; + *(dest++) = hexchar(c >> 4); + *(dest++) = hexchar(c & 0xF); + } + *dest = '\0'; + + return true; +} + +/* From tap.h */ +/** + * plan_tests - announce the number of tests you plan to run + * @tests: the number of tests + * + * This should be the first call in your test program: it allows tracing + * of failures which mean that not all tests are run. + * + * If you don't know how many tests will actually be run, assume all of them + * and use skip() if you don't actually run some tests. + * + * Example: + * plan_tests(13); + */ +void plan_tests(unsigned int tests); + +/** + * ok1 - Simple conditional test + * @e: the expression which we expect to be true. + * + * This is the simplest kind of test: if the expression is true, the + * test passes. The name of the test which is printed will simply be + * file name, line number, and the expression itself. + * + * Example: + * ok1(somefunc() == 1); + */ +# define ok1(e) ((e) ? \ + _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \ + _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e)) + +/** + * exit_status - the value that main should return. + * + * For maximum compatibility your test program should return a particular exit + * code (ie. 0 if all tests were run, and every test which was expected to + * succeed succeeded). + * + * Example: + * exit(exit_status()); + */ +int exit_status(void); + +/** + * tap_fail_callback - function to call when we fail + * + * This can be used to ease debugging, or exit on the first failure. + */ +void (*tap_fail_callback)(void); + +/* From tap.c */ + +static int no_plan = 0; +static int skip_all = 0; +static int have_plan = 0; +static unsigned int test_count = 0; /* Number of tests that have been run */ +static unsigned int e_tests = 0; /* Expected number of tests to run */ +static unsigned int failures = 0; /* Number of tests that failed */ +static char *todo_msg = NULL; +static const char *todo_msg_fixed = "libtap malloc issue"; +static int todo = 0; +static int test_died = 0; +static int test_pid; + +static void +_expected_tests(unsigned int tests) +{ + printf("1..%d\n", tests); + e_tests = tests; +} + +static void +diagv(const char *fmt, va_list ap) +{ + fputs("# ", stdout); + vfprintf(stdout, fmt, ap); + fputs("\n", stdout); +} + +static void +_diag(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + diagv(fmt, ap); + va_end(ap); +} + +/* + * Generate a test result. + * + * ok -- boolean, indicates whether or not the test passed. + * test_name -- the name of the test, may be NULL + * test_comment -- a comment to print afterwards, may be NULL + */ +unsigned int +_gen_result(int ok, const char *func, const char *file, unsigned int line, + const char *test_name, ...) +{ + va_list ap; + char *local_test_name = NULL; + char *c; + int name_is_digits; + + test_count++; + + /* Start by taking the test name and performing any printf() + expansions on it */ + if(test_name != NULL) { + va_start(ap, test_name); + if (vasprintf(&local_test_name, test_name, ap) < 0) + local_test_name = NULL; + va_end(ap); + + /* Make sure the test name contains more than digits + and spaces. Emit an error message and exit if it + does */ + if(local_test_name) { + name_is_digits = 1; + for(c = local_test_name; *c != '\0'; c++) { + if(!isdigit((unsigned char)*c) + && !isspace((unsigned char)*c)) { + name_is_digits = 0; + break; + } + } + + if(name_is_digits) { + _diag(" You named your test '%s'. You shouldn't use numbers for your test names.", local_test_name); + _diag(" Very confusing."); + } + } + } + + if(!ok) { + printf("not "); + failures++; + } + + printf("ok %d", test_count); + + if(test_name != NULL) { + printf(" - "); + + /* Print the test name, escaping any '#' characters it + might contain */ + if(local_test_name != NULL) { + flockfile(stdout); + for(c = local_test_name; *c != '\0'; c++) { + if(*c == '#') + fputc('\\', stdout); + fputc((int)*c, stdout); + } + funlockfile(stdout); + } else { /* vasprintf() failed, use a fixed message */ + printf("%s", todo_msg_fixed); + } + } + + /* If we're in a todo_start() block then flag the test as being + TODO. todo_msg should contain the message to print at this + point. If it's NULL then asprintf() failed, and we should + use the fixed message. + + This is not counted as a failure, so decrement the counter if + the test failed. */ + if(todo) { + printf(" # TODO %s", todo_msg ? todo_msg : todo_msg_fixed); + if(!ok) + failures--; + } + + printf("\n"); + + if(!ok) + _diag(" Failed %stest (%s:%s() at line %d)", + todo ? "(TODO) " : "", file, func, line); + + free(local_test_name); + + if (!ok && tap_fail_callback) + tap_fail_callback(); + + /* We only care (when testing) that ok is positive, but here we + specifically only want to return 1 or 0 */ + return ok ? 1 : 0; +} + +/* + * Cleanup at the end of the run, produce any final output that might be + * required. + */ +static void +_cleanup(void) +{ + /* If we forked, don't do cleanup in child! */ + if (getpid() != test_pid) + return; + + /* If plan_no_plan() wasn't called, and we don't have a plan, + and we're not skipping everything, then something happened + before we could produce any output */ + if(!no_plan && !have_plan && !skip_all) { + _diag("Looks like your test died before it could output anything."); + return; + } + + if(test_died) { + _diag("Looks like your test died just after %d.", test_count); + return; + } + + + /* No plan provided, but now we know how many tests were run, and can + print the header at the end */ + if(!skip_all && (no_plan || !have_plan)) { + printf("1..%d\n", test_count); + } + + if((have_plan && !no_plan) && e_tests < test_count) { + _diag("Looks like you planned %d tests but ran %d extra.", + e_tests, test_count - e_tests); + return; + } + + if((have_plan || !no_plan) && e_tests > test_count) { + _diag("Looks like you planned %d tests but only ran %d.", + e_tests, test_count); + if(failures) { + _diag("Looks like you failed %d tests of %d run.", + failures, test_count); + } + return; + } + + if(failures) + _diag("Looks like you failed %d tests of %d.", + failures, test_count); + +} + +/* + * Initialise the TAP library. Will only do so once, however many times it's + * called. + */ +static void +_tap_init(void) +{ + static int run_once = 0; + + if(!run_once) { + test_pid = getpid(); + atexit(_cleanup); + + /* stdout needs to be unbuffered so that the output appears + in the same place relative to stderr output as it does + with Test::Harness */ +// setbuf(stdout, 0); + run_once = 1; + } +} + +/* + * Note the number of tests that will be run. + */ +void +plan_tests(unsigned int tests) +{ + + _tap_init(); + + if(have_plan != 0) { + fprintf(stderr, "You tried to plan twice!\n"); + test_died = 1; + exit(255); + } + + if(tests == 0) { + fprintf(stderr, "You said to run 0 tests! You've got to run something.\n"); + test_died = 1; + exit(255); + } + + have_plan = 1; + + _expected_tests(tests); +} + +static int +exit_status_(void) +{ + int r; + + /* If there's no plan, just return the number of failures */ + if(no_plan || !have_plan) { + return failures; + } + + /* Ran too many tests? Return the number of tests that were run + that shouldn't have been */ + if(e_tests < test_count) { + r = test_count - e_tests; + return r; + } + + /* Return the number of tests that failed + the number of tests + that weren't run */ + r = failures + e_tests - test_count; + + return r; +} + +int +exit_status(void) +{ + int r = exit_status_(); + if (r > 255) + r = 255; + return r; +} + +/* From run-test-vectors.c */ + +/* Test vectors. */ +struct test { + const char *vector; + size_t repetitions; + const char *expected; +}; + +static const char ZEROES[] = + "0000000000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000000"; + +static struct test tests[] = { + /* http://csrc.nist.gov/groups/STM/cavp/secure-hashing.html ShortMsg */ + { "21", 1, + "3831a6a6155e509dee59a7f451eb35324d8f8f2df6e3708894740f98fdee2388" + "9f4de5adb0c5010dfb555cda77c8ab5dc902094c52de3278f35a75ebc25f093a" }, + { "9083", 1, + "55586ebba48768aeb323655ab6f4298fc9f670964fc2e5f2731e34dfa4b0c09e" + "6e1e12e3d7286b3145c61c2047fb1a2a1297f36da64160b31fa4c8c2cddd2fb4" }, + { "0a55db", 1, + "7952585e5330cb247d72bae696fc8a6b0f7d0804577e347d99bc1b11e52f3849" + "85a428449382306a89261ae143c2f3fb613804ab20b42dc097e5bf4a96ef919b" }, + { "23be86d5", 1, + "76d42c8eadea35a69990c63a762f330614a4699977f058adb988f406fb0be8f2" + "ea3dce3a2bbd1d827b70b9b299ae6f9e5058ee97b50bd4922d6d37ddc761f8eb" }, + { "eb0ca946c1", 1, + "d39ecedfe6e705a821aee4f58bfc489c3d9433eb4ac1b03a97e321a2586b40dd" + "0522f40fa5aef36afff591a78c916bfc6d1ca515c4983dd8695b1ec7951d723e" }, + { "38667f39277b", 1, + "85708b8ff05d974d6af0801c152b95f5fa5c06af9a35230c5bea2752f031f9bd" + "84bd844717b3add308a70dc777f90813c20b47b16385664eefc88449f04f2131" }, + { "b39f71aaa8a108", 1, + "258b8efa05b4a06b1e63c7a3f925c5ef11fa03e3d47d631bf4d474983783d8c0" + "b09449009e842fc9fa15de586c67cf8955a17d790b20f41dadf67ee8cdcdfce6" }, + { "dc28484ebfd293d62ac759d5754bdf502423e4d419fa79020805134b2ce3dff7" + "38c7556c91d810adbad8dd210f041296b73c2185d4646c97fc0a5b69ed49ac8c" + "7ced0bd1cfd7e3c3cca47374d189247da6811a40b0ab097067ed4ad40ade2e47" + "91e39204e398b3204971445822a1be0dd93af8", 1, + "615115d2e8b62e345adaa4bdb95395a3b4fe27d71c4a111b86c1841463c5f03d" + "6b20d164a39948ab08ae060720d05c10f6022e5c8caf2fa3bca2e04d9c539ded" }, + { "fd2203e467574e834ab07c9097ae164532f24be1eb5d88f1af7748ceff0d2c67" + "a21f4e4097f9d3bb4e9fbf97186e0db6db0100230a52b453d421f8ab9c9a6043" + "aa3295ea20d2f06a2f37470d8a99075f1b8a8336f6228cf08b5942fc1fb4299c" + "7d2480e8e82bce175540bdfad7752bc95b577f229515394f3ae5cec870a4b2f8", + 1, + "a21b1077d52b27ac545af63b32746c6e3c51cb0cb9f281eb9f3580a6d4996d5c" + "9917d2a6e484627a9d5a06fa1b25327a9d710e027387fc3e07d7c4d14c6086cc" }, + /* http://www.di-mgt.com.au/sha_testvectors.html */ + { ZEROES, 1, + "7be9fda48f4179e611c698a73cff09faf72869431efee6eaad14de0cb44bbf66" + "503f752b7a8eb17083355f3ce6eb7d2806f236b25af96a24e22b887405c20081" } +}; + +static void *xmalloc(size_t size) +{ + char * ret; + ret = malloc(size); + if (ret == NULL) { + perror("malloc"); + abort(); + } + return ret; +} + +static bool do_test(const struct test *t) +{ + struct sha512 h; + char got[128 + 1]; + bool passed; + size_t i, vector_len = strlen(t->vector) / 2; + void *vector = xmalloc(vector_len); + + hex_decode(t->vector, vector_len * 2, vector, vector_len); + + for (i = 0; i < t->repetitions; i++) { + sha512(&h, vector, vector_len); + if (t->repetitions > 1) + memcpy(vector, &h, sizeof(h)); + } + + hex_encode(&h, sizeof(h), got, sizeof(got)); + + passed = strcmp(t->expected, got) == 0; + free(vector); + return passed; +} + +int main(void) +{ + const size_t num_tests = sizeof(tests) / sizeof(tests[0]); + size_t i; + + /* This is how many tests you plan to run */ + plan_tests(num_tests); + + for (i = 0; i < num_tests; i++) + ok1(do_test(&tests[i])); + + /* This exits depending on whether all tests passed */ + return exit_status(); +} From patchwork Fri Feb 11 16:03:09 2022 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: 541794 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp3212598imo; Fri, 11 Feb 2022 08:14:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaGV2uVL2xlc8TVs8Izj//3EQNH7ABOfRkGF5RR6cFGGAVeNhS8xZ+QhJp01bjCQgFJF+c X-Received: by 2002:a25:37cf:: with SMTP id e198mr2097807yba.697.1644596069903; Fri, 11 Feb 2022 08:14:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644596069; cv=none; d=google.com; s=arc-20160816; b=P7cVPA/E4fgOUNaUay/o5dLSJawgM6aY1AxvbGvbzGqHrjRlTKayh2NcThg9dBk281 AseXr9Zk+mzHQVz1ZBK2pARDacyLVLvkWr23ywj3/3CNbfQPnWOLY82nM/x//obrBO8n Nq+eQEuCvpXYtGI8aE3PbZ3R6dR0as65cYFYuNdYJtAworq1IJfVzyoTvnoqwTw0CjD5 t1TrqV9zpEG7n+91UwkZP/eZ0nlVE49EWB1uHVK1LlXjkSG0gxwZBRMDYnvw1b9nFVv1 S00A+0qxqF5f3rveGxi4Lj0Hjj8VLuknL0+oVPXpJiVeuvSmy3EPDYoi3mLlGbKIUh4e Mj4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=xaRSiVfaKuCepr53kcwbOQoAtU5qIFsM0RJYtnBGOYM=; b=jGZk++/5gYMTPi+8ThZs68RJvrVwTh6PE/HIyhmyB1t1dXe2ZCkDRisppelEVMaTLR NsyU6MgFVHvzu7awbNsrGZlR4DtGq9iyIFylyCAPPuPcvb/WQjojiTWHnQ0H4663irE7 7AISDNc12QZ5xQLR6LbzWAHwgW2xbA8QxbaLVY2Kra75lXFh3IwpQD05gOIRPwWUJ0Yh 1iNd5i0j8U2n+18g9MA2OtyDolvmgg4cMgMxr7J9SzJyQFJM9TSZp6FsVR1EK3BHylGt G+6EUBm1G90/HSNolhdJ8dTmrKe0lQ0gOvjAKSYOZpNR8z2p8lEI5tUqF7XCcRn07plX cPKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MXBzEEWO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x9si17499570ybu.418.2022.02.11.08.14.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Feb 2022 08:14:29 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MXBzEEWO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIYZ3-0003qH-CF for patch@linaro.org; Fri, 11 Feb 2022 11:14:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIYOa-0007Pv-S9 for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:40 -0500 Received: from [2a00:1450:4864:20::631] (port=46964 helo=mail-ej1-x631.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIYOU-0005D6-RR for qemu-devel@nongnu.org; Fri, 11 Feb 2022 11:03:38 -0500 Received: by mail-ej1-x631.google.com with SMTP id e7so19804946ejn.13 for ; Fri, 11 Feb 2022 08:03:27 -0800 (PST) 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=xaRSiVfaKuCepr53kcwbOQoAtU5qIFsM0RJYtnBGOYM=; b=MXBzEEWObFBUY5AKQ74BrJZM3DQ4Vab6yWTcOEWqvVEGzQIKO/NMZDVNmN2DpXc4lY puzbWMBR0jxRoz4Cr6vymLmkRpO4Z6aCnmyum+4e8qh7CZPla5Jo7BE80JOh8O0BToXL bQdt0WjTIdCO87qKhixGPK1aO2lh5rRAImMdmPJx/uUjpznteCA4kCEeHMjJodjeOzIA d797LkMSgYaBKX5/ogRxmFoMMQvYT8PyTRRpAPq8ha9G0J9iRUaeiZe5519v7JZ83l5N GHTDbkI23Kq1Y3sg8IHsw6uoEOmqJqBkwwriVt/YRX+nWXFEsLq2v5OjItUdujpQYpk/ gSFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xaRSiVfaKuCepr53kcwbOQoAtU5qIFsM0RJYtnBGOYM=; b=eWw0jN6tEze7DW3WQ7duIZ5PgmaSTP6wRShqyH1B/iH5qWVPHXU1YRyIvVcheJ8rcB N3I4z7fE0AeEK1HENRdIMSI9yMIwIoLnbgHqcexlk6yOtlGW3RH6Cu8L3Pwn8xlgCgL8 hnMkcMArYLtd3M/5e8tFLY9Z3jQDF1VSkMwtY074EtdkBgqVwwZzzGQKdYpOfCeuGoX+ XY/caL8Lr3jsnZ8rUWc1E5QdN4sK+1pOBis9WF1fWW8LxM5vmKya+kTNh6cxrlyoIGZo C0zdP5bFGu1sFbjwB9+4qYki3aAADDn4co+nLQGuGZlsaRcsQHrxoLqHQRdB2m6Lyfw9 y9tg== X-Gm-Message-State: AOAM530tnyyLeRWBsVhaqPRwM7e/Vp+cRPNu9+zKrCZZxC3eSiiQUYjK 7uw/J3Fd4FmIzA1ESu3IL3NBNg== X-Received: by 2002:a17:906:518f:: with SMTP id y15mr1946170ejk.18.1644595406047; Fri, 11 Feb 2022 08:03:26 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q7sm4951018ejj.8.2022.02.11.08.03.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 08:03:23 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D2BFA1FFC3; Fri, 11 Feb 2022 16:03:10 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 11/11] tests/tcg: add vectorised sha512 versions Date: Fri, 11 Feb 2022 16:03:09 +0000 Message-Id: <20220211160309.335014-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211160309.335014-1-alex.bennee@linaro.org> References: <20220211160309.335014-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::631 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x631.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Peter Maydell , berrange@redhat.com, David Hildenbrand , Richard Henderson , f4bug@amsat.org, Eduardo Habkost , "open list:S390 TCG CPUs" , qemu-arm@nongnu.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This builds vectorised versions of sha512 to exercise the vector code: - aarch64 (AdvSimd) - i386 (SSE) - s390x (MVX) - ppc64 (vector) Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20220202191242.652607-5-alex.bennee@linaro.org> --- v2 - use -msse4.1 -O3 instead of -pentium4 for i386 build --- tests/tcg/multiarch/sha512.c | 2 +- tests/tcg/aarch64/Makefile.target | 7 +++++++ tests/tcg/arm/Makefile.target | 8 ++++++++ tests/tcg/i386/Makefile.target | 6 ++++++ tests/tcg/ppc64le/Makefile.target | 5 ++++- tests/tcg/s390x/Makefile.target | 9 +++++++++ tests/tcg/x86_64/Makefile.target | 7 +++++++ 7 files changed, 42 insertions(+), 2 deletions(-) diff --git a/tests/tcg/multiarch/sha512.c b/tests/tcg/multiarch/sha512.c index d61942d1e0..e1729828b9 100644 --- a/tests/tcg/multiarch/sha512.c +++ b/tests/tcg/multiarch/sha512.c @@ -43,7 +43,7 @@ typedef uint64_t beint64_t; -#if BYTE_ORDER == BIG_ENDIAN +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ /** * CPU_TO_BE64 - convert a constant uint64_t value to big-endian diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target index df3f8e9438..ac07acde66 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -60,6 +60,13 @@ run-sha1-vector: sha1-vector run-sha1 TESTS += sha1-vector +# Vector versions of sha512 (-O3 triggers vectorisation) +sha512-vector: CFLAGS=-O3 +sha512-vector: sha512.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) + +TESTS += sha512-vector + ifneq ($(HAVE_GDB_BIN),) GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index 2dc94931c3..2f815120a5 100644 --- a/tests/tcg/arm/Makefile.target +++ b/tests/tcg/arm/Makefile.target @@ -79,6 +79,14 @@ run-sha1-vector: sha1-vector run-sha1 $(call diff-out, sha1-vector, sha1.out) ARM_TESTS += sha1-vector + +# Vector versions of sha512 (-O3 triggers vectorisation) +sha512-vector: CFLAGS=-O3 +sha512-vector: sha512.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) + +ARM_TESTS += sha512-vector + TESTS += $(ARM_TESTS) # On ARM Linux only supports 4k pages diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target index 38c10379af..099556efdc 100644 --- a/tests/tcg/i386/Makefile.target +++ b/tests/tcg/i386/Makefile.target @@ -71,3 +71,9 @@ TESTS=$(MULTIARCH_TESTS) $(I386_TESTS) # On i386 and x86_64 Linux only supports 4k pages (large pages are a different hack) EXTRA_RUNS+=run-test-mmap-4096 + +sha512-sse: CFLAGS=-msse4.1 -O3 +sha512-sse: sha512.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) + +TESTS+=sha512-sse diff --git a/tests/tcg/ppc64le/Makefile.target b/tests/tcg/ppc64le/Makefile.target index 480ff0898d..4f1d03dfcf 100644 --- a/tests/tcg/ppc64le/Makefile.target +++ b/tests/tcg/ppc64le/Makefile.target @@ -5,10 +5,13 @@ VPATH += $(SRC_PATH)/tests/tcg/ppc64le ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER8_VECTOR),) -PPC64LE_TESTS=bcdsub non_signalling_xscv +PPC64LE_TESTS=bcdsub non_signalling_xscv sha512-vector endif $(PPC64LE_TESTS): CFLAGS += -mpower8-vector +sha512-vector: sha512.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) + ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),) PPC64LE_TESTS += byte_reverse endif diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target index 1a7238b4eb..e53b599b22 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -25,3 +25,12 @@ run-gdbstub-signals-s390x: signals-s390x EXTRA_RUNS += run-gdbstub-signals-s390x endif + +# MVX versions of sha512 +sha512-mvx: CFLAGS=-march=z13 -mvx -O3 +sha512-mvx: sha512.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) + +run-sha512-mvx: QEMU_OPTS+=-cpu max + +TESTS+=sha512-mvx diff --git a/tests/tcg/x86_64/Makefile.target b/tests/tcg/x86_64/Makefile.target index 4a8a464c57..17cf168f0a 100644 --- a/tests/tcg/x86_64/Makefile.target +++ b/tests/tcg/x86_64/Makefile.target @@ -22,3 +22,10 @@ test-x86_64: test-i386.c test-i386.h test-i386-shift.h test-i386-muldiv.h vsyscall: $(SRC_PATH)/tests/tcg/x86_64/vsyscall.c $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) + +# TCG does not yet support all SSE (SIGILL on pshufb) +# sha512-sse: CFLAGS=-march=core2 -O3 +# sha512-sse: sha512.c +# $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) + +TESTS+=sha512-sse