[PATCH gnumach] ast: Implement cause_ast_check() by switching cpus

2023-08-05 Thread Damien Zammit
If the current processor is not the one we want to run an ast on, we can bind the current thread to the processor we want, and force a thread switch to that one, then run the ast_check() on the right cpu. --- i386/i386/ast_check.c | 13 +++-- 1 file changed, 11 insertions(+), 2

[PATCH gnumach] pmap: Fix out of bounds mapwindow when using full NCPUS

2023-08-05 Thread Damien Zammit
There are only two slots per cpu. Use only one of two per cpu. --- i386/intel/pmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index 0bb1a490..9bcbc279 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -1020,10 +1020,10

[PATCH gnumach] pmap: Add missing PMAP_READ_LOCK fixes uninitialized spl

2023-08-05 Thread Damien Zammit
--- i386/intel/pmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index 9bcbc279..aa5522b3 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -2462,6 +2462,7 @@ void pmap_collect(pmap_t p) /* * Free the page table tree.

[PATCH gnumach] kern/thread: Only loop over cpus that exist

2023-08-05 Thread Damien Zammit
--- kern/thread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kern/thread.c b/kern/thread.c index a324eed7..9bbe8342 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -2570,7

[PATCH gnumach] interrupt.S: No nested interrupts during IPIs && more x86_64 smp support

2023-08-05 Thread Damien Zammit
--- i386/i386at/interrupt.S | 1 + x86_64/interrupt.S | 10 ++ 2 files changed, 11 insertions(+) diff --git a/i386/i386at/interrupt.S b/i386/i386at/interrupt.S index 55f4fa0f..1f661f8d 100644 --- a/i386/i386at/interrupt.S +++ b/i386/i386at/interrupt.S @@ -123,6 +123,7 @@ _no_eoi:

Re: [PATCH gnumach] cpu_number: Look up cpu kernel_id via lookup table

2023-08-05 Thread Almudena Garcia
With this change we can update CPU_NUMBER assembly routine to a simpler version. El sábado 5 de agosto de 2023, Damien Zammit escribió: > This speeds up smp slightly by reducing the cpu_number() > complexity to have no branching, just a look up table. > It also addresses the problem that

Re: [PATCH gnumach] cpu_number: Look up cpu kernel_id via lookup table

2023-08-05 Thread Samuel Thibault
Applied, thanks! Damien Zammit, le sam. 05 août 2023 07:49:54 +, a ecrit: > This speeds up smp slightly by reducing the cpu_number() > complexity to have no branching, just a look up table. > It also addresses the problem that CPU_NUMBER was only using > raw apic_id as an approximation of the

[PATCH gnumach] cpu_number: Look up cpu kernel_id via lookup table

2023-08-05 Thread Damien Zammit
This speeds up smp slightly by reducing the cpu_number() complexity to have no branching, just a look up table. It also addresses the problem that CPU_NUMBER was only using raw apic_id as an approximation of the kernel_id. Other improvements were to remove unnecessary checks now that the lookup