From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by gnuweeb.org (Postfix) with ESMTPSA id 84B5B7E430 for ; Tue, 3 Jan 2023 03:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1672717908; bh=QYJzaVWEN9rJqXhGfvYSckZDzJI7KSe/z6dryTHgH4k=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JxqhMMS95GgOfb9fLwje/ktE3eLW6QdDFaZX5Kb1EUSkEEFHigAKR8X4gOokcDomp 620fDZ22zZpgsCVBJLJqXcbh03sE+5YoulmPR99WulRLeLDhAajTFK5zYkGr4O/izh MMDaawc/E2/D6QQNF3gToDKdjoA7wsBDO9qPZEVlUMo604i17jYFfl+raJgluJKTON MKHy+1tLTZ8kVYWyhm0DdXxz/GdHX3fcy3D18fB1A2/rRML0DNwmOeHJNIkGVbvZwi inBSEbAhulZgvIMxmVLx4aCxifMrHlf0h2eTaLR07CLFMHkF2cnr7pADDlp7ZqfaUe zPEMe6Xb0RWyQ== Received: by mail-lf1-f47.google.com with SMTP id 1so44023176lfz.4 for ; Mon, 02 Jan 2023 19:51:48 -0800 (PST) X-Gm-Message-State: AFqh2koaF1kK5kWyDX2FyE2DSOrHNqUmGwj/8/d0/DnC9HhzT0jcWVtj HXt5akNyOGGoh8EtQE07DysYbsM6EBzmSG+Jxuk= X-Google-Smtp-Source: AMrXdXuzaNFgikwUSNWt0817iguzQbXD08dVoevW9eoI/uBjB4kQLl4/vK0FCOJ0JrJ2xjpstQ+HSOg8ncxM52UP9t8= X-Received: by 2002:a05:6512:34d3:b0:4cb:c78:1895 with SMTP id w19-20020a05651234d300b004cb0c781895mr967155lfr.83.1672717906547; Mon, 02 Jan 2023 19:51:46 -0800 (PST) MIME-Version: 1.0 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> <39d68044-2641-75da-929a-f5e852f0a3d0@gnuweeb.org> In-Reply-To: <39d68044-2641-75da-929a-f5e852f0a3d0@gnuweeb.org> From: Alviro Iskandar Setiawan Date: Tue, 3 Jan 2023 10:51:35 +0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v1 0/8] nolibc signal handling support To: Ammar Faizi Cc: Willy Tarreau , "Paul E. McKenney" , Shuah Khan , Gilang Fachrezy , VNLX Kernel Department , Kanna Scarlet , Muhammad Rizki , "GNU/Weeb Mailing List" , Linux Kernel Mailing List , Linux Kselftest Mailing List Content-Type: text/plain; charset="UTF-8" List-Id: On Thu, Dec 29, 2022 at 6:42 PM Ammar Faizi wrote: > On 12/28/22 8:35 PM, Willy Tarreau wrote: > > 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. >From glibc source code says: GDB needs some intimate knowledge about it to recognize them as signal trampolines, and make backtraces through signal handlers work right. Important are both the names (__restore_rt) and the exact instruction sequence. link: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/x86_64/sigaction.c;h=4e6d9cc32e1e18746726fa430d092de9a19ba6c6;hb=b4a5d26d8835d972995f0a0a2f805a8845bafa0b#l34 glibc does this: " .type __" #name ",@function\n" \ "__" #name ":\n" \ " movq $" #syscall ", %rax\n" \ " syscall\n" \ where #name = "restore_rt" #syscall = __NR_rt_sigreturn I think it should be called "__restore_rt" instead of "sys_rt_sigreturn"? glibc also has unwind information, but we probably don't need to care with that much