From patchwork Thu Aug 8 15:42:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 13757864 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B91D118FC8C for ; Thu, 8 Aug 2024 15:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723131753; cv=none; b=OcwiS8Z6kp6VHQb4kJB37S6uiR3T+T9D4UEOCul5dBvbhKj6lJ6hhFyM+EA8R7RsZopvkYI0xdaRgEOmrBqZJrACvJGqjwRUxV317QKxhm75svTr3vcTzo+xkdZqFYdEd8p4thNmukY28Nwp0toUN4KZNvg3A2DTkd2KOcpS8Bg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723131753; c=relaxed/simple; bh=rKSJEDrFm0LsGwyPo1J07z1qzweYYC/6axFo1NYLnEg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VJLOX9de6kU/LchJDT9K/pMPL5woqMsrmNyvdSJALgddZmL8+VLBVi3QNg1bhHIaPefwd3AHL4gDe1sFPAllj+CniMU+2fWNory7VzSIvMlvnERTFU+nj1mZvjON65FY4XawEZm/BsPQGEpfVTps5+XXQc2bsC9HuZqQweXdkCE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=F15Wj0G7; arc=none smtp.client-ip=95.215.58.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="F15Wj0G7" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1723131748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=St1yXTnto1ifHTnWGgBbt3nQwVVou+kbdMZSsEu7UiU=; b=F15Wj0G7YAkfRDa8n4yneuwWVl8nqRfRXe6wU1ZcOGWG/xPVj9h3SnmLNU4u9QflWIGRIV aGe7aUEUCPc1ENsVnD4Y266zZUv9B9tJo8lelYcy+OKKD+Yy8gBqrVnAtR/smw4xDUXepD S4kcOQeOH/g5Ba+uwZUtL6l773leXFY= From: Andrew Jones To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Cc: pbonzini@redhat.com, thuth@redhat.com, atishp@rivosinc.com, cade.richard@berkeley.edu, jamestiotio@gmail.com Subject: [kvm-unit-tests PATCH v2 1/4] lib: Add limits.h Date: Thu, 8 Aug 2024 17:42:25 +0200 Message-ID: <20240808154223.79686-7-andrew.jones@linux.dev> In-Reply-To: <20240808154223.79686-6-andrew.jones@linux.dev> References: <20240808154223.79686-6-andrew.jones@linux.dev> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT We already include limits.h from a couple places (libfdt and the sbi test for riscv). We should provide our own limits.h rather than depend on the build environment as some cross environments may not support it (building riscv with a ilp32d toolchain fails, for example). We guard each definition to ensure we only provide them when the sizes match our expectations. If something is strange then the define won't be created, and either the includer won't notice since it wasn't used or the build will break and limits.h can be extended. Signed-off-by: Andrew Jones --- lib/limits.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 lib/limits.h diff --git a/lib/limits.h b/lib/limits.h new file mode 100644 index 000000000000..650085c68e5d --- /dev/null +++ b/lib/limits.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef _LIMITS_H_ +#define _LIMITS_H_ + +#if __CHAR_BIT__ == 8 +# if __CHAR_UNSIGNED__ +# define CHAR_MIN 0 +# define CHAR_MAX __UINT8_MAX__ +# else +# define CHAR_MAX __INT8_MAX__ +# define CHAR_MIN (-CHAR_MAX - 1) +# endif +#endif + +#if __SHRT_WIDTH__ == 16 +# define SHRT_MAX __INT16_MAX__ +# define SHRT_MIN (-SHRT_MAX - 1) +# define USHRT_MAX __UINT16_MAX__ +#endif + +#if __INT_WIDTH__ == 32 +# define INT_MAX __INT32_MAX__ +# define INT_MIN (-INT_MAX - 1) +# define UINT_MAX __UINT32_MAX__ +#endif + +#if __LONG_WIDTH__ == 64 +# define LONG_MAX __INT64_MAX__ +# define LONG_MIN (-LONG_MAX - 1) +# define ULONG_MAX __UINT64_MAX__ +#elif __LONG_WIDTH__ == 32 +# define LONG_MAX __INT32_MAX__ +# define LONG_MIN (-LONG_MAX - 1) +# define ULONG_MAX __UINT32_MAX__ +#endif + +#if __LONG_LONG_WIDTH__ == 64 +# define LLONG_MAX __INT64_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1) +# define ULLONG_MAX __UINT64_MAX__ +#endif + +#endif /* _LIMITS_H_ */ From patchwork Thu Aug 8 15:42:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 13757865 Received: from out-176.mta0.migadu.com (out-176.mta0.migadu.com [91.218.175.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F06B918FC8C for ; Thu, 8 Aug 2024 15:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723131758; cv=none; b=LbvXku+TuaFIx0KNRraADAFqbkWgMBzwR2cNxkbQvXUMt+ZKkRT7GHLyNAX0E9UQQWaR8IhBZ9+vfrcq4I+LsixCaUxMK9etJYylRiDVsfOyUxzVPIrZPSLPbj/x53fTZqdRteUc+owCP2hGenQmrr7B53VN+n9z46mBpcbMNeY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723131758; c=relaxed/simple; bh=CgK8IQsCFIqZyQM74+tfbF6V14abW0bGt2YLw7wtktQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wzggd/tpsxt8RLgQoWKoHl3weJxLxb5yll5MqCPTogwwFVopP8A8grJTlrChXgi86jDBUPVen/5GFsrTpz/kC7CRkvg+W0OTRsRWyUDlIoaLnUdQA8k0ErW0Bt9ePCLBbIg8Rf/OQh8Sv+KzGNlsI39Xw4foSUZlHo2W1Yg9Ic8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=IEhBCwlo; arc=none smtp.client-ip=91.218.175.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="IEhBCwlo" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1723131754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HzOqAtg2J4AwG0o9+R6F8Ao/GNJA6cEB1EV+uLHrR9g=; b=IEhBCwloanW/93UZXk0oJNfWI1BGtyZxUGck6bpD+/Ic/lkltssMpVab4L0Ik5qReKitFL AfskR2H2gS2kIcXqqK3jwWvtbeqTIYWeAFGn0DrcHw2QRsBZlprlxOtr1r6GOPhBAbEa+W BXx/DrqCQj5tF3qrFfhkNSlab/HvYag= From: Andrew Jones To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Cc: pbonzini@redhat.com, thuth@redhat.com, atishp@rivosinc.com, cade.richard@berkeley.edu, jamestiotio@gmail.com Subject: [kvm-unit-tests PATCH v2 2/4] riscv: Build with explicit ABI Date: Thu, 8 Aug 2024 17:42:26 +0200 Message-ID: <20240808154223.79686-8-andrew.jones@linux.dev> In-Reply-To: <20240808154223.79686-6-andrew.jones@linux.dev> References: <20240808154223.79686-6-andrew.jones@linux.dev> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT If we add -mabi to the command line then compilers that are built to support multiple ABIs may be used for both rv32 and rv64 builds, so add it for that reason. We also need the right linker flags, so add those too and throw in a trimming of the ISA string (drop fd) in order to keep it minimal. Signed-off-by: Andrew Jones --- riscv/Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/riscv/Makefile b/riscv/Makefile index b0cd613fcd8c..7906cef7f199 100644 --- a/riscv/Makefile +++ b/riscv/Makefile @@ -64,13 +64,15 @@ define arch_elf_check = $(error $(1) has unsupported reloc types)) endef -ISA_COMMON = mafdc_zicsr_zifencei_zihintpause +ISA_COMMON = imac_zicsr_zifencei_zihintpause ifeq ($(ARCH),riscv64) -CFLAGS += -march=rv64i$(ISA_COMMON) -CFLAGS += -DCONFIG_64BIT +CFLAGS += -DCONFIG_64BIT +CFLAGS += -mabi=lp64 -march=rv64$(ISA_COMMON) +LDFLAGS += -melf64lriscv else ifeq ($(ARCH),riscv32) -CFLAGS += -march=rv32i$(ISA_COMMON) +CFLAGS += -mabi=ilp32 -march=rv32$(ISA_COMMON) +LDFLAGS += -melf32lriscv endif CFLAGS += -DCONFIG_RELOC CFLAGS += -mcmodel=medany From patchwork Thu Aug 8 15:42:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 13757866 Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F34718FC8C for ; Thu, 8 Aug 2024 15:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723131762; cv=none; b=HE/jbZuzif0xpJATZFViJmpXvsH2GzjTZ7rXOFKc+z8tnaSMs80tDj/qZcxucDyEGvMI2eeBI5jj5884y935IC5EKROXjbQDv52Q9Rysac1BPgy0SlKiuAtX6aE2bcR/jpk74W2Rz2ibWpuLiGLNHEQ3hzShY6cOGXTpw1tle6g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723131762; c=relaxed/simple; bh=uiXQyD9lmTCAF9P+n5F9n1i9EzOipXcBsoGpy1BJ1hc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jC/urqM/IzAbgPhDjLkCJj/fyOwBfUtRdepy7+ab/7oNreBmRozR2piTnGcex/egA0e6FpJVdozK45Lxw27J4BrtfX2sWtdmqO/9+QoaAN9F6YA7t5evWyVwZeoBWEMPY533jysHrgpxnszYtxXa4HTV91DFCNKn+vYvNvndavQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=SEIUNKdH; arc=none smtp.client-ip=95.215.58.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="SEIUNKdH" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1723131758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oA9KmlKZBLE/Aw+uRRLrNfgxq/FHBz/gMkuU++tzyD8=; b=SEIUNKdHpzxfruEtT/QF4MteMcfKQY/W9IUp4DyPoZ/LUXYxOLQtj0G2q+HOHS753P5i6R Wc2HzBgSEMLqwjtSPSQEfsOj5MeB2pKAz3YAy5aKYoALsPwTDnhcS2Pj5kOz/VsN0AHm/G VZiYMnVprZugKX5p/t8U+3P7LTj+5JQ= From: Andrew Jones To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Cc: pbonzini@redhat.com, thuth@redhat.com, atishp@rivosinc.com, cade.richard@berkeley.edu, jamestiotio@gmail.com Subject: [kvm-unit-tests PATCH v2 3/4] riscv: Fix out-of-tree builds Date: Thu, 8 Aug 2024 17:42:27 +0200 Message-ID: <20240808154223.79686-9-andrew.jones@linux.dev> In-Reply-To: <20240808154223.79686-6-andrew.jones@linux.dev> References: <20240808154223.79686-6-andrew.jones@linux.dev> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT My riscv compiler doesn't seem to want to create directories as other compilers are apparently doing. There's only a few of them, so let's just manually create them in configure. And riscv also needed '-I lib' in CFLAGS. Signed-off-by: Andrew Jones --- configure | 8 ++++++-- riscv/Makefile | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/configure b/configure index db15e85d6ac7..27ae9cc89657 100755 --- a/configure +++ b/configure @@ -418,12 +418,16 @@ rm -f lib/asm asm="asm-generic" if [ -d "$srcdir/lib/$arch/asm" ]; then asm="$srcdir/lib/$arch/asm" + mkdir -p "lib/$arch" +elif [ -d "$srcdir/lib/$arch_libdir/asm" ]; then + asm="$srcdir/lib/$arch_libdir/asm" + mkdir -p "lib/$arch_libdir" elif [ -d "$srcdir/lib/$testdir/asm" ]; then asm="$srcdir/lib/$testdir/asm" + mkdir -p "lib/$testdir" fi -mkdir -p lib ln -sf "$asm" lib/asm - +mkdir -p lib/generated lib/libfdt # create the config cat < config.mak diff --git a/riscv/Makefile b/riscv/Makefile index 7906cef7f199..179a373dbacf 100644 --- a/riscv/Makefile +++ b/riscv/Makefile @@ -80,7 +80,7 @@ CFLAGS += -mstrict-align CFLAGS += -std=gnu99 CFLAGS += -ffreestanding CFLAGS += -O2 -CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/libfdt +CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/libfdt -I lib asm-offsets = lib/riscv/asm-offsets.h include $(SRCDIR)/scripts/asm-offsets.mak From patchwork Thu Aug 8 15:42:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 13757867 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E70619004D for ; Thu, 8 Aug 2024 15:42:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723131765; cv=none; b=dMRk7EqknIPt+aTRgvzLxZ6wV09ImPLyhZknlVijatRE3iTWd3g5VYaTVoXepFh/cpBwh56QM41Cg+PJXWk6XO99WDrerkIJdc3ofts6IVuXoNUQiUZuXMsau1DoT1iMw/QxM7016p6GUTDGKKgvG8sx64qVf7dSClbwBHoMkQQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723131765; c=relaxed/simple; bh=jsi+iMy1Wh7imB5R35XeD76Eyu76Vvq0ojuhydvg2hY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ejHBk7+pEl2mEQuSFr2BbE7p2ORZZCfYFsEyrcsxa9d2N3LEIEOuLIDBhdjpocIk8xmiXI3ZDwjN/GbcYCUWT8DwRVpydfk/rDObeR4z9+n0Mlvcy16gWw8XeIrPT/RKGAi/2Zc/MV8GulPl26FG+ef0hoJ/QCisyYE0Yi6TshM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=DhOdt5pn; arc=none smtp.client-ip=95.215.58.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="DhOdt5pn" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1723131761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZOJpg8s6ygbLQkQYpNC1VIrC+vX7StgdkAjnRcG8SnM=; b=DhOdt5pnL96SYHY2G5OucIgq1eOLgMpIPLbVf/LWFFY/v+nsd7vGjOMRdAp7kH2XrxNYa4 ZXKrickiBSvYT8P1qOVaenZuJV5wFUcwXgd4pxoKhOgYzm818t43+dvLm1HDtqRjA18aag To8xV3mGFexUaHIWOeezJZbS/zYsc/0= From: Andrew Jones To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Cc: pbonzini@redhat.com, thuth@redhat.com, atishp@rivosinc.com, cade.richard@berkeley.edu, jamestiotio@gmail.com Subject: [kvm-unit-tests PATCH v2 4/4] riscv: Extend gitlab CI Date: Thu, 8 Aug 2024 17:42:28 +0200 Message-ID: <20240808154223.79686-10-andrew.jones@linux.dev> In-Reply-To: <20240808154223.79686-6-andrew.jones@linux.dev> References: <20240808154223.79686-6-andrew.jones@linux.dev> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Fedora's riscv64 gcc supports ilp32 so enable 32-bit RISCV testing. And use the out-of-tree template for the 32-bit build to get that covered too. Also add EFI build testing and, since Fedora has been updated which brings in a later QEMU, we can now use the 'max' cpu type. Signed-off-by: Andrew Jones --- .gitlab-ci.yml | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e0eb85a94910..180ef6e78558 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -133,18 +133,44 @@ build-ppc64le: | tee results.txt - if grep -q FAIL results.txt ; then exit 1 ; fi -# build-riscv32: -# Fedora doesn't package a riscv32 compiler for QEMU. Oh, well. +build-riscv32: + extends: .outoftree_template + script: + - dnf install -y qemu-system-riscv gcc-riscv64-linux-gnu + - mkdir build + - cd build + - ../configure --arch=riscv32 --cross-prefix=riscv64-linux-gnu- + - make -j2 + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh + selftest + sbi + | tee results.txt + - grep -q PASS results.txt && ! grep -q FAIL results.txt -# Select 'rv64' with PROCESSOR_OVERRIDE in case QEMU is too old to have 'max' build-riscv64: extends: .intree_template script: - dnf install -y qemu-system-riscv gcc-riscv64-linux-gnu - ./configure --arch=riscv64 --cross-prefix=riscv64-linux-gnu- - make -j2 - - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\n" >test-env - - PROCESSOR_OVERRIDE=rv64 ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh + selftest + sbi + | tee results.txt + - grep -q PASS results.txt && ! grep -q FAIL results.txt + +build-riscv64-efi: + extends: .intree_template + script: + - dnf install -y edk2-riscv64 qemu-system-riscv gcc-riscv64-linux-gnu + - cp /usr/share/edk2/riscv/RISCV_VIRT_CODE.fd . + - truncate -s 32M RISCV_VIRT_CODE.fd + - ./configure --arch=riscv64 --cross-prefix=riscv64-linux-gnu- --enable-efi + - make -j2 + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh selftest sbi | tee results.txt