Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp835888rwd; Sat, 20 May 2023 07:32:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ijxkXy2Fso9Br2FXhRPrm+0sNbF14DNIAAahg2USlws9xbE2Yox6CYfWQVzBjGxZzC1Gd X-Received: by 2002:a05:6a00:14c4:b0:646:2e83:6b2e with SMTP id w4-20020a056a0014c400b006462e836b2emr6989588pfu.31.1684593171852; Sat, 20 May 2023 07:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684593171; cv=none; d=google.com; s=arc-20160816; b=Qnax+a9Y9qh8PGqxP7AtQWPutqk+xAl8Ky1PO0Km4xC/wdGGDWgWv2QPzntn42QqyN NAUGeLyQd4lPTKV4Q5jEtMHnYhuDZZ6pEsuTklZiT0FO6sHzxorXjklmRdhf6D36co1S +m8myd40OIceNr+L7SxdSYvchQpqOEWP9+gayi5B01faNMxKcwWodq8HGj6MfsofZQU4 rx+Q5RerVJnveMXpj8JBzmVq5yez7E39v6xs88eOAmCSBb11IcAs69dLhAMRaJmyWCq6 9lwwsyuRMDP6VlazBQ0SQ+zJaxO+6+dxBwFv41CeI7KVu0rC5f3gFJagxVq78RdpTfBv q00Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=8m0QXBCNnc0I7RzuFtssthQHR30JrEMXYZN4mtUIH+c=; b=YDg48RqHYiF8MWVU4caQGk2N6AvLy5Bvl8QwCnT8+hazFxSmMjwr55Ve9rmfDvYIPq Y28qN4ZHS9swmj+mU1v5Paj8HsZ4nzDeFBEE2DuaaQSeL3S0fAMw8CBMBH7IoD6yHxC7 wJbyryH3eJS0+hZ5hMrzKKVve2P786WYfji5hy1Wd+qBtcMwiMXUunGNsimRaXtd1sXo cf/Lt95iMwpHhEDlRfWTxR/b8aGMv8fg/lOVtYK7KoZnpPD5kXi/1THxa/2+Md3kYeaf 1+sUB3Yn3qu9T3eBabpm8TFDP0bnyfT4rQb5OpSmKDr59f2ecNiPpL8I3vw4O3rF6ncs eodg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a4-20020aa79704000000b006464f29ed9dsi1551978pfg.385.2023.05.20.07.32.37; Sat, 20 May 2023 07:32:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231548AbjETOKK (ORCPT + 99 others); Sat, 20 May 2023 10:10:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231517AbjETOKI (ORCPT ); Sat, 20 May 2023 10:10:08 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 26CE8102; Sat, 20 May 2023 07:10:05 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 34KE9n6D027634; Sat, 20 May 2023 16:09:49 +0200 Date: Sat, 20 May 2023 16:09:49 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Zhangjin Wu , aou@eecs.berkeley.edu, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, palmer@dabbelt.com, paul.walmsley@sifive.com, shuah@kernel.org Subject: Re: [PATCH] selftests/nolibc: Fix up compile error for rv32 Message-ID: <20230520140949.GA27611@1wt.eu> References: <20230520-nolibc-stackprotector-riscv-v1-1-d8912012a034@weissschuh.net> <20230520120254.66315-1-falcon@tinylab.org> <958f09b4-8cd7-46b3-aa54-4d981fd8f1bc@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <958f09b4-8cd7-46b3-aa54-4d981fd8f1bc@t-8ch.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 20, 2023 at 04:00:54PM +0200, Thomas Wei?schuh wrote: > > diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c > > index 063f9959ac44..d8b59c8f6c03 100644 > > --- a/tools/testing/selftests/nolibc/nolibc-test.c > > +++ b/tools/testing/selftests/nolibc/nolibc-test.c > > @@ -596,7 +596,7 @@ int run_syscall(int min, int max) > > CASE_TEST(write_badf); EXPECT_SYSER(1, write(-1, &tmp, 1), -1, EBADF); break; > > CASE_TEST(write_zero); EXPECT_SYSZR(1, write(1, &tmp, 0)); break; > > CASE_TEST(syscall_noargs); EXPECT_SYSEQ(1, syscall(__NR_getpid), getpid()); break; > > - CASE_TEST(syscall_args); EXPECT_SYSER(1, syscall(__NR_fstat, 0, NULL), -1, EFAULT); break; > > + CASE_TEST(syscall_args); EXPECT_SYSER(1, syscall(__NR_read, -1, &tmp, 1), -1, EBADF); break; > > The goal of this second test was to make sure that arguments are passed > in the correct order. For this I tried to have a syscall were the > checked error is generated from a non-first argument. > (The NULL generating the EFAULT). > So the new check does not fullfil this goal anymore. Ah OK good to know. > Maybe we can find a new syscall to test with? Maybe it would be worth considering pselect() or equivalent which involve many arguments. I don't know if rv32 has fstatat() or lstat() for example, that could be used as alternatives ? > The code should have had a comment I guess. Indeed ;-) With that said, if rv32 is missing some essential syscalls, my question regarding its relevance here still holds! Willy