From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 468F73858D38 for ; Mon, 10 Apr 2023 21:50:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 468F73858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-x335.google.com with SMTP id c2-20020a056830348200b006a3ab0ba8a2so7329887otu.1 for ; Mon, 10 Apr 2023 14:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681163436; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YwSnp2Nq5+14lezvVWo5EF2tVTJKmwJBGut1FICRfpA=; b=oZJ3uEXbK0Q4ZCHp/3nf+QM2myINGqg340Huv/fi13DfSx48QVFiZ59kgxJSnUohx1 pQlRmOOX4L5tBUvWeza9IEk9feoDFnFExv8vsbGBS2bMaJ6j7Fz7L0ojjCNyePjg1Jug 0koIXos5ZYgMHb1ufJHAw0eUmRnLXSE8aVO/pkF7vwjnavp/RE8jtrP9SH2dW7dccHXS RoIxteDR4ssggqpDizWzhzI5Wt3CeJ/Z7WpgsPsj4Et1IkbhsJn6nnvs+TCNEeoaavAR MjMqXSLGGCiaxJC30Dnn0HRgtVJ5tmn2LeQGa/77Wc1mRPb6BqdPgIg31Q4pA5dZOYYY WqOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681163436; h=content-transfer-encoding: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=YwSnp2Nq5+14lezvVWo5EF2tVTJKmwJBGut1FICRfpA=; b=N6nYzIp1OAqXE3JlijoRg6aHgLM67+DMZjhzhn0Ot9gOOsutkPiXcpKRE10qU+qLxX 7CmsC0ZwV9+PlxbWpQWE4Z/1Sk9nYttdOmLNL7LDECc8O251r1/Dnf9TC7pQH/4HvKFi tt9CHfyvDs2XyG0oXFWE90CJCshpKXY3XhNjWbBY0TTQAviyd086Qbuo1BGu01KbBIkH FdUgu3AAUM+miyzJMy0Ew41HiiwGqeBYYL+y1eq52EonhBUtmnQtBI9yg2u/q09gNuD+ 3VeUaXBxXsxTOf6w7+jBAaFlqlavhGyhhgyF7dxy1OizaXn5mOK5NPmUgY81mk2YUrXK nSIQ== X-Gm-Message-State: AAQBX9dV2Jiul7FmN3/QsTIDso5OzijZHvQd1UD82DtK+Sak9BsZe8Rb tBLepjDTXxTxkFtWx5H4Wv1yaV/tAFkLdNcVqYxOTAvqJcXyIw== X-Google-Smtp-Source: AKy350ZzXoMLVQt6Apnwiuf0mC/IPY756gEPGdOlJgxKc9O6VvnKC/zHLXece16JnQ6XMINKyKKbAtnta1AFPjwWRls= X-Received: by 2002:a05:6830:22e8:b0:6a3:e32d:1b3a with SMTP id t8-20020a05683022e800b006a3e32d1b3amr255221otc.7.1681163436462; Mon, 10 Apr 2023 14:50:36 -0700 (PDT) MIME-Version: 1.0 References: <20230319151017.531737-1-bugaevc@gmail.com> <20230319151017.531737-17-bugaevc@gmail.com> <20230410185814.rjqm46ndc4pjvoac@begin> <20230410192158.mmmcpeviwfc52e7c@begin> In-Reply-To: <20230410192158.mmmcpeviwfc52e7c@begin> From: Sergey Bugaev Date: Tue, 11 Apr 2023 00:50:25 +0300 Message-ID: Subject: Re: [RFC PATCH glibc 16/34] hurd: Add sys/ucontext.h and sigcontext.h for x86_64 To: Samuel Thibault Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Apr 10, 2023 at 10:22=E2=80=AFPM Samuel Thibault wrote: > > Sergey Bugaev, le lun. 10 avril 2023 22:13:06 +0300, a ecrit: > > On Mon, Apr 10, 2023 at 9:58=E2=80=AFPM Samuel Thibault wrote: > > > > > > Sergey Bugaev, le dim. 19 mars 2023 18:09:59 +0300, a ecrit: > > > > +#ifdef __USE_GNU > > > > +/* Number of each register in the `gregset_t' array. */ > > > > +enum > > > > +{ > > > > + REG_GSFS =3D 0, /* Actually int gs, fs. */ > > > > +# define REG_GSFS REG_GSFS > > > > + REG_ESDS, /* Actually int es, ds. */ > > > > +# define REG_ESDS REG_ESDS > > > > > > On second thought, why REG_ESDS? They are basically useless on amd64 > > > > > > Linux packs all segment registers in REG_CSGSFS, probably better to > > > stuff them the same way? (all three really are 16bit only, even if th= e > > > thread_state is padding them to 32bits). > > > > Exactly because that's how they are laid out in struct > > i386_thread_state, if you count in 8-byte chunks. > > But we don't have to map to that. Well yes, I was trying to make the x86_64 version do the same thing as i386 does, hence arranging registers in sigcontext, ucontext, and thread state in the same way, so they can be memcpied, like on i386. But we could also lay this out differently and just write some more code to fill the ucontext. Sergey