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));