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 421EB3858CDB for ; Sun, 2 Apr 2023 23:13:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 421EB3858CDB 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 1pj6tC-0002g8-QP; Sun, 02 Apr 2023 19:13:34 -0400 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=ZUjqNZHbZWMwo6KZLPMY6zcIIHgMawEiN/aJwYSDOck=; b=aPc0dMHCMvzBYpY2DMCu i7j6eHYoiWmGYHp+5KTMkE7eBJHEZpJKn6g6xWxV5VeTWtgqSSNZYy++aEKUVZbDXlfr+vP4Is4X6 WBNI4eNjVkFW4RdmJ4p7SZiWV/4nByFa9ToVqcjav2W/JNeLs1nCYLgmRjcE8h4OKRAq7nwBEvhbR vMiC2tZMKVOvSuyyBadQLlRhBD+K43bu7wjSAx6eooen/qvCXhHqZmERSQ1olmORomSjZsuOpn+h9 AEO8/OCBsZX/IB7gk3XROu9RwOjUZmuMCS/wNQ/t9UQhZQd7ZkoAXHidEs3Iq5gHRnYKK0SlVDhJz O+uYYjrUYV8JIA==; 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 1pj6tB-0008IG-P0; Sun, 02 Apr 2023 19:13:34 -0400 Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1pj6tA-00Asxe-2O; Mon, 03 Apr 2023 01:13:32 +0200 Date: Mon, 3 Apr 2023 01:13:32 +0200 From: Samuel Thibault To: Sergey Bugaev Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org Subject: Re: [RFC PATCH glibc 15/34] hurd: Use uintptr_t for register values in trampoline.c Message-ID: <20230402231332.dajt63xnp3qzbs5e@begin> Mail-Followup-To: Sergey Bugaev , libc-alpha@sourceware.org, bug-hurd@gnu.org References: <20230319151017.531737-1-bugaevc@gmail.com> <20230319151017.531737-16-bugaevc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230319151017.531737-16-bugaevc@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-12.6 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: Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:58 +0300, a ecrit: > This is more correct, if only because these fields are defined as having > the type unsigned int in the Mach headers, so casting them to a signed > int and then back is suboptimal. > > Also, remove an extra reassignment of uesp -- this is another remnant of > the ecx kludge. > > Signed-off-by: Sergey Bugaev > --- > sysdeps/mach/hurd/i386/trampoline.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/sysdeps/mach/hurd/i386/trampoline.c b/sysdeps/mach/hurd/i386/trampoline.c > index 8f481e79..ab67fb9c 100644 > --- a/sysdeps/mach/hurd/i386/trampoline.c > +++ b/sysdeps/mach/hurd/i386/trampoline.c > @@ -270,24 +270,23 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, const struct sigaction *action > > _hurdsig_end_catch_fault (); > > - state->basic.eip = (int) rpc_wait_trampoline; > + state->basic.eip = (uintptr_t) rpc_wait_trampoline; > /* The reply-receiving trampoline code runs initially on the original > user stack. We pass it the signal stack pointer in %ebx. */ > - state->basic.uesp = state->basic.esp; /* Restore mach_msg syscall SP. */ > - state->basic.ebx = (int) sigsp; > + state->basic.ebx = (uintptr_t) sigsp; > /* After doing the message receive, the trampoline code will need to > update the %eax value to be restored by sigreturn. To simplify > the assembly code, we pass the address of its slot in SCP to the > trampoline code in %ecx. */ > - state->basic.ecx = (int) &scp->sc_eax; > + state->basic.ecx = (uintptr_t) &scp->sc_eax; > } > else > { > - state->basic.eip = (int) trampoline; > - state->basic.uesp = (int) sigsp; > + state->basic.eip = (uintptr_t) trampoline; > + state->basic.uesp = (uintptr_t) sigsp; > } > /* We pass the handler function to the trampoline code in %edx. */ > - state->basic.edx = (int) handler; > + state->basic.edx = (uintptr_t) handler; > > /* The x86 ABI says the DF bit is clear on entry to any function. */ > state->basic.efl &= ~EFL_DF; > -- > 2.39.2 > -- Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.