Re: [PATCH 02/12 gnumach] Add cpu_number and cpuboot

2023-01-31 Thread Samuel Thibault
Almudena Garcia, le mar. 31 janv. 2023 22:43:39 +0100, a ecrit: > I've just noticed that cpuboot.S is my code. Ah, that one too? Please, people, make sure to track which code you are re-using, to properly account credit... > Please make an amend to add this Unfortunately git history cannot be m

Re: [PATCH 02/12 gnumach] Add cpu_number and cpuboot

2023-01-31 Thread Almudena Garcia
I've just noticed that cpuboot.S is my code. Please make an amend to add this El mar, 31 ene 2023 a las 20:38, Samuel Thibault () escribió: > Applied, thanks! > > Damien Zammit, le mar. 31 janv. 2023 09:35:44 +, a ecrit: > > I addressed most of the previous review. > > MSRs are easier to set

Re: Out of order building

2023-01-31 Thread Samuel Thibault
Ryan Raymond, le lun. 30 janv. 2023 19:16:37 -0500, a ecrit: > I think I found a resolvable issue. Still looking into it though. > Apparently some things which depend on libstrore/libstore.so are built before > it. The solution is to run make libstore and then continue. If this fixes it > I'd like

Re: [PATCH gnumach] Define rpc_vm_size_array_t and rpc_vm_offset_array_t

2023-01-31 Thread Samuel Thibault
Applied, thanks! Flavio Cruz, le mar. 31 janv. 2023 01:08:09 -0500, a ecrit: > When generating stubs, Mig will will take the vm_size_array_t and define the > input request struct using rpc_vm_size_t since the size is variable. This > will turn cause a mismatch > between types (vm_size_t* vs rpc_v

Re: [PATCH 11/12 gnumach] smp: Serialise AP bringup

2023-01-31 Thread Samuel Thibault
Damien Zammit, le mar. 31 janv. 2023 09:39:35 +, a ecrit: > @@ -262,11 +259,14 @@ cpu_setup() > void > cpu_ap_main() > { > +unsigned apic_id = (((ApicLocalUnit*)phystokv(lapic_addr))->apic_id.r >> > 24) & 0xff; > +int cpu = apic_get_cpu_kernel_id(apic_id); > + > do { >

Re: [PATCH 11/12 gnumach] smp: Serialise AP bringup

2023-01-31 Thread Samuel Thibault
I'd say squash this with patch 9, that'll answer Almudena's fear of parallel startup :) Also it'll avoid introducing code in patch 9 that gets fixed here in patch 11. Damien Zammit, le mar. 31 janv. 2023 09:39:35 +, a ecrit: > --- > i386/i386/mp_desc.c | 26 +++--- >

Re: [PATCH 04/12 gnumach] locore: Fix int stack check

2023-01-31 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le mar. 31 janv. 2023 09:36:38 +, a ecrit: > TODO: Return kernel_id via lookup table, not apic_id > > --- > i386/i386/cpu_number.h | 7 +++ > i386/i386/locore.S | 15 +-- > 2 files changed, 16 insertions(+), 6 deletions(-) > > diff --git

Re: [PATCH gnumach] Define rpc_vm_size_array_t and rpc_vm_offset_array_t

2023-01-31 Thread Luca
Hi Sergey, Il 31/01/23 14:30, Sergey Bugaev ha scritto: I understand they are related to the x64 bringup, and possibly to running 32-bit userland on a 64-bit kernel (or to support for 32-bit tasks communicating with 64-bit tasks?). It's hust for running 32-bit userland on 64-bit kernel (USER32

Re: [PATCH 12/12 gnumach] Debug printf when sending TLB IPI

2023-01-31 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le mar. 31 janv. 2023 09:39:53 +, a ecrit: > --- > i386/i386/smp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/i386/i386/smp.c b/i386/i386/smp.c > index acf69d21..c6a62958 100644 > --- a/i386/i386/smp.c > +++ b/i386/i386/smp.c > @@

Re: [PATCH 10/12 gnumach] Fix makefrags

2023-01-31 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le mar. 31 janv. 2023 09:39:09 +, a ecrit: > --- > i386/Makefrag.am | 5 +++-- > i386/Makefrag_x86.am | 3 +++ > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/i386/Makefrag.am b/i386/Makefrag.am > index 68460c49..5881f9f3 100644 > --- a

Re: [PATCH 08/12 gnumach] smp: Deassert IPI 251 as part of sequence

2023-01-31 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le mar. 31 janv. 2023 09:38:18 +, a ecrit: > --- > i386/i386/smp.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/i386/i386/smp.c b/i386/i386/smp.c > index c351efaa..acf69d21 100644 > --- a/i386/i386/smp.c > +++ b/i386/i386/smp.c

Re: [PATCH 07/12 gnumach] Always use directed EOI and disable focus

2023-01-31 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le mar. 31 janv. 2023 09:37:55 +, a ecrit: > --- > i386/i386/apic.c | 4 +++- > i386/i386at/ioapic.c | 9 - > 2 files changed, 3 insertions(+), 10 deletions(-) > > diff --git a/i386/i386/apic.c b/i386/i386/apic.c > index 891ce288..ff7ba3e2 100644 >

Re: [PATCH 06/12 gnumach] linux: Skip updating jiffies on AP timer

2023-01-31 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le mar. 31 janv. 2023 09:37:28 +, a ecrit: > --- > linux/dev/kernel/sched.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/linux/dev/kernel/sched.c b/linux/dev/kernel/sched.c > index 2a9eeb3f..f9c52d1e 100644 > --- a/linux/dev/kernel/sched.c > +++

Re: [PATCH 05/12 gnumach] interrupt: Send EOI before handling update interrupt

2023-01-31 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le mar. 31 janv. 2023 09:37:03 +, a ecrit: > --- > i386/i386at/interrupt.S | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/i386/i386at/interrupt.S b/i386/i386at/interrupt.S > index 9f1883ac..1103b1c8 100644 > --- a/i386/i386at/interrup

Re: [PATCH 03/12 gnumach] Print warning on bad cpu numbering and assume BSP

2023-01-31 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le mar. 31 janv. 2023 09:36:12 +, a ecrit: > --- > i386/i386/apic.c | 5 + > i386/i386/cpu_number.c | 16 +--- > 2 files changed, 18 insertions(+), 3 deletions(-) > > diff --git a/i386/i386/apic.c b/i386/i386/apic.c > index e53d4749..891

Re: [PATCH 02/12 gnumach] Add cpu_number and cpuboot

2023-01-31 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le mar. 31 janv. 2023 09:35:44 +, a ecrit: > I addressed most of the previous review. > MSRs are easier to set in asm so I have left it in. > > --- > i386/i386/cpu_number.c | 33 + > i386/i386/cpuboot.S| 164 +++

Re: [PATCH 01/12 gnumach] i386: Fix lapic and ioapic for smp

2023-01-31 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le mar. 31 janv. 2023 09:35:21 +, a ecrit: > Also-by: Almudena Garcia > --- > i386/i386/apic.c | 87 ++--- > i386/i386/apic.h | 114 --- > i386/i386/smp.c | 89 +

Re: [PATCH 09/12 gnumach] i386: Refactor int stacks for SMP - shared temp pmap

2023-01-31 Thread Almudena Garcia
void start_other_cpus(void) { - int cpu; - for (cpu = 0; cpu < NCPUS; cpu++) - if (cpu != cpu_number()) - cpu_start(cpu); -} + unsigned long flags; + + cpu_intr_save(&flags); + + int ncpus = smp_get_numcpus(); + //Copy cpu i

Re: [PATCH gnumach] Define rpc_vm_size_array_t and rpc_vm_offset_array_t

2023-01-31 Thread Sergey Bugaev
Replying to myself after looking at the definition: On Tue, Jan 31, 2023 at 12:06 PM Sergey Bugaev wrote: > > I understand they are related to the x64 bringup, and possibly to > running 32-bit userland on a 64-bit kernel (or to support for 32-bit > tasks communicating with 64-bit tasks?). It's h

Re: [PATCH 09/12 gnumach] i386: Refactor int stacks for SMP - shared temp pmap

2023-01-31 Thread Almudena Garcia
Please. Don't enable pagging yet. It requires some preliminary steps. Added to this, I prefer configure pagging in a separate function El mar., 31 ene. 2023 10:39, Damien Zammit escribió: > Also-by: Almudena Garcia > --- > i386/i386/cpu_number.h | 15 +- > i386/i386/cswitch.S

[PATCH 12/12 gnumach] Debug printf when sending TLB IPI

2023-01-31 Thread Damien Zammit
--- i386/i386/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386/i386/smp.c b/i386/i386/smp.c index acf69d21..c6a62958 100644 --- a/i386/i386/smp.c +++ b/i386/i386/smp.c @@ -53,7 +53,7 @@ void smp_pmap_update(unsigned apic_id) cpu_intr_save(&flags); -printf("

[PATCH 11/12 gnumach] smp: Serialise AP bringup

2023-01-31 Thread Damien Zammit
--- i386/i386/mp_desc.c | 26 +++--- i386/i386at/ioapic.c| 1 - i386/i386at/model_dep.c | 1 - i386/intel/pmap.c | 1 + kern/startup.c | 5 - 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.

[PATCH 10/12 gnumach] Fix makefrags

2023-01-31 Thread Damien Zammit
--- i386/Makefrag.am | 5 +++-- i386/Makefrag_x86.am | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/i386/Makefrag.am b/i386/Makefrag.am index 68460c49..5881f9f3 100644 --- a/i386/Makefrag.am +++ b/i386/Makefrag.am @@ -30,6 +30,8 @@ if HOST_ix86 # libkernel_a_SOURCES

[PATCH 09/12 gnumach] i386: Refactor int stacks for SMP - shared temp pmap

2023-01-31 Thread Damien Zammit
Also-by: Almudena Garcia --- i386/i386/cpu_number.h | 15 +- i386/i386/cswitch.S | 6 +- i386/i386/i386asm.sym| 3 + i386/i386/locore.S | 4 +- i386/i386/mp_desc.c | 227 ++- i386/i386/mp_desc.h

[PATCH 08/12 gnumach] smp: Deassert IPI 251 as part of sequence

2023-01-31 Thread Damien Zammit
--- i386/i386/smp.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/i386/i386/smp.c b/i386/i386/smp.c index c351efaa..acf69d21 100644 --- a/i386/i386/smp.c +++ b/i386/i386/smp.c @@ -60,7 +60,11 @@ void smp_pmap_update(unsigned apic_id) pause_memory; } while(l

[PATCH 07/12 gnumach] Always use directed EOI and disable focus

2023-01-31 Thread Damien Zammit
--- i386/i386/apic.c | 4 +++- i386/i386at/ioapic.c | 9 - 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/i386/i386/apic.c b/i386/i386/apic.c index 891ce288..ff7ba3e2 100644 --- a/i386/i386/apic.c +++ b/i386/i386/apic.c @@ -304,7 +304,9 @@ lapic_enable(void) /* E

[PATCH 06/12 gnumach] linux: Skip updating jiffies on AP timer

2023-01-31 Thread Damien Zammit
--- linux/dev/kernel/sched.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux/dev/kernel/sched.c b/linux/dev/kernel/sched.c index 2a9eeb3f..f9c52d1e 100644 --- a/linux/dev/kernel/sched.c +++ b/linux/dev/kernel/sched.c @@ -616,6 +616,9 @@ int linux_timer_print = 0; void linux_timer_in

[PATCH 05/12 gnumach] interrupt: Send EOI before handling update interrupt

2023-01-31 Thread Damien Zammit
--- i386/i386at/interrupt.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386/i386at/interrupt.S b/i386/i386at/interrupt.S index 9f1883ac..1103b1c8 100644 --- a/i386/i386at/interrupt.S +++ b/i386/i386at/interrupt.S @@ -122,8 +122,8 @@ _no_eoi: ret _call_single: +

[PATCH 04/12 gnumach] locore: Fix int stack check

2023-01-31 Thread Damien Zammit
TODO: Return kernel_id via lookup table, not apic_id --- i386/i386/cpu_number.h | 7 +++ i386/i386/locore.S | 15 +-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/i386/i386/cpu_number.h b/i386/i386/cpu_number.h index 9aef6370..a6dd47d6 100644 --- a/i386/i38

[PATCH 03/12 gnumach] Print warning on bad cpu numbering and assume BSP

2023-01-31 Thread Damien Zammit
--- i386/i386/apic.c | 5 + i386/i386/cpu_number.c | 16 +--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/i386/i386/apic.c b/i386/i386/apic.c index e53d4749..891ce288 100644 --- a/i386/i386/apic.c +++ b/i386/i386/apic.c @@ -278,6 +278,11 @@ lapic_enable(v

[PATCH 02/12 gnumach] Add cpu_number and cpuboot

2023-01-31 Thread Damien Zammit
I addressed most of the previous review. MSRs are easier to set in asm so I have left it in. --- i386/i386/cpu_number.c | 33 + i386/i386/cpuboot.S| 164 + 2 files changed, 197 insertions(+) create mode 100644 i386/i386/cpu_number.c create mo

[PATCH 01/12 gnumach] i386: Fix lapic and ioapic for smp

2023-01-31 Thread Damien Zammit
Also-by: Almudena Garcia --- i386/i386/apic.c | 87 ++--- i386/i386/apic.h | 114 --- i386/i386/smp.c | 89 - i386/i386/smp.h | 7 +++ i386/i386at/ioapic.c | 97 ++---

[PATCH 00/12 gnumach] Progress on SMP with N cpus

2023-01-31 Thread Damien Zammit
This gets us closer to a working SMP kernel without breaking our non-SMP mode. What was tested? - kdb, apic, ncpus=8 with -smp 1 (boots slow) - kdb, apic, ncpus=8 with -smp 2 (hangs) - kdb, apic, ncpus=8 with -smp 4 (hangs) - kdb, apic, ncpus=8 with -smp 6 (hangs) - (no options) with -smp 1

Re: [PATCH gnumach] Define rpc_vm_size_array_t and rpc_vm_offset_array_t

2023-01-31 Thread Sergey Bugaev
On Tue, Jan 31, 2023 at 9:08 AM Flavio Cruz wrote: > > When generating stubs, Mig will will take the vm_size_array_t and define the > input request struct using rpc_vm_size_t since the size is variable. This > will turn cause a mismatch > between types (vm_size_t* vs rpc_vm_size_t*). We could als