[PATCH gnumach] Align the user stack correctly for 64 bit programs.

2023-04-02 Thread Flavio Cruz
* i386/i386/thread.h: Define USER_STACK_ALIGN which is 16-byte for 64 bit programs as recommended by the System V AMD64 guidelines. Also define KERNEL_STACK_ALIGN which can differ from user land. * i386/i386/pcb.c: Use USER_STACK_ALIGN to align the bootstrap arguments and ultimately the stack

Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port

2023-04-02 Thread Samuel Thibault
Hello, Thanks for this series! I have pushed a first batch of commits, will review the rest later. Samuel

Re: [RFC PATCH glibc 31/34] hurd: Microoptimize _hurd_self_sigstate ()

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:10:14 +0300, a ecrit: > When THREAD_GETMEM is defined with inline assembly, the compiler may not > optimize away the two reads of _hurd_sigstate. Help it out a little bit > by only reading it once. This also makes for a slightly cleaner code.

Re: [RFC PATCH glibc 29/34] hurd: Add vm_param.h for x86_64

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:10:12 +0300, a ecrit: > Signed-off-by: Sergey Bugaev > --- > sysdeps/mach/hurd/x86_64/vm_param.h | 24 > 1 file changed, 24 insertions(+) > create mode 100644 sysdeps/mach/hurd/x86_64/vm_param.h > > diff --git a/s

Re: [RFC PATCH glibc 28/34] hurd: Implement _hurd_longjmp_thread_state for x86_64

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:10:11 +0300, a ecrit: > Signed-off-by: Sergey Bugaev > --- > sysdeps/mach/hurd/x86_64/longjmp-ts.c | 41 +++ > 1 file changed, 41 insertions(+) > create mode 100644 sysdeps/mach/hurd/x86_64/longjmp-ts.c > > diff --

Re: [RFC PATCH glibc 23/34] elf: Stop including tls.h in ldsodefs.h

2023-04-02 Thread Samuel Thibault
Sergey Bugaev, le dim. 19 mars 2023 18:10:06 +0300, a ecrit: > Nothing in there needs tls.h Ok but includers might be erroneously relying on it. Did you try to build various configurations, to make sure that this isn't breaking any? > > Signed-off-by: Sergey Bugaev > --- > sysdeps/generic/ldso

Re: [RFC PATCH glibc 22/34] htl: Implement thread_set_pcsptp for x86_64

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:10:05 +0300, a ecrit: > Signed-off-by: Sergey Bugaev > --- > sysdeps/mach/hurd/x86_64/htl/pt-machdep.c | 73 +++ > 1 file changed, 73 insertions(+) > create mode 100644 sysdeps/mach/hurd/x86_64/htl/pt-machdep.c > > dif

Re: [RFC PATCH glibc 21/34] x86_64: Add rtld-stpncpy & rtld-strncpy

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:10:04 +0300, a ecrit: > Just like the other existing rtld-str* files, this provides rtld with > usable versions of stpncpy and strncpy. > > Signed-off-by: Sergey Bugaev > --- > sysdeps/x86_64/multiarch/rtld-stpncpy.S | 18 +

Re: [RFC PATCH glibc 20/34] htl: Add tcb-offsets.sym for x86_64

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:10:03 +0300, a ecrit: > The source code is the same as sysdeps/i386/htl/tcb-offsets.sym, but of > course the produced tcb-offsets.h will be different. > > Signed-off-by: Sergey Bugaev > --- > sysdeps/x86_64/htl/Makefile| 20 +++

Re: [RFC PATCH glibc 19/34] hurd: Move a couple of singal-related files to x86

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:10:02 +0300, a ecrit: > These do not need any changes to be used on x86_64. > > Signed-off-by: Sergey Bugaev > --- > sysdeps/mach/hurd/{i386 => x86}/exc2signal.c | 0 > sysdeps/mach/hurd/{i386 => x86}/signal-defines.sym | 0 > 2 file

Re: [RFC PATCH glibc 15/34] hurd: Use uintptr_t for register values in trampoline.c

2023-04-02 Thread Samuel Thibault
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 reassignme

Re: [RFC PATCH glibc 14/34] hurd: Move rtld-strncpy-c.c out of mach/hurd/

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:57 +0300, a ecrit: > There's nothing Mach- or Hurd-specific about it; any port that ends > up with rtld pulling in strncpy will need this. > > Signed-off-by: Sergey Bugaev > --- > sysdeps/{mach/hurd => }/i386/i686/multiarch/rtld-strncpy

Re: [RFC PATCH glibc 13/34] x86-64: Disable prefer_map_32bit_exec tunable on non-Linux

2023-04-02 Thread Samuel Thibault
Hello, Sergey Bugaev, le dim. 19 mars 2023 18:09:56 +0300, a ecrit: > While we could/should implement MAP_32BIT for the Hurd port by setting > all the high bits of mask in a vm_map () call, neither MAP_32BIT nor > glibc.cpu.prefer_map_32bit_exec exist on the Hurd as of now. Compile > this code out

Re: [RFC PATCH glibc 12/34] hurd: More 64-bit integer casting fixes

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:55 +0300, a ecrit: > Signed-off-by: Sergey Bugaev > --- > sysdeps/mach/hurd/ioctl.c | 4 ++-- > sysdeps/mach/hurd/x86/init-first.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/sysdeps/mach/hurd/

Re: [RFC PATCH glibc 11/34] mach, hurd: Drop __libc_lock_self0

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:54 +0300, a ecrit: > This was used for the value of libc-lock's owner when TLS is not yet set > up, so THREAD_SELF can not be used. Since the value need not be anything > specific -- it just has to be non-NULL -- we can just use a plain >

Re: [RFC PATCH glibc 10/34] stdio-common: Fix building when !IS_IN (libc)

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:53 +0300, a ecrit: > In this case, _itoa_word () is already defined inline in the header (see > sysdeps/generic/_itoa.h), and the second definition causes an error. > > Signed-off-by: Sergey Bugaev > --- > stdio-common/_itoa.c | 2 ++ >

Re: [RFC PATCH glibc 09/34] hurd: Fix _hurd_setup_sighandler () signature

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:52 +0300, a ecrit: > Signed-off-by: Sergey Bugaev > --- > hurd/trampoline.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/hurd/trampoline.c b/hurd/trampoline.c > index a0639a20..5bd8dec9 100644 > --

Re: [RFC PATCH glibc 08/34] hurd: Disable O_TRUNC and FS_RETRY_MAGICAL in rtld

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:51 +0300, a ecrit: > hurd/lookup-retry.c is compiled into rtld, the dynamic linker/loader. To > avoid pulling in file_set_size, file_utimens, tty/ctty stuff, more > string/memory code (memmove, strncpy, strcpy), and more strtoul/itoa > cod

Re: [RFC PATCH glibc 07/34] hurd: Fix file name in #error

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:50 +0300, a ecrit: > Signed-off-by: Sergey Bugaev > --- > hurd/longjmp-ts.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hurd/longjmp-ts.c b/hurd/longjmp-ts.c > index bc4add32..0032d747 100644 > --- a/hurd/lo

Re: [RFC PATCH glibc 06/34] hurd: Swap around two function calls

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:49 +0300, a ecrit: > ...to keep `sigexc' port initialization in one place, and match what the > comments say. > > No functional change. > > Signed-off-by: Sergey Bugaev > --- > hurd/hurdfault.c | 8 > 1 file changed, 4 inserti

Re: [RFC PATCH glibc 05/34] hurd: Remove __hurd_threadvar_stack_{offset,mask}

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:48 +0300, a ecrit: > Noone is or should be using __hurd_threadvar_stack_{offset,mask}, we > have proper TLS now. These two remaining variables are never set to > anything other than zero, so any code that would try to use them as > describ

Re: [RFC PATCH glibc 04/34] hurd: Make exception subcode a long

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:47 +0300, a ecrit: > On EXC_BAD_ACCESS, exception subcode is used to pass the faulting memory > address, so it needs to be (at least) pointer-sized. Thus, make it into > a long. This matches the corresponding change in GNU Mach. > --- > h

Re: [RFC PATCH gnumach 03/34] Make exception subcode a long

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:46 +0300, a ecrit: > On EXC_BAD_ACCESS, exception subcode is used to pass the faulting memory > address, so it needs to be (at least) pointer-sized. Thus, make it into > a long. > > This requires matching changes in glibc and the Hurd. B

Re: [RFC PATCH gnumach 02/34] Remove bootstrap.defs

2023-04-02 Thread Samuel Thibault
Hello, I guess the do_bootstrap_privileged_ports function can be dropped from the hurd repo? Applied, thanks! Samuel Sergey Bugaev, le dim. 19 mars 2023 18:09:45 +0300, a ecrit: > As far as I can see, this file was imported in the very beginning of GNU Mach > history, and unused since then. Nob

Re: [RFC PATCH gnumach 01/34] Add i386_fsgs_base_state

2023-04-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:09:44 +0300, a ecrit: > --- > i386/include/mach/i386/thread_status.h | 8 > 1 file changed, 8 insertions(+) > > diff --git a/i386/include/mach/i386/thread_status.h > b/i386/include/mach/i386/thread_status.h > index 3de22ff3..32e40

Re: [PATCH gnumach] Align the user stack correctly for 64 bit programs.

2023-04-02 Thread Samuel Thibault
Hello, Flávio Cruz, le lun. 20 mars 2023 23:58:32 -0400, a ecrit: > On Mon, Mar 20, 2023 at 3:50 AM Luca <[1]l...@orpolo.org> wrote: > > Hi! This indeed seems to make rpc work, at least in my tests. > > Il 20/03/23 05:59, Flavio Cruz ha scritto: > > diff --git a/i386/i386/thread.h b/

Re: [PATCH hurd] Use the new host_get_kernel_version introduced recently.

2023-04-02 Thread Samuel Thibault
Applied, thanks! Flavio Cruz, le mer. 15 mars 2023 02:21:53 -0400, a ecrit: > https://git.savannah.gnu.org/cgit/hurd/gnumach.git/commit/?id=5447f965f1e109f7ac9aeb91c0e3906969a4adb8 > provides more context. > --- > proc/host.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff

Re: [PATCH gnumach] Use c_string to define symtab_name_t.

2023-04-02 Thread Samuel Thibault
Applied, thanks! Flavio Cruz, le mer. 15 mars 2023 02:08:08 -0400, a ecrit: > As mentioned in 5447f965, the c_string type correctly uses > msgt_size/msgt_number, resulting in a more compact ABI that doesn't > require mach_msg_type_long_t. > > I redefined host_load_symbol_table with a new Id since

Re: [PATCH hurd] Modernize code by removing use of old style definitions.

2023-04-02 Thread Samuel Thibault
Applied, thanks! Flavio Cruz, le sam. 18 mars 2023 23:18:11 -0400, a ecrit: > Also add -Werror=old-style-definition to enforce new code. > --- > Makeconf | 4 +- > benchmarks/forks.c| 4 +- > boot/boot.c |

Re: [PATCH gnumach] Add timing info to MACH_LOCK_MON lock monitoring

2023-04-02 Thread Samuel Thibault
Hello, Damien Zammit, le sam. 18 mars 2023 03:25:05 +, a ecrit: > +#ifdef MACH_LOCK_MON > + if (cpu_number() == 0) > + tick_stamp++; > +#endif There is already elapsed_ticks, please use that. Samuel

Re: Interest in GNU Hurd Project for GSoC 2023

2023-04-02 Thread Samuel Thibault
Hello, Yasser Cherfaoui, le ven. 31 mars 2023 15:14:23 +0100, a ecrit: > I have reviewed the list of project ideas on the GNU Hurd website and I am > particularly interested in the following projects: > > Improving the Hurd networking subsystem > Enhancing Hurd's virtual memory subsystem > Adding

Re: GSoC Project Proposal for GNU/Hurd and Rust

2023-04-02 Thread jbranso
April 1, 2023 8:59 PM, "Vedant Tewari" wrote: > Hello, > I am a current potential contributor to GSoC 2023 and am still looking for a > project and would love > to learn about Rust, I am a C Programmer and have worked Unix and Linux > Kernels in the past, I have > some experience working with c

GDB breakpoints are broken in new threads -- here's why

2023-04-02 Thread Sergey Bugaev
Hello -- and pardon the clickbait-y subject line (a large part of this was written yesterday, on April 1st :) While debugging my multi-threaded translator [0], I ran into an annoying issue: when I set a breakpoint on a server-side MIG routine (S_dir_readdir in my specific case) and send the matchi