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: 1970592 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=XLcbdTJL; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=F15Wj0G7; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wfrs75cJhz1yfV for ; Fri, 9 Aug 2024 01:42:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zwe5s3PtJWTjirDvvQvWWmr++n5RcR4Iz+ZEdoZIbQ0=; b=XLcbdTJLAmkxfZ Tz/eIJjH1xwRPAJy8JOEveH1dBrPdg2RAtNGQ6UNbeT+oXuPvuEMF7Z8mjbqswDFcB3ZvyiRVNFMA nkY09D3jH1Xx/l894muthVzvIXWaP5eM7c9MHMP3wa7hro4kLBRJ5yz1zE1uR2IgJmVvWvcXtyPNl /7mSNuIarZx1SbkOAuLGfJDrF0z/Fe738PcLxq5twJxkKqkzKLFiRiMjsJGnqZvGqHzPp0IyZ/ZFf XNqkAeokyoVCXlTM8emxlSvcgS4PrVm/hAQVjOnW1LJZ2Hpw2/7f+OPBfmcy3FXA2XnIyFtrO0+Z5 l63uctGZokAsb1RoasnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc5He-00000008njg-2662; Thu, 08 Aug 2024 15:42:34 +0000 Received: from out-183.mta1.migadu.com ([95.215.58.183]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc5Hb-00000008nhZ-1yRx for kvm-riscv@lists.infradead.org; Thu, 08 Aug 2024 15:42:32 +0000 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> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_084231_679642_D644549E X-CRM114-Status: GOOD ( 11.03 ) X-Spam-Score: -2.8 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [95.215.58.183 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [95.215.58.183 listed in bl.score.senderscore.com] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [95.215.58.183 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [95.215.58.183 listed in sa-trusted.bondedsender.org] X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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: 1970594 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=cC9fMSkI; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=IEhBCwlo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WfrsH4tr9z1yf8 for ; Fri, 9 Aug 2024 01:42:43 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Vmtyx/DAxzwoiQ/JSbdaoyHHNHcqTKG5t675Z4iAfbM=; b=cC9fMSkItlpHpB HoX8HQN0PVzMqpcxfOSrJ86m/DbkNkhbec5k6QL8kE15MUXlb0EVgsWKssrgxUjTDCIckO/h8Zvb/ B5hfSIIQ3UQoT+4/vqoXxu/ibOSxK4RYxhDsCZScvMk7vf1pu2F3cG62vlO0tOlvBzzVQN99HYVY6 E2FCNLXf87rkm9RxtYHzilmr0k0XtbJsfbp89Ax1xAHkraAxUjNrpdL7eKILC5A2cCa1BlV1hkg/+ sOWzUlLQSFHTUXUIqPvKZPWlFAFHW3RXG4/TlmZiE2vcGvqboMvc5+tyOBWVy+//lgMS1LXGTRa13 GYbHPT84J7N1I+mynNxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc5Hm-00000008nnA-0GIc; Thu, 08 Aug 2024 15:42:42 +0000 Received: from out-175.mta0.migadu.com ([2001:41d0:1004:224b::af]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc5Hi-00000008nkU-3ZHj for kvm-riscv@lists.infradead.org; Thu, 08 Aug 2024 15:42:40 +0000 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> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_084239_035231_17CDAF51 X-CRM114-Status: UNSURE ( 8.42 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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: 1970595 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=D3uF7VUX; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=SEIUNKdH; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WfrsJ3DP5z1yf8 for ; Fri, 9 Aug 2024 01:42:44 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o9+jvlwwRCYry/fTxLZJnNojHW3mGAPBTul3XWxeGa0=; b=D3uF7VUXWkDuq5 5uRggqFx7QRYJCYllqa6IXMgN0cLxLYB9u9sjMdZx3TbQBuum9Kee9TNcA+lYIJ9kFlELv+tXqLNI pkccFSK6zHGmnRxHyU2wB1bNAadofSXNIvNdfnnRWhGA7arw4lIH3fCYHDYlnLOX4oDUiIO6XDbTk gYyJErFUy7nvmfcSWk3fOlJTwgsnNnq+V6mZ2wKm1kS0B3iqAswWs6YzmvNufGPOo57BfdwkamlIY GJ/hj01dKZGy+giYMq+xzTc3M2vn91errDA025xEaA7PUiM8j/Y7EG1iEIG1ujaDWvc3y1+Uss8c/ NBn83OUO82BZ49CwyovA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc5Hn-00000008nny-0Y0s; Thu, 08 Aug 2024 15:42:43 +0000 Received: from out-188.mta1.migadu.com ([95.215.58.188]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc5Hk-00000008nlV-1zzY for kvm-riscv@lists.infradead.org; Thu, 08 Aug 2024 15:42:41 +0000 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> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_084240_683706_3C530B03 X-CRM114-Status: UNSURE ( 9.32 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.8 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [95.215.58.188 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [95.215.58.188 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [95.215.58.188 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [95.215.58.188 listed in bl.score.senderscore.com] X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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: 1970596 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=l/hDEpO7; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=DhOdt5pn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WfrsN02pBz1yf8 for ; Fri, 9 Aug 2024 01:42:48 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NX6183vk8C4//uDaGb3OuxeJVKUkzPpyIaZvTihPu5Y=; b=l/hDEpO71GQT7Z 4SCFzQfWh4ezpqPQVZ0ZeKkgo73SsWl4QuDfPUAyGNuDQHtcd98GvdYaqCNSlOleb2ElOzXSb4zU1 vv6OLglMRte2n2IuhuePASCGcIrXg/1YVKtGDQSryXlFnugygx3+LJOtCYkf8tXE3wYD767QHvyCh BXoyQkC4rwE9Olxw6hixeR0rcl6xGVW1iIEI1Y1okqhSIH7zOuxU8c+xojWNI1IxekNlfI30lt06R comfyakx45qEU6PyCudlKATkZeErr5HhrvR4qxOCZs1n768iPdwhYCyyx7C51Ro6+KbrqtGRb81jq cFO3BQFrGF2OWtHm5a6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc5Hq-00000008nrF-3CIz; Thu, 08 Aug 2024 15:42:46 +0000 Received: from out-172.mta1.migadu.com ([95.215.58.172]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc5Hn-00000008nnB-3QDe for kvm-riscv@lists.infradead.org; Thu, 08 Aug 2024 15:42:45 +0000 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> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_084244_022305_1E239070 X-CRM114-Status: UNSURE ( 8.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.8 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [95.215.58.172 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [95.215.58.172 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [95.215.58.172 listed in sa-trusted.bondedsender.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [95.215.58.172 listed in bl.score.senderscore.com] X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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