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 2B9483858D33 for ; Wed, 22 Feb 2023 23:26:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2B9483858D33 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 1pUyVe-00059I-Ku; Wed, 22 Feb 2023 18:26:50 -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=6lZEo8mE7H0ilq+lkluDSEp1iIS8s4siCcBqZ0/GgVw=; b=GnCUqP9rbEYofg+rTj3g Dx5Lzm0yNT/eW6G7CYO9Nl5CmgVEbibeaD5Gp/KSBEvS9Z8PtP2TMTlsPk01Z27LmrTzkR3vMPMXW MyJzh6BWfYmvqj+bWj/bt12o/yRURB4vbyC6NJJIontr3EVosDeoTrCkcFygqAMfFRWQJHdgFLKZn Go8lGLwE1qJuH006s/C1QlxxtbQ6LRo13LNumIZzpecNVWGndvenQNzL8CeLw8HHNJBcDSVQD/bs2 YU5hiwq8XkXzmsaFy9PIOnyNzbQnTf95vpDsHS4mOxbmitT/uSU4H892Wokjo2LswRu5cACGX6aJ+ RXhpeBDzz6DEIw==; Received: from [2a01:cb19:4a:a400:de41:a9ff:fe47:ec49] (helo=begin) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUyVd-00033Z-6F; Wed, 22 Feb 2023 18:26:50 -0500 Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1pUyVa-007MAb-0Q; Thu, 23 Feb 2023 00:26:46 +0100 Date: Thu, 23 Feb 2023 00:26:46 +0100 From: Samuel Thibault To: Sergey Bugaev Cc: bug-hurd@gnu.org, libc-alpha@sourceware.org, =?utf-8?Q?Fl=C3=A1vio?= Cruz , Noah Goldstein Subject: Re: [PATCH v2 1/4] hurd: Simplify init-first.c further Message-ID: <20230222232646.sc3l7rec2wpalpxy@begin> Mail-Followup-To: Sergey Bugaev , bug-hurd@gnu.org, libc-alpha@sourceware.org, =?utf-8?Q?Fl=C3=A1vio?= Cruz , Noah Goldstein References: <20230221211932.296459-1-bugaevc@gmail.com> <20230221211932.296459-2-bugaevc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230221211932.296459-2-bugaevc@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-12.4 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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, Thanks for this! Did you try to run make check? Sergey Bugaev via Libc-alpha, le mer. 22 févr. 2023 00:19:29 +0300, a ecrit: > This drops all of the return address rewriting kludges. The only > remaining hack is the jump out of a call stack while adjusting the > stack pointer. Is this hack really still needed? Since we don't switch stack any more, we could as well just return normally? > --- a/sysdeps/mach/hurd/dl-sysdep.c > +++ b/sysdeps/mach/hurd/dl-sysdep.c > @@ -207,6 +207,9 @@ _dl_sysdep_start (void **start_argptr, > } > } > > + extern void _dl_init_first (void *data); Please put extern function declaration into a header, dl-sysdep.h for instance. > diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c > index a558da16..34e8dcc0 100644 > --- a/sysdeps/mach/hurd/i386/init-first.c > +++ b/sysdeps/mach/hurd/i386/init-first.c > + { > + /* Check if the stack we are now on is different from > + the one described by _hurd_stack_{base,size}. */ > > + char dummy; > + const vm_address_t newsp = (vm_address_t) &dummy; > + > + if (d->stack_size != 0 && (newsp < d->stack_base > + || newsp - d->stack_base > d->stack_size)) > + /* The new stack pointer does not intersect with the > + stack the exec server set up for us, so free that stack. */ > + __vm_deallocate (__mach_task_self (), d->stack_base, d->stack_size); > + } Again, I don't think this is needed any more since we don't switch stack any more? Samuel