From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18108 invoked from network); 8 Feb 2023 21:53:41 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 8 Feb 2023 21:53:41 -0000 Received: (qmail 3128 invoked by uid 550); 8 Feb 2023 21:53:38 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 3088 invoked from network); 8 Feb 2023 21:53:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=cFnC4XxRgHLsBtRr0Ux6XwENwZaiBgduiG976g4O5vc=; b=j54R/sJu5UM/KzfizhMqaLlZL1XOLZfEtjMoCVrdDeu3BzXDByjMxf16/lo0Uvf40n iFkqKkWSp13WseKfPPZZuVni62GVDwauqYS8OZMy5opNHGpqWm0PEZUFeFShqqrPcyVl ueyzVDjPqDaslrhRWbcQMbE16mdapYUj+O4zqhqN/3bvlPAm+Rli40hjKCgJDEUfUWd/ ZwUAeATihr4Fe8UuF6qRL4ehtOEdW/g7bQUyBO7P0BlC1kaUgmnFPbJz6/E/x0Q0xhn6 Gs3uDaS87kV52OlKJ6gokQ713QXtlpwOY/bxXguAhzq781n4JSx6ZFmhqeMqi4D7OifO +ZJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cFnC4XxRgHLsBtRr0Ux6XwENwZaiBgduiG976g4O5vc=; b=4fzHOH3ZByyGiQm22dIEVS2Z4GH3uv88UB51xHuiVcgUgZDsw2aLcpRuiJBEebsTjr EcuDyQcoALGeacEUBF59fbbo4r2+QPYmQ4hAvldUf7WtJqugNv+SA66pnijtqRMOM8Y7 C2j7N//hgZ8A3E6vNXswLXA+kL9qbiD6DW27AH+vu5b+IPSaUN6Qc78FU6gtprfvSCYJ 5+ug9YWfQCXQtDEzrZIdDFwdWWAI040e8Ecplis1NlSPmeNgsNVjWQAKMV52VvZ4635u LOUO+Um3EEjq3Vet+026VHGw77cQp/zZTsAkyhLuWjp9n6okYuV9bNM6p6A4qr+kFeBN V8+A== X-Gm-Message-State: AO0yUKWDh82qw4zYNP/Oliw4JFBWaa/JrXgwUgbA7PP7FNeO2swm6n6t 3EqfdkDtg4sFeaF4+e7mPWzTxoQlswwcs4tcLs7rdw== X-Google-Smtp-Source: AK7set+ERlc6hyLwjuYflYg5Riw4hCTmtE0yt7OoD+hBaI10qTjdYiWMkzpq9MYKJg9Hby1g/jnmtgFX158DnT/MkB0= X-Received: by 2002:ac8:7dcd:0:b0:3b8:6ca5:6df4 with SMTP id c13-20020ac87dcd000000b003b86ca56df4mr1927604qte.18.1675893205227; Wed, 08 Feb 2023 13:53:25 -0800 (PST) MIME-Version: 1.0 References: <20221110171858.GJ29905@brightrain.aerifal.cx> <20230205235426.GO4163@brightrain.aerifal.cx> <20230206174953.GP4163@brightrain.aerifal.cx> <20230208214530.GT4163@brightrain.aerifal.cx> In-Reply-To: <20230208214530.GT4163@brightrain.aerifal.cx> From: enh Date: Wed, 8 Feb 2023 13:53:13 -0800 Message-ID: To: Rich Felker Cc: Khem Raj , musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] SA_RESTORER for rv64? yes, that looks like what we have in bionic for riscv64 (and what we had for mips before it was removed). thanks! On Wed, Feb 8, 2023 at 1:45 PM Rich Felker wrote: > > On Mon, Feb 06, 2023 at 12:49:53PM -0500, Rich Felker wrote: > > On Mon, Feb 06, 2023 at 08:51:13AM -0800, enh wrote: > > > On Sun, Feb 5, 2023 at 3:54 PM Rich Felker wrote: > > > > > > > > On Fri, Feb 03, 2023 at 10:44:56AM -0800, enh wrote: > > > > > oops, never actually sent the patch. attached... > > > > > > > > > > On Thu, Nov 10, 2022 at 9:31 AM Khem Raj wrote: > > > > > > > > > > > > On Thu, Nov 10, 2022 at 9:19 AM Rich Felker wrote: > > > > > > > > > > > > > > On Thu, Nov 10, 2022 at 07:44:23AM -0800, enh wrote: > > > > > > > > arch/riscv64/bits/signal.h has contained a definition for SA_RESTORER since > > > > > > > > the initial commit, but i think that's just copy & paste from whichever > > > > > > > > architecture the rv64 headers were based on? the linux kernel itself > > > > > > > > doesn't have SA_RESTORER for rv64, unless i'm missing something? > > > > > > > > > > > > > > I suspect this is just a mistake. Have you seen any ill effects from > > > > > > > it? If riscv folks can confirm it's wrong, I'll remove it. > > > > > > > > > > > > Yeah I think it should be removed. Perhaps mips is in same boat. > > > > > > > > > > > > > > > > > > > > Rich > > > > > > > > > From 6413de6d9f785c98e5bc0cf40be947f1169d2fd7 Mon Sep 17 00:00:00 2001 > > > > > From: Elliott Hughes > > > > > Date: Fri, 3 Feb 2023 10:42:55 -0800 > > > > > Subject: [PATCH] risc-v does not have SA_RESTORER. > > > > > > > > > > The kernel's include/uapi/asm-generic/signal-defs.h explicitly calls > > > > > this out as obsolete. New architectures like risc-v do not define it. > > > > > --- > > > > > arch/riscv64/bits/signal.h | 1 - > > > > > 1 file changed, 1 deletion(-) > > > > > > > > > > diff --git a/arch/riscv64/bits/signal.h b/arch/riscv64/bits/signal.h > > > > > index 287367db..fd6157a3 100644 > > > > > --- a/arch/riscv64/bits/signal.h > > > > > +++ b/arch/riscv64/bits/signal.h > > > > > @@ -76,7 +76,6 @@ typedef struct __ucontext > > > > > #define SA_RESTART 0x10000000 > > > > > #define SA_NODEFER 0x40000000 > > > > > #define SA_RESETHAND 0x80000000 > > > > > -#define SA_RESTORER 0x04000000 > > > > > > > > > > #endif > > > > > > > > > > -- > > > > > 2.39.1.519.gcb327c4b5f-goog > > > > > > > > > > > > > I don't think this patch works as-is, since musl unconditionally uses > > > > SA_RESTORER. We probably need to make that conditional on its > > > > presence, and it looks like there's also a wrong-struct-layout issue > > > > on archs where it's absent... > > > > > > yeah, bionic just uses the kernel uapi headers directly, and they look > > > like this: > > > > > > struct sigaction { > > > __sighandler_t sa_handler; > > > unsigned long sa_flags; > > > #ifdef SA_RESTORER > > > __sigrestore_t sa_restorer; > > > #endif > > > sigset_t sa_mask; > > > }; > > > > OK. It looks like we need to remove the wrong SA_RESTORER for archs > > that aren't supposed to have it *and* add such an #ifdef. Right now, > > we're passing bogus sa_mask on these archs... :( > > How does the attached look? > > Rich