Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5256930rwl; Sun, 8 Jan 2023 11:26:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXvcdYYdGdPJf0o8s8d0FQNq8lLdjanGhIqjAz7c3Ki9PPrUKrAQ/UgAek6Ij9V76IlbNWZ6 X-Received: by 2002:a17:902:c381:b0:193:2c1b:3388 with SMTP id g1-20020a170902c38100b001932c1b3388mr2157584plg.23.1673206017148; Sun, 08 Jan 2023 11:26:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673206017; cv=none; d=google.com; s=arc-20160816; b=fYhRtySEoMM5xarU91wOYZ7aegyzRmAiSNLtQrHXphugTTG3QQRC+lO/dL7/lh/5OI VeDyu2yOdWRX74kGirFSEwpPigzDzIJkIkzUrKGkuwkG2a2CGdgTQAO8AOmhrBn6gN4L KYLgLLl2xo/6YADJYYIWvj2aUgo3JyeGJPeBfdtjq1j3CuLi/mgEV1Ym/XtDZYASEHjA QuLhOw8pA4XoZ5TbS6aaqHl9ymUpcOfckQNlKvVygdBWj4QQCmm8J3bmrC/vtI8wi6st 90YeUGkfyi15wTmp127Qp1ZaE9Kwhliw6zCx7SL1tlMXkxqhKGFUp4vA2uz7l/rJUOq8 QG+g== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=MEMec78h1LF6uvYfHQml5zknKnOmLRtDtqXJu9SyUGk=; b=qKCIT30lHfwUghgAC1COIw6hHAZqrykzHqWT0F3tm3lrbWgfxNWaml3azjzDhqL2vr QKMn5WOasv08v/RxQF8URVSjBnZE0jEKaNPYxQPQPhxm+JmgbGXGesSleMF/lQBPwtrp bFkN4M+13mYuWe0uzAULIf6i+X7V6LuSX4kJgyiSE4Psuw1lUdDh+EtUNilGMyfAVltL xn8EyKEigGzomKxA7R1bOFvd6rM6UA6TCuj8RN5BRrz0tW1AefyAK0ZBqMlwCGxGHjY9 bmViWWKzFOmOPZ79NN1tPiz4m9iusf0Bke8XaMTkuaY6z7Is21pddATtxq9HchrEgcAi xTeA== 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 e7-20020a170902b78700b001895e356f00si7094708pls.152.2023.01.08.11.26.50; Sun, 08 Jan 2023 11:26:57 -0800 (PST) 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 S234377AbjAHSts (ORCPT + 53 others); Sun, 8 Jan 2023 13:49:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235282AbjAHStn (ORCPT ); Sun, 8 Jan 2023 13:49:43 -0500 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2E1A1EE23; Sun, 8 Jan 2023 10:49:40 -0800 (PST) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 308InU0f021062; Sun, 8 Jan 2023 19:49:30 +0100 Date: Sun, 8 Jan 2023 19:49:30 +0100 From: Willy Tarreau To: Ammar Faizi Cc: Shuah Khan , "Paul E. McKenney" , Gilang Fachrezy , Alviro Iskandar Setiawan , GNU/Weeb Mailing List , Linux Kernel Mailing List , Linux Kselftest Mailing List Subject: Re: [PATCH v3 0/5] nolibc signal handling support Message-ID: <20230108184930.GC18859@1wt.eu> References: <20230108135904.851762-1-ammar.faizi@intel.com> <20230108175842.GB18859@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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 Mon, Jan 09, 2023 at 01:31:17AM +0700, Ammar Faizi wrote: > > - riscv and mips build are now broken: > > sysroot/riscv/include/sys.h:1110:18: error: 'struct sigaction' has no member named 'sa_restorer' > > 1110 | if (!act2.sa_restorer) { > > | ^ > > sysroot/riscv/include/sys.h:1111:34: error: 'SA_RESTORER' undeclared (first use in this function); did you mean 'SA_RESTART'? > > 1111 | act2.sa_flags |= SA_RESTORER; > > | ^~~~~~~~~~~ > > | SA_RESTART > > Just a speculation: > This is probably because not all architectures have a SA_RESTORER. I'll > need to figure out how Linux handles signal on those architectures. Yes that's the case, there's even some ifdef around it in the generic code. I have no idea how it works there, at least it seems worth having a look to make sure we don't miss something easy. > > - s390 segfaults: > > 58 select_fault = -1 EFAULT [OK] > > 59 sigactionqemu: uncaught target signal 11 (Segmentation fault) - core dumped > > Segmentation fault > > > > It dies in __restore_rt at 1006ba4 while performing the syscall, > > I don't know why, maybe this arch requires an alt stack or whatever : > > > > 0000000001006ba0 <__restore_rt>: > > 1006ba0: a7 19 00 ad lghi %r1,173 > > 1006ba4: 0a 00 svc 0 > > 1006ba6: 07 07 nopr %r7 > > Bah, no clue on this. I'll CC s390 people in the next version and ask > them to shed some light. OK. > I'll be pondering this code this week (to follow what actually the > rt_sigaction wants on i386 and arm): > > https://github.com/torvalds/linux/blob/v6.2-rc3/kernel/signal.c#L4404-L4434 Seems like it could simply be a matter of sigsetsize, which is the first one returning -EINVAL. > Hopefully, I can get it sorted before the weekend. OK! > > I also think that the printf() in test_sigaction_sig() are not welcome > > as they corrupt the output. Maybe one thing you could do to preserve the > > info would be to prepend a space in front of the message and remove the > > LF. For example the simple patch below: > [...] > > Which is way more readable and still grep-friendly. > > Yeah, that looks much better. Applied to my local git tree with > attribution. Don't worry with attribution for such patches from me. I'd rather see the first patch looking good at once than having an extra one change the output just for the sake of attribution! It was just a suggestion anyway and whatever solution you find that improves the output will be fine. Thank you! Willy