From patchwork Wed Mar 10 15:59:51 2021 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: 396752 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp501592jai; Wed, 10 Mar 2021 08:10:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwKB+xpqgq/lQS+PGcU2kKIPUVvqZYsNK8y2/26JmX6oi0pVO1pG6UuN4UWyCICXVsm4Xs X-Received: by 2002:ab0:234f:: with SMTP id h15mr2367359uao.114.1615392620183; Wed, 10 Mar 2021 08:10:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615392620; cv=none; d=google.com; s=arc-20160816; b=LIkM2IQf10ZycQTYynspr+3QybErXzRz4lMLTmwfQQC0vPgNqCh4EHW90y7co5o3FZ OfXp83nunp0y1ulAPTySgZ9c/bL29l1i9YdAW2aee31ehn5ltW3O/4Ilr50ylrvg/Wd4 FLusZtBvk59GxrGFBkqwTFDNVGotG/gtD3ObOZ/sfMKJrM3uP4I3tpxpgEocfHxGovOD V8fFCjFXdsxUoG2fNm5REKd9UQ5paOOLNTRaCVCvkAkVPTlEmfeTkg2XJ8YBy6gl2uRh IIU8EXtrYYvYKg2Gkt9WyNmda4zdz02JM0bTjtcVv8GJheg54Yt6UbsdncZXp7bpJjFt CRRQ== 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=BD2BGoLYoCF2ln1sjTH9tzIFeeIkbRtfrQqCp8IPVOg=; b=nBHzPWE3ZMuVUNnMiiToWt9lBbWvaydhfscM4ekUWx65MCI3NqcT3HBOkWXVmDWywp GyoOjbqJnefo9/QZRJDxSR6lKz4oiQOS0kOnEGR17JD0s/d1EZHrPiUHPB0FFHqbxp/A te7WwAtzszjXmWjG4ak48Q1Z8A29MAwx49NmHm1kHmJLlQdkHdylLbRL2GaRSGn7vgCN OtlRx7F7sNsg0mG1Smn7/zPDfp4zOBALcM7RodPiNobaqyoHD2sBtFYBk/hTig55trVh 07RTc9GZqQ4kBIh45TBH1o/jXJpEHTT6BHzxAkCxq599o7ZhrAXgf0xWKhEISUk8fQ1a wtQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=P15qt0l7; 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 d64si3064900vkh.25.2021.03.10.08.10.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Mar 2021 08:10:20 -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=P15qt0l7; 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]:42908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lK1Pe-0004lx-Im for patch@linaro.org; Wed, 10 Mar 2021 11:10:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lK1Fy-0004Wk-S1 for qemu-devel@nongnu.org; Wed, 10 Mar 2021 11:00:18 -0500 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:38279) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lK1Fw-0002da-Fc for qemu-devel@nongnu.org; Wed, 10 Mar 2021 11:00:18 -0500 Received: by mail-ej1-x629.google.com with SMTP id mj10so39694607ejb.5 for ; Wed, 10 Mar 2021 08:00: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=BD2BGoLYoCF2ln1sjTH9tzIFeeIkbRtfrQqCp8IPVOg=; b=P15qt0l73JI/0NhG9gGZhfbgDc1zUTL7bupzjdiHKj7B5dtZU7Z9ni37Y8rxgp6kfz 6I0VdkKbUv6YjpZhI+BVFaAWzqwKVuuoWfT4tC6n6QWGvhk98ue7ww6xy7tPy5a5oi3c G1CFsYIUHT9JmqUpSolSFuUG2saQ7O8YOlz2m+mW68b69sCTbpyRZ2MRj85pcLooGdhr BqE6BoC6DC1u9krtO3hP39WDkyaojLtjrqcEJmm9tdkOsgzVuUsAoNldY/R+Ej02i14i hWegO0MBqCGsr9HMRDL/RsT8lIqUDAwM8MylKaA5Qxl9Zy+AaEWzGC/ynkfslFhHY5xP GtqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BD2BGoLYoCF2ln1sjTH9tzIFeeIkbRtfrQqCp8IPVOg=; b=FgfQcM+o5Ya/MsX9i59PHpnRhbG8Pu7KcVpHujxNw9WCNaWwIiXdXX/R2fDpLNjCfA J/f18OMMwAqENivGD5e+GYCINZTDgDY8AV9s8a3VKMsrRWKvxKBD7kLlpTO7UXu46Wsy OEmxjxIReidN9fNrX6DjlQfYibrjvC8CQwDET2Gkj1a8OLs0zOrOSYqcoXE+0L9n4SfL ZcvhPBcOcPrZYfH66PqraE3tr7MpFm6NlC4WcaGMNS2Wet+Cf/NdLiiF7oy76ElNsvb7 Kzku/6MUNN/eOcnw8sDDibJmgECeVMLKqBtd/VYv/T2BgF48Pq6WAz+YZ+E0HgMS0jDy koyA== X-Gm-Message-State: AOAM530ZOGFsBjoNbF4D1ou0uJ+3WKCJB4eVDuzb1gj56/aTgQDklioS wvhmxlQT8ynvl+pnHiYT1c2VlQ== X-Received: by 2002:a17:906:9152:: with SMTP id y18mr4406277ejw.19.1615392010277; Wed, 10 Mar 2021 08:00:10 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id t15sm11757447edc.34.2021.03.10.08.00.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 08:00:06 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EB2081FF90; Wed, 10 Mar 2021 16:00:02 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 04/15] gitlab-ci.yml: Add jobs to test CFI flags Date: Wed, 10 Mar 2021 15:59:51 +0000 Message-Id: <20210310160002.11659-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210310160002.11659-1-alex.bennee@linaro.org> References: <20210310160002.11659-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe?= =?utf-8?q?_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Daniele Buono Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Daniele Buono QEMU has had options to enable control-flow integrity features for a few months now. Add two sets of build/check/acceptance jobs to ensure the binary produced is working fine. The three sets allow testing of x86_64 binaries for x86_64, s390x, ppc64 and aarch64 targets [AJB: tweak job names to avoid brands] Signed-off-by: Daniele Buono Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210304030948.9367-3-dbuono@linux.vnet.ibm.com> Message-Id: <20210305092328.31792-9-alex.bennee@linaro.org> -- 2.20.1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 814f51873f..b23364bf3a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -483,6 +483,125 @@ clang-user: --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined MAKE_CHECK_ARGS: check-unit check-tcg +# Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory. +# On gitlab runners, default value sometimes end up calling 2 lds concurrently and +# triggers an Out-Of-Memory error +# +# Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together +# with QEMU and linked as a static library to avoid false positives in CFI checks. +# This can be accomplished by using -enable-slirp=git, which avoids the use of +# a system-wide version of the library +# +# Split in three sets of build/check/acceptance to limit the execution time of each +# job +build-cfi-aarch64: + <<: *native_build_job_definition + needs: + - job: amd64-fedora-container + variables: + LD_JOBS: 1 + AR: llvm-ar + IMAGE: fedora + CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug + --enable-safe-stack --enable-slirp=git + TARGETS: aarch64-softmmu + MAKE_CHECK_ARGS: check-build + artifacts: + expire_in: 2 days + paths: + - build + +check-cfi-aarch64: + <<: *native_test_job_definition + needs: + - job: build-cfi-aarch64 + artifacts: true + variables: + IMAGE: fedora + MAKE_CHECK_ARGS: check + +acceptance-cfi-aarch64: + <<: *native_test_job_definition + needs: + - job: build-cfi-aarch64 + artifacts: true + variables: + IMAGE: fedora + MAKE_CHECK_ARGS: check-acceptance + <<: *acceptance_definition + +build-cfi-ppc64-s390x: + <<: *native_build_job_definition + needs: + - job: amd64-fedora-container + variables: + LD_JOBS: 1 + AR: llvm-ar + IMAGE: fedora + CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug + --enable-safe-stack --enable-slirp=git + TARGETS: ppc64-softmmu s390x-softmmu + MAKE_CHECK_ARGS: check-build + artifacts: + expire_in: 2 days + paths: + - build + +check-cfi-ppc64-s390x: + <<: *native_test_job_definition + needs: + - job: build-cfi-ppc64-s390x + artifacts: true + variables: + IMAGE: fedora + MAKE_CHECK_ARGS: check + +acceptance-cfi-ppc64-s390x: + <<: *native_test_job_definition + needs: + - job: build-cfi-ppc64-s390x + artifacts: true + variables: + IMAGE: fedora + MAKE_CHECK_ARGS: check-acceptance + <<: *acceptance_definition + +build-cfi-x86_64: + <<: *native_build_job_definition + needs: + - job: amd64-fedora-container + variables: + LD_JOBS: 1 + AR: llvm-ar + IMAGE: fedora + CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug + --enable-safe-stack --enable-slirp=git + TARGETS: x86_64-softmmu + MAKE_CHECK_ARGS: check-build + artifacts: + expire_in: 2 days + paths: + - build + +check-cfi-x86_64: + <<: *native_test_job_definition + needs: + - job: build-cfi-x86_64 + artifacts: true + variables: + IMAGE: fedora + MAKE_CHECK_ARGS: check + +acceptance-cfi-x86_64: + <<: *native_test_job_definition + needs: + - job: build-cfi-x86_64 + artifacts: true + variables: + IMAGE: fedora + MAKE_CHECK_ARGS: check-acceptance + <<: *acceptance_definition + tsan-build: <<: *native_build_job_definition variables: