Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3026082rwd; Mon, 29 May 2023 04:54:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5IeT1PLM3djN8RDl+4S4qzAAq/oiQzw8Z5aORJ2ERlFa1IriXKk34qmWDdwIKbK1j32jUe X-Received: by 2002:a05:6a20:1591:b0:10b:fe06:97dd with SMTP id h17-20020a056a20159100b0010bfe0697ddmr9386264pzj.54.1685361249624; Mon, 29 May 2023 04:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685361249; cv=none; d=google.com; s=arc-20160816; b=WPnjjtG2I6Q8nkxHbRj5inwb/S+h5r7MNQE9Vy6CPUF5Yfoklfkf1/9huEIuHBv+hC NPsVBMKKxSDL3ftl/QjylVOvcwZLq8ImzQ0aJDnEKjKTVLY/+fkvZmaY1J4/zTkEalev RVELcUOg+VbVPwtd+igpsBhZXjue98HewvfgfM0nlRcnhQd8Jzxiyqf3jdLUTIrvgEFV gzVlKYhrzwtMhZ1ZuISJRyPOOqO/5KW2RHHLolhK/WCIxK4PglmpwYHHq5FRtNOvr+kY AfJXdi4JM9tcIsO3Qiw0OvJTVdrstdCEkDv8lh5VNc/crY0RPQBZwzA8abw29IU05X+Q 7GaQ== 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=Xy7+PuYy77mzT/wPjKMI3zfpJ2FtaR4e1zfz8zFqbhk=; b=ezCVkzFP2pxyqAxP6DSCBbh4tdvWihXu3fLc6PBn+/gsjhYoOs2q2wnWnW13Ezv+Xa lkscK1LWJr3rrC8o7pUCkYSGow2ERXekMIdg2kNwP4pp0qdPayxoyXED9Rxmts5e16gK yDUGEGTtKoF+gPuZDCiL6TFapZjGs/nd17G6XamLgzQb63JrPQjsvhEZn6ZWTQISToww R3L+Y5lFQiKqp75ReApXO8bfKBWGW1Cd0Wk0LaP5tdYlQT7kB3W0gj+OCTMHMZsmHrVu QoJDnTZXdYXCU5qPx29IrmsgBFWmBUES+GXKzNz0+Qcad/h1N7BmTMoG/542c0tAJqms L1oQ== 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 r20-20020a6560d4000000b00513f070aaa1si9051021pgv.892.2023.05.29.04.53.58; Mon, 29 May 2023 04:54:09 -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 S231516AbjE2Lcg (ORCPT + 99 others); Mon, 29 May 2023 07:32:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231509AbjE2Lcf (ORCPT ); Mon, 29 May 2023 07:32:35 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C73F7BE; Mon, 29 May 2023 04:32:30 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 34TBVhxm002783; Mon, 29 May 2023 13:31:43 +0200 Date: Mon, 29 May 2023 13:31:43 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, palmer@dabbelt.com, paul.walmsley@sifive.com Subject: Re: [PATCH 00/13] tools/nolibc: riscv: Add full rv32 support Message-ID: <20230529113143.GB2762@1wt.eu> References: <20230528183906.22547-1-falcon@tinylab.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR autolearn=no 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 Hi Thomas, On Mon, May 29, 2023 at 10:45:40AM +0200, Thomas Wei?schuh wrote: > > > > usage: > > > > $ gcc -o nolibc-test tools/testing/selftests/nolibc/nolibc-test.c > > $ ./nolibc-test > > ... > > 35 gettimeofday_tz = 0 [OK] > > 36 gettimeofday_tv_tz = 0 [OK] > > 37 gettimeofday_bad1 = -1 [FAIL] (continued by sigaction/siglongjmp/sigsetjmp) > > 38 gettimeofday_bad2 = -1 [FAIL] (continued by sigaction/siglongjmp/sigsetjmp) > > 39 getpagesize = 0 [OK] > > 40 ioctl_tiocinq = 0 [OK] > > 41 ioctl_tiocinq = 0 [OK] > > ... > > > > It did work as expected, but for nolibc, we still need to add sigaction/siglongjump/sigsetjmp support. > > > > Will send a patch based on Willy's latest branch, perhaps this may help us to > > verify the future sigaction/siglongjump/sigsetjmp for nolibc. > > > > ref: https://www.ibm.com/docs/en/i/7.1?topic=ssw_ibm_i_71/apis/sigsetj.html > > https://www.ibm.com/docs/en/zos/2.1.0?topic=functions-siglongjmp-restore-stack-environment-signal-mask > > This seems very complicated for fairly limited gain to be honest. I agree as well. I'm not denying the fact that one day we may want to support signal, longjmp and friends but I'm not convinced we want to go through that just to make a few uncertain tests succeed. > If we really want to keep the current testcase we could also ensure that > the pointer does not fall into the first page, as the first page is not > mapped under Linux: > > 0 <= addr < PAGE_SIZE > > Or instead of PAGE_SIZE just hardcode 4096, as that should be the > minimum size and and does not require a lookup. I would not even do that. It brings nothing to the application layer and inflates the code. I'd rather just get rid of the EFAULT test cases that rely on an unreliable syscall (i.e. one that may either be a real syscall or an emulated one). The value brought by these tests is extremely low and they were implemented only because they were easy to do. If they're causing pain, let's just drop them. Willy