From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 46359385840E for ; Mon, 20 Feb 2023 11:38:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 46359385840E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTu4D-00056j-TI; Sun, 19 Feb 2023 19:30:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=In-Reply-To:MIME-Version:References:Subject:To:From: Date; bh=TWV0VI/eEpo0aI2gUWetf+SGpRLE87kQIODE03ZPaHM=; b=gjMM9nXjHzWQf8aVIQ18 8SOc7McGZeTVZaButgmnzUUE4C0BByitt+qd1yDul1dZ+h1u6o5xMm9Sg98EOIHw9VuqiSYacr3MW OPyaAqP+v0iVeYCSdtoromeK3QnIG5OVFPdryB86CKom6XFtn7U7JbYTCAU5hNNPc/uiz+UUdBqn7 q1lPhm1fPe/Bd5BiKXSF9mvGRIOTMnsJDrZGGNGHmVitpvGIJrkNx4VS/izasnehLDMJ0F7ZNZ/ls Hs+iyJSjTKx9ApV5HgHTE/BV2sIbBA2ksC4tqXCAGAyghFfVmXZyOljKq4nd8jYBBepXaKJX2I0s9 TJ4b7XxK1Iq6VQ==; Received: from lfbn-bor-1-1163-184.w92-158.abo.wanadoo.fr ([92.158.138.184] helo=begin) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTu4C-0000jQ-5d; Sun, 19 Feb 2023 19:30:05 -0500 Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1pTu48-0017pA-1J; Mon, 20 Feb 2023 01:30:00 +0100 Date: Mon, 20 Feb 2023 01:30:00 +0100 From: Samuel Thibault To: Sergey Bugaev Cc: bug-hurd@gnu.org, libc-alpha@sourceware.org, =?utf-8?Q?Fl=C3=A1vio?= Cruz Subject: Re: [RFC PATCH 9/9] hurd, htl: Add some more x86_64-specific code Message-ID: <20230220003000.lmepcyol5mjr4dfv@begin> Mail-Followup-To: Sergey Bugaev , bug-hurd@gnu.org, libc-alpha@sourceware.org, =?utf-8?Q?Fl=C3=A1vio?= Cruz References: <20230218203717.373211-1-bugaevc@gmail.com> <20230218203717.373211-10-bugaevc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230218203717.373211-10-bugaevc@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Sergey Bugaev, le sam. 18 févr. 2023 23:37:17 +0300, a ecrit: > diff --git a/sysdeps/mach/hurd/x86_64/tls.h b/sysdeps/mach/hurd/x86_64/tls.h > new file mode 100644 > index 00000000..644dcb1a > --- /dev/null > +++ b/sysdeps/mach/hurd/x86_64/tls.h > @@ -0,0 +1,257 @@ > +# define TCB_ALIGNMENT 64 Please copy the comment about the penalty of non-64-aligned accesses. > +# define TLS_INIT_TP(descr) _hurd_tls_init ((tcbhead_t *) (descr)) > + > +# if __GNUC_PREREQ (6, 0) > + > +# define THREAD_SELF \ > + (*(tcbhead_t * __seg_fs *) offsetof (tcbhead_t, tcb)) > +# define THREAD_GETMEM(descr, member) \ > + (*(__typeof (descr->member) __seg_fs *) offsetof (tcbhead_t, member)) > +# define THREAD_SETMEM(descr, member, value) \ > + (*(__typeof (descr->member) __seg_fs *) offsetof (tcbhead_t, member) = value) > + > +# else I'd say don't bother keeping the non-gcc-6 case, since x86_64-gnu got added to gcc only recently. > +/* Set the stack guard field in TCB head. */ > +# define THREAD_SET_STACK_GUARD(value) \ > + THREAD_SETMEM (THREAD_SELF, stack_guard, value) > +# define THREAD_COPY_STACK_GUARD(descr) \ > + ((descr)->stack_guard \ > + = THREAD_GETMEM (THREAD_SELF, stack_guard)) > + > +/* Set the pointer guard field in the TCB head. */ > +# define THREAD_SET_POINTER_GUARD(value) \ > + THREAD_SETMEM (THREAD_SELF, pointer_guard, value) > +# define THREAD_COPY_POINTER_GUARD(descr) \ > + ((descr)->pointer_guard \ > + = THREAD_GETMEM (THREAD_SELF, pointer_guard)) > + > +/* Install new dtv for current thread. */ > +# define INSTALL_NEW_DTV(dtvp) THREAD_SETMEM (THREAD_SELF, dtv, dtvp) > + > +/* Return the address of the dtv for the current thread. */ > +# define THREAD_DTV() THREAD_GETMEM (THREAD_SELF, dtv) Please keep #define order coherent with i386/tls.h > diff --git a/sysdeps/x86_64/htl/pt-machdep.h b/sysdeps/x86_64/htl/pt-machdep.h > new file mode 100644 > index 00000000..2e2846fa > --- /dev/null > +++ b/sysdeps/x86_64/htl/pt-machdep.h I don't think this is needed since we already have sysdeps/x86/htl/pt-machdep.h ? Samuel