Re: [PATCH 5/5 v2 gnumach] x86_64: add 64-bit syscall entry point

2023-03-01 Thread Luca Dariz
Il 01/03/23 21:18, Samuel Thibault ha scritto: Luca Dariz, le mer. 01 mars 2023 18:40:37 +0100, a ecrit: +asm volatile("wrmsr" + : + : "c" (regaddr), "a" (low), "d" (high) + : "memory" /* wrmsr is a serializing instruction */ The comment cou

Re: [PATCH 1/2] hurd: Remove the ecx kludge

2023-03-01 Thread Samuel Thibault
And I'll upload the fix to debian, possibly that'll fix some bugs we have seen in golang packages builds. Samuel Thibault, le jeu. 02 mars 2023 00:33:09 +0100, a ecrit: > Applied, thanks! > > Sergey Bugaev, le mer. 01 mars 2023 19:23:54 +0300, a ecrit: > > "We don't need it any more" > > > > The

Re: [PATCH 2/2] hurd: Fix some broken indentation

2023-03-01 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le mer. 01 mars 2023 19:23:55 +0300, a ecrit: > Also, fix a couple of typos. No functional change. > > Signed-off-by: Sergey Bugaev > --- > hurd/hurdsig.c | 101 + > 1 file changed, 51 insertions(+), 50 deletions(-)

Re: [PATCH 1/2] hurd: Remove the ecx kludge

2023-03-01 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le mer. 01 mars 2023 19:23:54 +0300, a ecrit: > "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 ju

Re: [PATCH 5/5 v2 gnumach] x86_64: add 64-bit syscall entry point

2023-03-01 Thread Samuel Thibault
Luca Dariz, le mer. 01 mars 2023 18:40:37 +0100, a ecrit: > +asm volatile("wrmsr" > + : > + : "c" (regaddr), "a" (low), "d" (high) > + : "memory" /* wrmsr is a serializing instruction */ The comment could be misleading. The fact that it's a ser

Re: [PATCH 1/2] hurd: Remove the ecx kludge

2023-03-01 Thread Samuel Thibault
Luca, le mer. 01 mars 2023 19:01:02 +0100, a ecrit: > I still have to fully understand the existing code, so this might be > something completely wrong... but if interrupting an rpc is a complex thing > to do reliably in user space, why not add some kernel support? Also, how do > you test this code

Re: [PATCH 1/2] hurd: Remove the ecx kludge

2023-03-01 Thread Luca
Hi, Il 01/03/23 17:23, Sergey Bugaev ha scritto: "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 the

[PATCH 5/5 v2 gnumach] x86_64: add 64-bit syscall entry point

2023-03-01 Thread Luca Dariz
While theoretically we could still use the same call gate as for 32-bit userspace, it doesn't seem very common, and gcc seems to not encode properly the instruction. Instead we use syscall/sysret as other kernels (e.g. XNU,Linux). This version still has some limitations, but should be enough to sta

[PATCH 1/2] hurd: Remove the ecx kludge

2023-03-01 Thread Sergey Bugaev
"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

[PATCH 2/2] hurd: Fix some broken indentation

2023-03-01 Thread Sergey Bugaev
Also, fix a couple of typos. No functional change. Signed-off-by: Sergey Bugaev --- hurd/hurdsig.c | 101 + 1 file changed, 51 insertions(+), 50 deletions(-) diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c index 5ff0a91f..85bd46b5 100644 --- a/hurd/h

Re: intr-msg / hurdsig looks broken, is my analysis correct?

2023-03-01 Thread Samuel Thibault
Sergey Bugaev, le mer. 01 mars 2023 12:21:17 +0300, a ecrit: > * eip < _hurd_intr_rpc_msg_about_to => thread is still to check > ss->cancel, so just set ss->cancel = 1; > * _hurd_intr_rpc_msg_about_to <= eip < _hurd_intr_rpc_msg_setup_done > => thread is still to check eax, so set eax = MACH_SEND_I

Re: intr-msg / hurdsig looks broken, is my analysis correct?

2023-03-01 Thread Sergey Bugaev
On Wed, Mar 1, 2023 at 12:09 AM Samuel Thibault wrote: > > Sergey Bugaev, le mar. 28 févr. 2023 18:53:05 +0300, a ecrit: > > Really, why would it matter whether eip is after > > _hurd_intr_rpc_msg_about_to or not? What if it's 1 instruction before > > that? We skip the call, pretending it was inte