glibc/hurd
Sergey Bugaev 60b21327b1 hurd: Remove the ecx kludge
"We don't need it any more"

The INTR_MSG_TRAP macro in intr-msg.h used to play little trick with
the stack pointer: it would temporarily save the "real" stack pointer
into ecx, while setting esp to point to just before the message buffer,
and then invoke the mach_msg trap. This way, INTR_MSG_TRAP reused the
on-stack arguments laid out for the containing call of
_hurd_intr_rpc_mach_msg (), passing them to the mach_msg trap directly.

This, however, required special support in hurdsig.c and trampoline.c,
since they now had to recognize when a thread is inside the piece of
code where esp doesn't point to the real tip of the stack, and handle
this situation specially.

Commit 1d20f33ff4 has removed the actual
temporary change of esp by actually re-pushing mach_msg arguments onto
the stack, and popping them back at end. It did not, however, deal with
the rest of "the ecx kludge" code in other files, resulting in potential
crashes if a signal arrives in the middle of pushing arguments onto the
stack.

Fix that by removing "the ecx kludge". Instead, when we want a thread
to skip the RPC, but cannot make just make it jump to after the trap
since it's not done adjusting the stack yet, set the SYSRETURN register
to MACH_SEND_INTERRUPTED (as we do anyway), and rely on the thread
itself for detecting this case and skipping the RPC.

This simplifies things somewhat and paves the way for a future x86_64
port of this code.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Message-Id: <20230301162355.426887-1-bugaevc@gmail.com>
2023-03-02 00:32:55 +01:00
..
hurd mach, hurd: Cast through uintptr_t 2023-02-12 15:55:04 +01:00
alloc-fd.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
catch-exc.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
catch-signal.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
compat-20.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ctty-input.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ctty-output.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
Depend * Makefile (subdir-target-args): New variable. 2006-02-28 07:11:04 +00:00
dtable.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
exc2signal.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
faultexc.defs Sun May 12 11:16:58 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> 1996-05-12 16:38:08 +00:00
fchroot.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
fcntl-internal.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
fd-cleanup.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
fd-close.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
fd-read.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
fd-write.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
fopenport.c mach, hurd: Cast through uintptr_t 2023-02-12 15:55:04 +01:00
get-host.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
getdport.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
geteuids.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
getumask.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurd-raise.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurd.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdauth.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdchdir.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdexec.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdfault.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdfault.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdfchdir.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdhost.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdid.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdinit.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdioctl.c hurd: Use mach_msg_type_number_t where appropriate 2023-02-12 15:52:07 +01:00
hurdkill.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdlock.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdlock.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdlookup.c hurd: Consolidate file_name_lookup implementation 2023-02-01 20:05:20 +01:00
hurdmalloc.c hurd: Fix static-PIE startup 2021-12-28 10:28:22 +01:00
hurdmalloc.h hurdmalloc: Run fork handler as late as possible [BZ #19431] 2016-09-22 01:45:48 +02:00
hurdmsg.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdpid.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdports.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdprio.c hurd: Use mach_msg_type_number_t where appropriate 2023-02-12 15:52:07 +01:00
hurdrlimit.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdselect.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdsig.c hurd: Remove the ecx kludge 2023-03-02 00:32:55 +01:00
hurdsock.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdsocket.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdstartup.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurdstartup.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
intern-fd.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
intr-msg.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
intr-rpc.defs Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
intr-rpc.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
longjmp-ts.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lookup-at.c hurd: Implement O_TMPFILE 2023-02-01 23:32:21 +01:00
lookup-retry.c hurd: Use mach_msg_type_number_t where appropriate 2023-02-12 15:52:07 +01:00
Makefile hurd: Fix unwinding over INTR_MSG_TRAP in shared too 2023-02-14 19:32:15 +00:00
msgportdemux.c Remove support setting custom demuxers during signal handling. 2023-02-01 23:37:40 +01:00
new-fd.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
Notes initial import 1995-02-18 01:27:10 +00:00
openport.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
path-lookup.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
pid2task.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
port2fd.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
port-cleanup.c mach, hurd: Cast through uintptr_t 2023-02-12 15:55:04 +01:00
ports-get.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ports-set.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
preempt-sig.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
privports.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
report-wait.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
RPC_gsync_wait_intr.c hurd: Add __lll_abstimed_wait_intr 2020-12-16 01:58:33 +01:00
set-host.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
setauth.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
seteuids.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
siginfo.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sigunwind.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
stack_chk_fail_local.c hurd: fix build with -fstack-protector-strong 2017-08-27 22:10:17 +02:00
task2pid.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
thread-cancel.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
thread-self.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
trampoline.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
Versions hurd: Export _hurd_libc_proc_init 2021-04-12 00:23:36 +02:00
vpprintf.c mach, hurd: Cast through uintptr_t 2023-02-12 15:55:04 +01:00
xattr.c hurd: Fix xattr error value 2023-02-12 15:56:21 +01:00