Re: [PATCH gnumach] smp: Rearrange IPI sending mechanism

2024-02-11 Thread Samuel Thibault
Damien Zammit, le dim. 11 févr. 2024 07:08:48 +, a ecrit: > Wait for ICR then just assert the signal. No de-assert. Please mention in the commit log why. > --- > i386/i386/smp.c | 8 +--- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/i386/i386/smp.c b/i386/i386/smp.

Re: [PATCH gnumach] smp: Fix unable to enter kdb during boot

2024-02-11 Thread Samuel Thibault
Damien Zammit, le dim. 11 févr. 2024 07:09:03 +, a ecrit: > --- > i386/i386at/kd.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c > index 984d62e3..486dea67 100644 > --- a/i386/i386at/kd.c > +++ b/i386/i386at/kd.c > @@ -458,6 +458,7 @@ kdopen( >

Re: [PATCH gnumach] smp: Fix parenthesis around logic expression value

2024-02-11 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le dim. 11 févr. 2024 07:09:20 +, a ecrit: > --- > kern/thread.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kern/thread.c b/kern/thread.c > index 38287581..de9d1982 100644 > --- a/kern/thread.c > +++ b/kern/thread.c > @@ -1921,7 +

Re: [PATCH gnumach] Enable MACH_HOST and fix non-addressable bitfields

2024-02-11 Thread Samuel Thibault
Damien Zammit, le dim. 11 févr. 2024 07:09:48 +, a ecrit: > --- > configfrag.ac | 2 +- > kern/task.h | 10 +- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/configfrag.ac b/configfrag.ac > index f9285c9d..d059c7b9 100644 > --- a/configfrag.ac > +++ b/configfra

Re: [PATCH gnumach] smp: Create AP processor set and put all APs inside it

2024-02-11 Thread Almudena Garcia
I don't understand which is the objective of this. In an SMP system, all processor are equal in the scheduler. Why do you add this difference? El domingo 11 de febrero de 2024, Damien Zammit escribió: > This has the effect of running with one cpu only with smp, > but has the ability to enable AP

Re: [PATCH gnumach] smp: Create AP processor set and put all APs inside it

2024-02-11 Thread Samuel Thibault
Damien Zammit, le dim. 11 févr. 2024 07:10:24 +, a ecrit: > This has the effect of running with one cpu only with smp, > but has the ability to enable APs in userspace with the right > processor set RPCs. > --- > ddb/db_print.c | 4 +++- > kern/machine.c | 7 ++- > kern/processor.c |

Re: [PATCH gnumach] smp: Create AP processor set and put all APs inside it

2024-02-11 Thread Samuel Thibault
Almudena Garcia, le dim. 11 févr. 2024 10:48:23 +, a ecrit: > I don't understand which is the objective of this. In an SMP system, all > processor are equal in the scheduler. Why do you add this difference? That's what we had already discussed at the time you introduced the initial SMP code:

Re: [PATCH gnumach] Enable MACH_HOST and fix non-addressable bitfields

2024-02-11 Thread Damien Zammit
Hi, On 2/11/24 9:43 PM, Samuel Thibault wrote: > Damien Zammit, le dim. 11 févr. 2024 07:09:48 +, a ecrit: >> diff --git a/configfrag.ac b/configfrag.ac >> index f9285c9d..d059c7b9 100644 >> --- a/configfrag.ac >> +++ b/configfrag.ac >> @@ -71,7 +71,7 @@ AC_DEFINE([MACH_DEBUG], [1], [MACH_DEB

Re: [PATCH gnumach] Enable MACH_HOST and fix non-addressable bitfields

2024-02-11 Thread Samuel Thibault
Damien Zammit, le dim. 11 févr. 2024 10:55:26 +, a ecrit: > >> diff --git a/kern/task.h b/kern/task.h > >> index dec3a530..27970620 100644 > >> --- a/kern/task.h > >> +++ b/kern/task.h > >> @@ -61,11 +61,11 @@ struct task { > >>decl_simple_lock_data(,lock)/* Task's lock */ > >>int

Re: [PATCH gnumach] smp: Create AP processor set and put all APs inside it

2024-02-11 Thread Almudena Garcia
With this old patch I got to boot and executive a bunch of threads splitting in multiple cpus https://git.zammit.org/gnumach-sv.git/commit/?h=fixes&id=0fe92b6b52726bcd2976863d344117dad8d19694 So I prefer to check which is the block of this that really cause the problem. With the patch I quote

Re: [PATCH gnumach] Enable MACH_HOST and fix non-addressable bitfields

2024-02-11 Thread Damien Zammit
Hi, On 2/11/24 10:07 PM, Samuel Thibault wrote: > Damien Zammit, le dim. 11 févr. 2024 10:55:26 +, a ecrit: diff --git a/kern/task.h b/kern/task.h index dec3a530..27970620 100644 --- a/kern/task.h +++ b/kern/task.h @@ -61,11 +61,11 @@ struct task { dec

[PATCH v2 gnumach] smp: Fix unable to enter kdb during boot

2024-02-11 Thread Damien Zammit
--- i386/i386at/kd.c | 1 + i386/i386at/kd_event.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c index 984d62e3..2bea3c8c 100644 --- a/i386/i386at/kd.c +++ b/i386/i386at/kd.c @@ -1127,6 +1127,7 @@ kdinit(void) k_comm |= K_CB

[PATCH v2 gnumach] smp: Rearrange IPI sending mechanism

2024-02-11 Thread Damien Zammit
Wait for ICR then just assert the signal. No need for deassert. This is how Linux and NetBSD does it. I couldn't find documentation on the correct method, however. --- i386/i386/smp.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/i386/i386/smp.c b/i386/i386/smp.c inde

[PATCH v2 gnumach] Enable MACH_HOST and fix non-addressable bitfields

2024-02-11 Thread Damien Zammit
This is only enabled when NCPUS > 1. Enables some older code paths that allows userspace to manage cpu resources via processor set RPCs. Size of struct task is preserved while making 4 bitfields addressable as 4 single byte fields. --- configfrag.ac | 8 ++-- kern/task.h | 10 +-

[PATCH v2 gnumach] smp: Create AP processor set and put all APs inside it

2024-02-11 Thread Damien Zammit
This has the effect of running with one cpu only with smp, but has the ability to enable APs in userspace with the right processor set RPCs. --- ddb/db_print.c | 10 +++--- kern/machine.c | 13 + kern/processor.c | 3 +++ kern/processor.h | 3 +++ 4 files changed, 26 insertio

Re: [PATCH v2 gnumach] smp: Rearrange IPI sending mechanism

2024-02-11 Thread Almudena Garcia
The ASSERT and DEASSERT, if I remember well, if a part of SIPI algorithm. I think that I extracted it from the Intel manuals. Or maybe from OSDev. El domingo 11 de febrero de 2024, Damien Zammit escribió: > Wait for ICR then just assert the signal. > No need for deassert. This is how Linux and

Re: [PATCH gnumach] Enable MACH_HOST and fix non-addressable bitfields

2024-02-11 Thread Samuel Thibault
Damien Zammit, le dim. 11 févr. 2024 11:30:31 +, a ecrit: > On 2/11/24 10:07 PM, Samuel Thibault wrote: > > Damien Zammit, le dim. 11 févr. 2024 10:55:26 +, a ecrit: > diff --git a/kern/task.h b/kern/task.h > index dec3a530..27970620 100644 > --- a/kern/task.h > +++ b/ke

Re: [PATCH v2 gnumach] smp: Fix unable to enter kdb during boot

2024-02-11 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le dim. 11 févr. 2024 12:00:04 +, a ecrit: > --- > i386/i386at/kd.c | 1 + > i386/i386at/kd_event.c | 2 -- > 2 files changed, 1 insertion(+), 2 deletions(-) > > diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c > index 984d62e3..2bea3c8c 100644 > --- a/i

Re: [PATCH v2 gnumach] smp: Create AP processor set and put all APs inside it

2024-02-11 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le dim. 11 févr. 2024 12:00:57 +, a ecrit: > This has the effect of running with one cpu only with smp, > but has the ability to enable APs in userspace with the right > processor set RPCs. > --- > ddb/db_print.c | 10 +++--- > kern/machine.c | 13 +

Re: [PATCH v2 gnumach] Enable MACH_HOST and fix non-addressable bitfields

2024-02-11 Thread Samuel Thibault
fixed and applied, thanks! Damien Zammit, le dim. 11 févr. 2024 12:00:29 +, a ecrit: > This is only enabled when NCPUS > 1. > Enables some older code paths that allows userspace > to manage cpu resources via processor set RPCs. > > Size of struct task is preserved while making 4 bitfields > a

Re: [PATCH gnumach] smp: Create AP processor set and put all APs inside it

2024-02-11 Thread Samuel Thibault
Almudena Garcia, le dim. 11 févr. 2024 11:17:01 +, a ecrit: > With this old patch I got to boot and executive a bunch of threads splitting > in multiple cpus > > https://git.zammit.org/gnumach-sv.git/commit/?h=fixes&id=0fe92b6b52726bcd2976863d344117dad8d19694 > > With the patch I quote and l

Re: [PATCH gnumach] Enable MACH_HOST and fix non-addressable bitfields

2024-02-11 Thread Samuel Thibault
Samuel Thibault, le dim. 11 févr. 2024 15:01:43 +0100, a ecrit: > Damien Zammit, le dim. 11 févr. 2024 11:30:31 +, a ecrit: > > On 2/11/24 10:07 PM, Samuel Thibault wrote: > > > Damien Zammit, le dim. 11 févr. 2024 10:55:26 +, a ecrit: > > diff --git a/kern/task.h b/kern/task.h > > >>>

Re: [PATCH gnumach] smp: Create AP processor set and put all APs inside it

2024-02-11 Thread Samuel Thibault
Samuel Thibault, le dim. 11 févr. 2024 15:13:51 +0100, a ecrit: > By being able to select which block gets exposed to parallelism, you can > selectively check which blocks work and which don't. (while also being already useful to be able to run make in parallel ;) Samuel

Re: [PATCH gnumach] smp: Create AP processor set and put all APs inside it

2024-02-11 Thread Almudena Garcia
But, how can I add the processors to the pset from userspace? I want to test the parallel environment from Hurd, although gnumach boots with 1 processor El dom, 11 feb 2024 a las 15:36, Samuel Thibault () escribió: > Samuel Thibault, le dim. 11 févr. 2024 15:13:51 +0100, a ecrit: > > By being abl

Re: [PATCH gnumach] smp: Create AP processor set and put all APs inside it

2024-02-11 Thread Samuel Thibault
Almudena Garcia, le dim. 11 févr. 2024 16:23:17 +0100, a ecrit: > But, how can I add the processors to the pset from userspace? Using processor set RPCs Probably we are missing an RPC to get the pset containing APs, but that's not hard to add. Samuel

Re: [PATCH gnumach] smp: Create AP processor set and put all APs inside it

2024-02-11 Thread Samuel Thibault
Samuel Thibault, le dim. 11 févr. 2024 16:50:51 +0100, a ecrit: > Almudena Garcia, le dim. 11 févr. 2024 16:23:17 +0100, a ecrit: > > But, how can I add the processors to the pset from userspace? > > Using processor set RPCs > > Probably we are missing an RPC to get the pset containing APs, but >

[PATCH gnumach] smp: Set processor set to non-empty when adding a processor

2024-02-11 Thread Damien Zammit
This allows the slave_pset to be used for actual tasks with the processor_set RPCs. --- kern/processor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kern/processor.c b/kern/processor.c index f06b5d62..71bbb757 100644 --- a/kern/processor.c +++ b/kern/processor.c @@ -245,6 +245,7 @@ void ps

Test program for running task on slave_pset

2024-02-11 Thread Damien Zammit
Hi, This program requires master branch PLUS a one line patch I just mailed in for gnumach. Here is a simple test program to enable a new task to run on slave_pset processor set containing the rest of the processors in SMP kernel. You can compile it as a sutil in hurd/sutils: usage must be run

[PATCH 1/2] Replace kernel header includes in include/mach/mach_types.h with forward declarations.

2024-02-11 Thread Flavio Cruz
I was trying to reuse TASK_NAME_SIZE in kern/thread.h but it was impossible because files included from kern/task.h end up requiring kern/thread.h (through percpu.h), creating a recursive dependency. With this change, mach_types.h only defines forward declarations and modules have to explicitly in

[PATCH 2/2] Add thread_set_name RPC.

2024-02-11 Thread Flavio Cruz
Like task_set_name, we use the same size as the task name and will inherit the task name, whenever it exists. This will be used to implement pthread_setname_np. --- ddb/db_print.c| 9 + include/mach/gnumach.defs | 8 kern/thread.c | 20 +++