From patchwork Sat Dec 21 14:44:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13917862 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 029C1E7718B for ; Sat, 21 Dec 2024 14:44:47 +0000 (UTC) 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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=42nHtuwnLJ/KXr2DDIt5jQsrmasmHL+IZZIbu3GDnU8=; b=1uaz65qHzMSGZV j0/PMK2pOzh+UUq2f2HWJ7NnjKPUhJE2ETTttDJ7/hGvAmFO9VOAXsEvtqCX/AusF44UPInMna1/L XhITGZaHi2QxrsvSdc20RNDUaRXeR2+Gnxf7+6UomKoF6zWIZbVhgrQDBquVYMmcHnS7BBwp89Nhj QyhjWgJN6ACBm+ESdV+r4dYvT5X70xlqBLKF9esXKlp3QFrVnO1NZPztWdMIiZReEabdsgdUdzJiZ NDbyc1qHN/md2S6wERGty0717XZWHIIeakodUycF7+yqgR9jIFemmCF7hAUYNP8FZJt3v1YXNnjEi ZOJgiCFZ9YECk0EQL84Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tP0if-000000074je-27AJ; Sat, 21 Dec 2024 14:44:41 +0000 Received: from todd.t-8ch.de ([2a01:4f8:c010:41de::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tP0ib-000000074gT-2Kvm for linux-riscv@lists.infradead.org; Sat, 21 Dec 2024 14:44:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1734792272; bh=nlgKA1aWXtMZ4vLJ+M3UslYSVWgrW4lQ46FIgxLbuk0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=KT0linBfSK3yb1tVBfOsrUo0Qmsy5DtV5NcKzkVfQADhnVJN5E0BXAJCApmsPsHr3 zVQ0RXn1dybDs65olAHAF0Rn8yy9IR9JJcg+jYFJGtfGw1QqslTzaN5dc1I3IX/PcO i5EQl6N4KZ5WUhbhi1y94htVb3UCXl/uEKsEVeZA= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 21 Dec 2024 15:44:28 +0100 Subject: [PATCH 1/6] tools/nolibc: add support for waitid() MIME-Version: 1.0 Message-Id: <20241221-nolibc-rv32-v1-1-d9ef6dab7c63@weissschuh.net> References: <20241221-nolibc-rv32-v1-0-d9ef6dab7c63@weissschuh.net> In-Reply-To: <20241221-nolibc-rv32-v1-0-d9ef6dab7c63@weissschuh.net> To: Willy Tarreau , Shuah Khan , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, Zhangjin Wu , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734792271; l=1451; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=nlgKA1aWXtMZ4vLJ+M3UslYSVWgrW4lQ46FIgxLbuk0=; b=Ig+cd8xPaVLdOY8TmrPbOeWu/tTdW9wbIV95eO+fM2u8WdX0eUj3Ua2COzeHZgYnv1GPCWsmN o6sEOaa5ANfBUMHGbBZVGucYzVcpNMAel6JpLdzkUuzwQvKrCwZnr79 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241221_064437_743969_82315399 X-CRM114-Status: UNSURE ( 6.30 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-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: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org waitid() is the modern variant of the family of wait-like syscalls. Some architectures have dropped support for wait(), wait4() and waitpid() but all of them support waitid(). It is more flexible and easier to use than the older ones. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/sys.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index 7b82bc3cf107439a3f09f98b99d4d540ffb9ba2a..d4a5c2399a66b200ebf7ab249569cce2285481a5 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -23,6 +23,7 @@ #include #include #include +#include #include "arch.h" #include "errno.h" @@ -1225,6 +1226,23 @@ pid_t waitpid(pid_t pid, int *status, int options) } +/* + * int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options); + */ + +static __attribute__((unused)) +int sys_waitid(int which, pid_t pid, siginfo_t *infop, int options, struct rusage *rusage) +{ + return my_syscall5(__NR_waitid, which, pid, infop, options, rusage); +} + +static __attribute__((unused)) +int waitid(int which, pid_t pid, siginfo_t *infop, int options) +{ + return __sysret(sys_waitid(which, pid, infop, options, NULL)); +} + + /* * ssize_t write(int fd, const void *buf, size_t count); */ From patchwork Sat Dec 21 14:44:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13917867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8AA39E7718B for ; Sat, 21 Dec 2024 14:44:55 +0000 (UTC) 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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rtLPk3JSKon8qPGBVPYQ/OeibFbD9wggjNRFFZ0addQ=; b=RMg1aK0YGZrzXF 83maO1A8mu+KYXtOlIojM7oVO4ljRrEbmHXQh7S6qBuQplHH0e7J6y84XT4UhcJ6kCl5gaUtAWDDs NY+EQcDb9JsslN7zBfpRFCEw71MniOF1z+hE/6+AGY5jgIgBsIICiVdwo4PGfRz8LTBRMLEnJZek8 itaDEWkJQ7/vGPGAttNfiuN2uepetTV9zwxhQNI6DF5Zlats1UIv8i+3nA8dEE0bpqo22bYpArVdF ef4v0LhTRBobFwtS/pcPWHtZWdhQu17LcjOUWstBqTzyhyAbZTvfIEKQbmzoJbLrDDmaTc6BGKqnS PU80+uS9HPPzUpdCwiEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tP0ih-000000074kx-0jH8; Sat, 21 Dec 2024 14:44:43 +0000 Received: from todd.t-8ch.de ([2a01:4f8:c010:41de::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tP0ic-000000074gX-1XWS for linux-riscv@lists.infradead.org; Sat, 21 Dec 2024 14:44:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1734792272; bh=nj0Jq2wR9LzNkifobwaqgqXXDXIUpTLkrlfLIfSBrB4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qlYyNW/izxCwfFi+f66Ru0I8+DJsNe4VI5K+fVDh/dW7IvmATed3cwBw4PqoiW2RK nRwH8DmOTcq334Zcjbx24G7FaJV3tJhMvCwuQi1xNZ03ETZz3yPX1I63rvfy8zmSUs Hg7mfMhSeLDztySrOWH0RwKshbp9f8lGc1urPlNI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 21 Dec 2024 15:44:29 +0100 Subject: [PATCH 2/6] selftests/nolibc: use waitid() over waitpid() MIME-Version: 1.0 Message-Id: <20241221-nolibc-rv32-v1-2-d9ef6dab7c63@weissschuh.net> References: <20241221-nolibc-rv32-v1-0-d9ef6dab7c63@weissschuh.net> In-Reply-To: <20241221-nolibc-rv32-v1-0-d9ef6dab7c63@weissschuh.net> To: Willy Tarreau , Shuah Khan , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, Zhangjin Wu , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734792271; l=1420; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=nj0Jq2wR9LzNkifobwaqgqXXDXIUpTLkrlfLIfSBrB4=; b=nvClkbgo3WfomII9Gy/xuFDJ9bB9UMA1pDy2NmiSII3/8wtxOEGKSgH4f7omKIQ1AdzBh90WO KikHBwUy9gaDVBG4QiL3SWkr/UlaGwLPzeAQUIDgyz+zlaJNiyN5UwW X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241221_064438_577883_F4FE123C X-CRM114-Status: UNSURE ( 8.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-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: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Newer archs like riscv32 don't provide waitpid() anymore. Switch to waitid() which is available everywhere. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 6fba7025c5e3c002085862fdf6fa950da6000d6c..60c50968d3630e4909a5ecb2400770baaf7c2add 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -1323,7 +1323,8 @@ static int run_protection(int min __attribute__((unused)), int max __attribute__((unused))) { pid_t pid; - int llen = 0, status; + int llen = 0, ret; + siginfo_t siginfo = {}; struct rlimit rlimit = { 0, 0 }; llen += printf("0 -fstackprotector "); @@ -1361,10 +1362,11 @@ static int run_protection(int min __attribute__((unused)), return 1; default: - pid = waitpid(pid, &status, 0); + ret = waitid(P_PID, pid, &siginfo, WEXITED); - if (pid == -1 || !WIFSIGNALED(status) || WTERMSIG(status) != SIGABRT) { - llen += printf("waitpid()"); + if (ret != 0 || siginfo.si_signo != SIGCHLD || + siginfo.si_code != CLD_KILLED || siginfo.si_status != SIGABRT) { + llen += printf("waitid()"); result(llen, FAIL); return 1; } From patchwork Sat Dec 21 14:44:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13917861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1C31E7718D for ; Sat, 21 Dec 2024 14:44:48 +0000 (UTC) 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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=W2qvVlmEG8QDrbc8/4LMqWup4TS+JaEtxYh3chaacrQ=; b=knqH1qQiKDbrAj /Hj17KXuf/yxcv398wSuKJkoKfDBhyA3gYdNubqDW1/BM8RouUtauS8ygpwOTKc6pfRGG0S8SXKGX 86sVzmuk920wkKUHcaf+F7fzNTxBgbiKpZAjmKceIBO+U0nqSKBdzeosjU3ZJtmNk63ol8vIRmwlR HlKDiOPvz37NAStFaU29GlvYM+p70U67E57ZGH7avMReZvXE/RGkkOFOGocoX5Y0cLDbMpwSVnje/ bhTqY/5ZuN6gF2JLVtt8BdDct+ZgF0cQPvqJHy0XY1iYGBdqmMOvFJOA8COrN+v5NjhhxQIhHzV3y F6e3FE/eAvkprqmVdtHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tP0ie-000000074j6-32Lr; Sat, 21 Dec 2024 14:44:40 +0000 Received: from todd.t-8ch.de ([159.69.126.157]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tP0ib-000000074gP-2gpH for linux-riscv@lists.infradead.org; Sat, 21 Dec 2024 14:44:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1734792272; bh=frLR13FDv9wGOaLeaaK7JPvRthh2lmgaUpvebzfmFKY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=m4YGyeh0O8c7q7qd3hllODqv1NEk/dSEeN2KiOzWopTqJT8c88iccwJ+z3pGXSR95 l0DAaGgpyQ/i6lja6MWKOd9M76sw8LGZRGHywfokjuY5fUxDPwmM4rQluWr/OBTbqt 4BjfvjY2u7lvXw+UICfki3qgYFG4OxkikAsViNjE= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 21 Dec 2024 15:44:30 +0100 Subject: [PATCH 3/6] selftests/nolibc: use a pipe to in vfprintf tests MIME-Version: 1.0 Message-Id: <20241221-nolibc-rv32-v1-3-d9ef6dab7c63@weissschuh.net> References: <20241221-nolibc-rv32-v1-0-d9ef6dab7c63@weissschuh.net> In-Reply-To: <20241221-nolibc-rv32-v1-0-d9ef6dab7c63@weissschuh.net> To: Willy Tarreau , Shuah Khan , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, Zhangjin Wu , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734792271; l=1746; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=frLR13FDv9wGOaLeaaK7JPvRthh2lmgaUpvebzfmFKY=; b=gs7amVw+s5LZnTCX6MU6wJ0JxnVhWUnmJJklLIlAuqsF2BBtLDWPmuYdOZ7rs4I2iqnCfdCrk ngZv2FnmjTaDmNBrchU3eQTkK2kVmj4kdS8KwMiUq03Giv9QM2uxWum X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241221_064437_827447_BEF62C0D X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-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: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Not all architectures implement lseek(), for example riscv32 only implements llseek() which is not equivalent to normal lseek(). Remove the need for lseek() by using a pipe instead. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 60c50968d3630e4909a5ecb2400770baaf7c2add..3685c13a9a6b8fd5110715b95ff323cdcb29481a 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -1229,19 +1229,20 @@ int run_stdlib(int min, int max) static int expect_vfprintf(int llen, int c, const char *expected, const char *fmt, ...) { - int ret, fd; + int ret, pipefd[2]; ssize_t w, r; char buf[100]; FILE *memfile; va_list args; - fd = open("/tmp", O_TMPFILE | O_EXCL | O_RDWR, 0600); - if (fd == -1) { - result(llen, SKIPPED); - return 0; + ret = pipe(pipefd); + if (ret == -1) { + llen += printf(" pipe() != %s", strerror(errno)); + result(llen, FAIL); + return 1; } - memfile = fdopen(fd, "w+"); + memfile = fdopen(pipefd[1], "w"); if (!memfile) { result(llen, FAIL); return 1; @@ -1257,13 +1258,10 @@ static int expect_vfprintf(int llen, int c, const char *expected, const char *fm return 1; } - fflush(memfile); - lseek(fd, 0, SEEK_SET); - - r = read(fd, buf, sizeof(buf) - 1); - fclose(memfile); + r = read(pipefd[0], buf, sizeof(buf) - 1); + if (r != w) { llen += printf(" written(%d) != read(%d)", (int)w, (int)r); result(llen, FAIL); From patchwork Sat Dec 21 14:44:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13917863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22164E7718E for ; Sat, 21 Dec 2024 14:44:49 +0000 (UTC) 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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/35MfDozCZcQ0TwW5QYE66xQLEMasgyuWnGV9laf1pE=; b=rHuRUxPvmTocmx kadXUr6YWXGXDiAA3/D/DV0Tz+ySejvNnPl5XFOKRcnOIMR4mhWMROmeXQ/0Bcdz+FKjqifCZwsS8 /XpH38ZMjSbTWQcFlvqTKAXLQxMS56qXaqAs6u87QPTrq4fzg7WtFFtotPcl2mUZt3EFpeU7tL1dD LOtb6hRJp/HiwLGIJHMowbDJeSro782xFXpe/kmHITUJiz957m7zNCf2lYlTSOfd9Nu9zj8CxM+Oz 3k8fwyA46y7sw/VWc0eHr345U3lkkEHi6Cm7ngTqwXaFk5Sda1EtlGONaAoDWUMmFzZhf9oWVoP6l +9Nb9SiYclb4YPD61CAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tP0ih-000000074lo-3h6p; Sat, 21 Dec 2024 14:44:43 +0000 Received: from todd.t-8ch.de ([159.69.126.157]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tP0ib-000000074gS-3anT for linux-riscv@lists.infradead.org; Sat, 21 Dec 2024 14:44:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1734792272; bh=bg5UlBq3THh05UiKb+gXkEUVzYOv1u5Ao6jXpQiecuk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ZS7EZHAA6phWrr5kKUxHD0QIEi+utM+nEXN9V49sJb7AL7HkSQuy925253MyE62Bu SzGsioEPcGROh9PuN0FY16lEKw+LynhgetjhQCetRVY4zlLU8R43poWaR6hzWhi0Yx MdeeGOeJrRT5/84EYKMB3XyWZ8L7dwvZP+x4guUM= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 21 Dec 2024 15:44:31 +0100 Subject: [PATCH 4/6] selftests/nolibc: skip tests for unimplemented syscalls MIME-Version: 1.0 Message-Id: <20241221-nolibc-rv32-v1-4-d9ef6dab7c63@weissschuh.net> References: <20241221-nolibc-rv32-v1-0-d9ef6dab7c63@weissschuh.net> In-Reply-To: <20241221-nolibc-rv32-v1-0-d9ef6dab7c63@weissschuh.net> To: Willy Tarreau , Shuah Khan , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, Zhangjin Wu , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734792271; l=1803; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=bg5UlBq3THh05UiKb+gXkEUVzYOv1u5Ao6jXpQiecuk=; b=Z4n3QT+/74DaRTLgeQKACFugaghlokDmCaupwH84G5FyZGHX+NZ4Uz+1ctl44mrhDCNV8YixA BvDcB8OBSPOBSkOpcX8RvSpqpZNk+Dg4E09ySvywOLmZOSFr/t1kgZI X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241221_064438_041626_BB593EBB X-CRM114-Status: UNSURE ( 8.69 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-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: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The riscv32 architecture is missing many of the older syscalls. Instead of providing wrappers for everything at once, introducing a lot of complexity, skip the tests for those syscalls for now. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 3685c13a9a6b8fd5110715b95ff323cdcb29481a..0e0e3b48a8c3a6802c6989954b6f3a7c7258db43 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -302,7 +302,10 @@ int expect_syszr(int expr, int llen) { int ret = 0; - if (expr) { + if (errno == ENOSYS) { + llen += printf(" = ENOSYS"); + result(llen, SKIPPED); + } else if (expr) { ret = 1; llen += printf(" = %d %s ", expr, errorname(errno)); result(llen, FAIL); @@ -342,7 +345,10 @@ int expect_sysne(int expr, int llen, int val) { int ret = 0; - if (expr == val) { + if (errno == ENOSYS) { + llen += printf(" = ENOSYS"); + result(llen, SKIPPED); + } else if (expr == val) { ret = 1; llen += printf(" = %d %s ", expr, errorname(errno)); result(llen, FAIL); @@ -367,7 +373,9 @@ int expect_syserr2(int expr, int expret, int experr1, int experr2, int llen) int _errno = errno; llen += printf(" = %d %s ", expr, errorname(_errno)); - if (expr != expret || (_errno != experr1 && _errno != experr2)) { + if (errno == ENOSYS) { + result(llen, SKIPPED); + } else if (expr != expret || (_errno != experr1 && _errno != experr2)) { ret = 1; if (experr2 == 0) llen += printf(" != (%d %s) ", expret, errorname(experr1)); From patchwork Sat Dec 21 14:44:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13917866 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 69FF1E77190 for ; Sat, 21 Dec 2024 14:44:51 +0000 (UTC) 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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9cGpj7Rd8lXLpeH4nQXShbPJ84HhbwjhsQxiNZqUMng=; b=093St8JQUnncxZ xC8MI/rK4HBU1t5kt47cZqf3v+t4Y0LZf+vD0hjQZZSuA71GyjpqRAv+pcT9+8iaF2S3IsWSkxbLn OZt+gF4R8Ns4wJm7Z5Cu0qmB4OHJwcgDC9SRTsvWMJ4885RWSZlJXQOuQB+9AsgN7tTCwvJV/lDrZ uM+0XhvIUtS/fTlUFqEuUTtl90RWEJuwAThCm7Hvpv7KvWePehHa+0LsRMHTrqnit6Q2mLIfYEFWP Y7AlNycOI8BSjetx6wiR+CVGEVGX+MLh7Sdm9W2v1FHv5UgHceaux9HOvkCF3+4PjFnG+CUR+xQ1x tSaJGuPbiOKu7cb+sZMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tP0il-000000074nm-0lTQ; Sat, 21 Dec 2024 14:44:47 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tP0ik-000000074nI-3Hv3 for linux-riscv@bombadil.infradead.org; Sat, 21 Dec 2024 14:44:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=MbkpemYKsYI+P+k7bprHXlgeWVbZNSQvd+OguGAwZIY=; b=dnVwkBGrrMZNquvXsobk9hxs2V qxyPOJtfRQHkQ4VHPDetHI4pBlpMIpDsR1JQvTCCxNAs8+ydP23yyXZ2FC8Cw76Cp1fDk5woQfRWA vBQCIgwkqnbmvhASNT2UNJtydOkn4wRvtlrLBVA1YO9Kkn8L4TEWwfn89dg8T2F3pX6gEGqO6dAnb Cci763+oY0Q0w83XuZ1B1U+5FHEMklFZnNHhVL735XffCC0k+DYiKZnZn1hfOGOzX1y33Xk8JC0EG JPl6lA6t6VapVhSmg71SbaOEWGg6NQjA1iqpjLEUxW6WjNBRc35AdH4RZiNJ7EeTi5di4UzkUsjV9 2OqylqUA==; Received: from todd.t-8ch.de ([159.69.126.157]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tP0ig-00000005uwl-3d46 for linux-riscv@lists.infradead.org; Sat, 21 Dec 2024 14:44:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1734792273; bh=aeC+A4pV2HWdlsm6EkBuWMFp7lqNtxjQtDsfDD7yt+U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DVfvFFAxN0lAeJgPVZ4fb4kJ1yCtViQZBydzRkTUY9RCVepnz7eL7u1gGHf9QeWPN CYTbtFkj1O7ZnXDAcYUqkeHTtKhYxmDgSMe7646IHIZ4Is4IYyZlLxtbcdSAleEK77 it8JQE1CjE1rHNNzDwHM2r+ogpqAUA9wDsdKSiQA= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 21 Dec 2024 15:44:32 +0100 Subject: [PATCH 5/6] selftests/nolibc: rename riscv to riscv64 MIME-Version: 1.0 Message-Id: <20241221-nolibc-rv32-v1-5-d9ef6dab7c63@weissschuh.net> References: <20241221-nolibc-rv32-v1-0-d9ef6dab7c63@weissschuh.net> In-Reply-To: <20241221-nolibc-rv32-v1-0-d9ef6dab7c63@weissschuh.net> To: Willy Tarreau , Shuah Khan , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, Zhangjin Wu , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734792271; l=3677; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=aeC+A4pV2HWdlsm6EkBuWMFp7lqNtxjQtDsfDD7yt+U=; b=kwEIY97BM65Wh57NezW76D9+hJKaHBZIqYvFW90fQ3JhDgz4M4S6HUudIF0hm56vsibeeWwN4 LT6zf6mEOkECwkSneF/AI1lblToMpbJR1Ko5fkodxDy3yPU3yhng7sr X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241221_144443_300340_6BF1042A X-CRM114-Status: UNSURE ( 8.59 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-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: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org riscv32 support is about the be added. To keep the naming clear and consistent with other architectures rename riscv to riscv64, as that is what it actually represents. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile | 6 ++++++ tools/testing/selftests/nolibc/run-tests.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index e92e0b88586111072a0e043cb15f3b59cf42c3a6..78f47e85b389ac229ac13f3e7c8299fb3ec92197 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -43,6 +43,7 @@ cc-option = $(call __cc-option, $(CC),$(CLANG_CROSS_FLAGS),$(1),$(2)) # configure default variants for target kernel supported architectures XARCH_powerpc = ppc XARCH_mips = mips32le +XARCH_riscv = riscv64 XARCH = $(or $(XARCH_$(ARCH)),$(ARCH)) # map from user input variants to their kernel supported architectures @@ -51,6 +52,7 @@ ARCH_ppc64 = powerpc ARCH_ppc64le = powerpc ARCH_mips32le = mips ARCH_mips32be = mips +ARCH_riscv64 = riscv ARCH := $(or $(ARCH_$(XARCH)),$(XARCH)) # kernel image names by architecture @@ -65,6 +67,7 @@ IMAGE_ppc = vmlinux IMAGE_ppc64 = vmlinux IMAGE_ppc64le = arch/powerpc/boot/zImage IMAGE_riscv = arch/riscv/boot/Image +IMAGE_riscv64 = arch/riscv/boot/Image IMAGE_s390 = arch/s390/boot/bzImage IMAGE_loongarch = arch/loongarch/boot/vmlinuz.efi IMAGE = $(objtree)/$(IMAGE_$(XARCH)) @@ -82,6 +85,7 @@ DEFCONFIG_ppc = pmac32_defconfig DEFCONFIG_ppc64 = powernv_be_defconfig DEFCONFIG_ppc64le = powernv_defconfig DEFCONFIG_riscv = defconfig +DEFCONFIG_riscv64 = defconfig DEFCONFIG_s390 = defconfig DEFCONFIG_loongarch = defconfig DEFCONFIG = $(DEFCONFIG_$(XARCH)) @@ -104,6 +108,7 @@ QEMU_ARCH_ppc = ppc QEMU_ARCH_ppc64 = ppc64 QEMU_ARCH_ppc64le = ppc64 QEMU_ARCH_riscv = riscv64 +QEMU_ARCH_riscv64 = riscv64 QEMU_ARCH_s390 = s390x QEMU_ARCH_loongarch = loongarch64 QEMU_ARCH = $(QEMU_ARCH_$(XARCH)) @@ -130,6 +135,7 @@ QEMU_ARGS_ppc = -M g3beige -append "console=ttyS0 panic=-1 $(TEST:%=NOLIB QEMU_ARGS_ppc64 = -M powernv -append "console=hvc0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_ppc64le = -M powernv -append "console=hvc0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_riscv = -M virt -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" +QEMU_ARGS_riscv64 = -M virt -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_s390 = -M s390-ccw-virtio -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_loongarch = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS = -m 1G $(QEMU_ARGS_$(XARCH)) $(QEMU_ARGS_BIOS) $(QEMU_ARGS_EXTRA) diff --git a/tools/testing/selftests/nolibc/run-tests.sh b/tools/testing/selftests/nolibc/run-tests.sh index e7ecda4ae796fbf0d389f20144511e66ce4f0b30..caa1ae40fe9a2faf8931c299aacd19716227e2b8 100755 --- a/tools/testing/selftests/nolibc/run-tests.sh +++ b/tools/testing/selftests/nolibc/run-tests.sh @@ -17,7 +17,7 @@ perform_download=0 test_mode=system werror=1 llvm= -archs="i386 x86_64 arm64 arm mips32le mips32be ppc ppc64 ppc64le riscv s390 loongarch" +archs="i386 x86_64 arm64 arm mips32le mips32be ppc ppc64 ppc64le riscv64 s390 loongarch" TEMP=$(getopt -o 'j:d:c:b:a:m:pelh' -n "$0" -- "$@") From patchwork Sat Dec 21 14:44:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13917865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CBA31E7718F for ; Sat, 21 Dec 2024 14:44:49 +0000 (UTC) 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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YcB9Zt3SpLm+yRnhl4VpiLNrbHvm4jYkhYCvb8/RDjs=; b=SdSxNZvhfc5fRj g95GaDnf+RA4nRp6vvAT9ijFQoeLE1uc7s2btJ6+7X3RZjbvR1TYbyzQn/UMBmBtMiLtrQ1RQmo7d WcOoPRi+SlAnYfBF2s3eoDqzM++b83X66HWlxVD16tRHwDMYLt7PpaGVZjRN4RhJsezds2TajGfAj J6C/sCaiiuo821buDKmK2wKp9P5az/3cwVVTXGOYuabO2xUFq9ri8dzBRGARy8kPzGrQffYjBl9U0 3z7wC5B4oOAsgk/DHdvDcg9vW0gv6VGgHLuXtxDY8HFxoOzKAdkC9yG2P5SX4Y9rBGsbm5wWI4njC aphDrkRITNOf6hJ9E+Cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tP0ij-000000074mr-1pPF; Sat, 21 Dec 2024 14:44:45 +0000 Received: from todd.t-8ch.de ([159.69.126.157]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tP0ie-000000074it-3bTe for linux-riscv@lists.infradead.org; Sat, 21 Dec 2024 14:44:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1734792273; bh=Hm4oTXMI/JqCrQxZ82g7s2Sg91ri2J6sCyZLkfUdK78=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dKEk9Z+QAHT8Hz68ebE73fh6OP1VsVSkZoMG9gFyUGKaoPwqHGvyYVwZZdefJXjvF FZCvx9Oe7hdaYT2k7v8hx9KpxCwBYt3j8h6P5xE9u10gQxU0fnHgAs1lWdrcSCsl3n pXYWNE/pfN0RpeuJv1jMA/yHSL4jWWUi4DyFf2qA= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 21 Dec 2024 15:44:33 +0100 Subject: [PATCH 6/6] selftests/nolibc: add configurations for riscv32 MIME-Version: 1.0 Message-Id: <20241221-nolibc-rv32-v1-6-d9ef6dab7c63@weissschuh.net> References: <20241221-nolibc-rv32-v1-0-d9ef6dab7c63@weissschuh.net> In-Reply-To: <20241221-nolibc-rv32-v1-0-d9ef6dab7c63@weissschuh.net> To: Willy Tarreau , Shuah Khan , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, Zhangjin Wu , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734792271; l=3163; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=Hm4oTXMI/JqCrQxZ82g7s2Sg91ri2J6sCyZLkfUdK78=; b=zwMCx/hbd+g6QvU5d3rTtD17U0JfAipHmn2dW/Jh+MHAqJ81F/tmth+3uyXgH+ojln3qSklsH M2bPfLGMhuxCpe4P9CWTCQ+Nz6+QzUNYQ+ZsMGl5em7AAPtW1OEcpP9 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241221_064441_053333_C769DBE5 X-CRM114-Status: UNSURE ( 7.33 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-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: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org nolibc already supports riscv32. Wire it up in the testsuite. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile | 5 +++++ tools/testing/selftests/nolibc/run-tests.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 78f47e85b389ac229ac13f3e7c8299fb3ec92197..7d14a7c0cb62608f328b251495264517d333db2e 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -52,6 +52,7 @@ ARCH_ppc64 = powerpc ARCH_ppc64le = powerpc ARCH_mips32le = mips ARCH_mips32be = mips +ARCH_riscv32 = riscv ARCH_riscv64 = riscv ARCH := $(or $(ARCH_$(XARCH)),$(XARCH)) @@ -67,6 +68,7 @@ IMAGE_ppc = vmlinux IMAGE_ppc64 = vmlinux IMAGE_ppc64le = arch/powerpc/boot/zImage IMAGE_riscv = arch/riscv/boot/Image +IMAGE_riscv32 = arch/riscv/boot/Image IMAGE_riscv64 = arch/riscv/boot/Image IMAGE_s390 = arch/s390/boot/bzImage IMAGE_loongarch = arch/loongarch/boot/vmlinuz.efi @@ -85,6 +87,7 @@ DEFCONFIG_ppc = pmac32_defconfig DEFCONFIG_ppc64 = powernv_be_defconfig DEFCONFIG_ppc64le = powernv_defconfig DEFCONFIG_riscv = defconfig +DEFCONFIG_riscv32 = rv32_defconfig DEFCONFIG_riscv64 = defconfig DEFCONFIG_s390 = defconfig DEFCONFIG_loongarch = defconfig @@ -108,6 +111,7 @@ QEMU_ARCH_ppc = ppc QEMU_ARCH_ppc64 = ppc64 QEMU_ARCH_ppc64le = ppc64 QEMU_ARCH_riscv = riscv64 +QEMU_ARCH_riscv32 = riscv32 QEMU_ARCH_riscv64 = riscv64 QEMU_ARCH_s390 = s390x QEMU_ARCH_loongarch = loongarch64 @@ -135,6 +139,7 @@ QEMU_ARGS_ppc = -M g3beige -append "console=ttyS0 panic=-1 $(TEST:%=NOLIB QEMU_ARGS_ppc64 = -M powernv -append "console=hvc0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_ppc64le = -M powernv -append "console=hvc0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_riscv = -M virt -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" +QEMU_ARGS_riscv32 = -M virt -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_riscv64 = -M virt -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_s390 = -M s390-ccw-virtio -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_loongarch = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" diff --git a/tools/testing/selftests/nolibc/run-tests.sh b/tools/testing/selftests/nolibc/run-tests.sh index caa1ae40fe9a2faf8931c299aacd19716227e2b8..67fefc847d77165f817c3befa578cfa27e6f93d8 100755 --- a/tools/testing/selftests/nolibc/run-tests.sh +++ b/tools/testing/selftests/nolibc/run-tests.sh @@ -17,7 +17,7 @@ perform_download=0 test_mode=system werror=1 llvm= -archs="i386 x86_64 arm64 arm mips32le mips32be ppc ppc64 ppc64le riscv64 s390 loongarch" +archs="i386 x86_64 arm64 arm mips32le mips32be ppc ppc64 ppc64le riscv32 riscv64 s390 loongarch" TEMP=$(getopt -o 'j:d:c:b:a:m:pelh' -n "$0" -- "$@")