Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5858664rwl; Thu, 29 Dec 2022 04:11:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXs6kf4FJKWbiapstfPnR4BvDv4ORi9gMQtWCjXCDpjKxNmEmXbkPCumJUjd0c4xmvOweKK2 X-Received: by 2002:a17:907:b686:b0:7c1:7c3a:ffba with SMTP id vm6-20020a170907b68600b007c17c3affbamr28983135ejc.35.1672315895817; Thu, 29 Dec 2022 04:11:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672315895; cv=none; d=google.com; s=arc-20160816; b=aOlcZ0iE3pOb6Rhc8IAnNZ5oTOxsaX3WSJfIKeK2s0QFSxU/FbFm02rISPUDjZ1PtQ pjhi7razR8SI4D26CUECqCw5h7C2TXLOnO9kaZ5DFLNJ21dSo1tw629zLbCQ8KehSiUm Kvokvulmu1bJC+G8MPyUBZCjN69bSPk+kFKKT2Lq0GDyT6VjiyVrAub455id6nqaMJLA LCAc9/deyPPRzaVUc99cpW5DDQKgkWXZfYOrmW6G0OHE0xID73silzwxdBcu2nHnhD7a VDkkvqwjACgxiLsm6iOQF2hnCVrP/WRODmzmMB4H4sLdopIn3jIHrEDlMhIWq+ce8erI Ws6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=foREclg1NVnB2Dmt4AVm255jKMP0TG/pSyeVByrwXXg=; b=Um8uioJJV4qXy0M81bNAFA4MSypskJMyeZNnfuv6voWd8QQ0DDll5sOAA2C+De4ezb slYBNsVejbo/u8ELJ0DhAVcGwG5CnNSsbv/K7DmX46IGoqB3Wih+auVgemkLSh2+nlhZ CUrJUVCxj5litYnBST4bp6BoKV2YG1+Uxl58ZQbeIhkvI2AJ9v1ap9M0keMBpl0yvyIe 9yO0C9BuX3XXP8PvFhCD1uRZaCQTh1Yw5cQyZsor2lIemv1Jou226maJr12JsMvu6rx/ sJj+C43VBhu7Gb9D206U1hzsX5FXYHYp6oInsUFiq+ODc5pssX43cI1emXiF2Yffazk7 9jFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gnuweeb.org header.s=default header.b=ioEorrDU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnuweeb.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a17090658c800b0084c7590c24esi5580195ejs.139.2022.12.29.04.11.15; Thu, 29 Dec 2022 04:11:35 -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; dkim=pass header.i=@gnuweeb.org header.s=default header.b=ioEorrDU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnuweeb.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230488AbiL2LmM (ORCPT + 62 others); Thu, 29 Dec 2022 06:42:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229871AbiL2LmI (ORCPT ); Thu, 29 Dec 2022 06:42:08 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA691EE2B; Thu, 29 Dec 2022 03:42:07 -0800 (PST) Received: from [192.168.88.87] (unknown [125.160.97.236]) by gnuweeb.org (Postfix) with ESMTPSA id CD84D7E259; Thu, 29 Dec 2022 11:42:03 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1672314126; bh=Wm/M0KFPV/UrXA6Ml+ZYeaSNEGdUKJquP84+pixMr+Q=; h=Date:To:Cc:References:From:Subject:In-Reply-To:From; b=ioEorrDULg3Vw9Qd+4LGx9rD7cCo67YGL8iFu7LH+j5isM323rjg3vzUW+u5yueMZ RVzN1O83fZL6I+9sCJ7M6InEbiYLXC3t1CWc9M6nJKPn2DsxlgqhnEpY00wcw86iBV 1qhspCaMEOt5GtvxTaXjmyaDW9FnO3JGxB8VTUH1+XQEBp0mFA2OnEB9brCE6GchKr Fgf3BUk68UNoWamXXKM0Ubw9yMwdaimTBt4SrAZLx0fh2bv2pPap1tkLGOnxWiHsQg UZBD4GivfptXWNdiVmxFbjZ32PcASp6lWmb04kxQJnthS2wRMZ0UkBTt9M38uYqqSY OS5u22AWSGmxA== Message-ID: <39d68044-2641-75da-929a-f5e852f0a3d0@gnuweeb.org> Date: Thu, 29 Dec 2022 18:41:59 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US To: Willy Tarreau Cc: "Paul E. McKenney" , Shuah Khan , Gilang Fachrezy , VNLX Kernel Department , Alviro Iskandar Setiawan , Kanna Scarlet , Muhammad Rizki , GNU/Weeb Mailing List , Linux Kernel Mailing List , Linux Kselftest Mailing List References: <20221222035134.3467659-1-ammar.faizi@intel.com> <20221222043452.GB29086@1wt.eu> <20221222134615.3535422-1-ammar.faizi@intel.com> <20221227062640.GA5337@1wt.eu> <00eee75f-59fa-83b2-c7e1-f0da347b2dde@gnuweeb.org> <20221227184902.GA6287@1wt.eu> <23e84c59-4f2c-01b4-5b8a-80af39a1d761@gnuweeb.org> <20221228133513.GA7457@1wt.eu> From: Ammar Faizi Subject: Re: [RFC PATCH v1 0/8] nolibc signal handling support In-Reply-To: <20221228133513.GA7457@1wt.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 12/28/22 8:35 PM, Willy Tarreau wrote: > OK thanks! > > I've pushed for you an update which starts to do what I proposed. Errno > and environ are now marked weak for all archs, and _auxv is set for i386, > x86_64, arm64 and arm for now: > > https://git.kernel.org/pub/scm/linux/kernel/git/wtarreau/nolibc.git/log/?h=20221227-nolibc-weak-2 > > You can already use it to implement getauxval(), it will normally work > for these archs. Will do and be back with two patch series. > I think we could avoid the asm specific stuff is we get rid of the frame > pointer. Please look below: > > __attribute__((weak,unused,noreturn,optimize("omit-frame-pointer"),section(".text.nolibc_rt_sigreturn"))) > void sys_rt_sigreturn() > { > my_syscall0(__NR_rt_sigreturn); > __builtin_unreachable(); > } Wow! You just taught me that we can force optimize a function with optimize("omit-frame-pointer") attribute. Nice to know this one! I compile-tested it and it indeed gives the correct code on x86-64. Hopefully this approach works for all archs. > It gives me the correct code for x86_64 and i586. I don't know if other > architectures will want to add a prologue. I tried with "naked" but it's > ignored by the compiler since the function is not purely asm. Not very > important but given that we already have everything to perform our calls > it would make sense to stay on this. By the way, for the sake of > consistency with other syscalls, I do think the function (or label if > we can't do otherwise) should be called "sys_rt_sigreturn" as it just > performs a syscall. Will call that 'sys_rt_sigreturn' in the next series. Thanks! -- Ammar Faizi