Re: [PATCH 2/5 gnumach] i386: Refactor int stacks to be per cpu for SMP

2023-02-04 Thread Samuel Thibault
Damien Zammit, le sam. 04 févr. 2023 01:32:02 +, a ecrit: > On 4/2/23 12:27, Almudena Garcia wrote: > > But, added to interrupt stacks, the APs needs their own stacks once these > > are running, to store data of the process which are executing. > > I thought this kind of stack is dynamically

Re: [PATCH 2/5 gnumach] i386: Refactor int stacks to be per cpu for SMP

2023-02-03 Thread Damien Zammit
On 4/2/23 12:27, Almudena Garcia wrote: > But, added to interrupt stacks, the APs needs their own stacks once these are > running, to store data of the process which are executing. I thought this kind of stack is dynamically allocated by the thread manager (?) Damien

Re: [PATCH 2/5 gnumach] i386: Refactor int stacks to be per cpu for SMP

2023-02-03 Thread Almudena Garcia
But, added to interrupt stacks, the APs needs their own stacks once these are running, to store data of the process which are executing. El sáb., 4 feb. 2023 2:24, Damien Zammit escribió: > Hi Almu, > > On 3/2/23 02:56, Almudena Garcia wrote: > > I already suggested move this to a function > > >

Re: [PATCH 2/5 gnumach] i386: Refactor int stacks to be per cpu for SMP

2023-02-03 Thread Damien Zammit
Hi Almu, On 3/2/23 02:56, Almudena Garcia wrote: > I already suggested move this to a function > > +#ifndef MACH_HYP > +    /* Turn paging on. > +     * TODO: Why does setting the WP bit here cause a crash? > +     */ > +    set_cr0(get_cr0() | CR0_PG /* | CR0_WP */); > +    set_cr0(get_cr0() & ~(

Re: [PATCH 2/5 gnumach] i386: Refactor int stacks to be per cpu for SMP

2023-02-02 Thread Almudena Garcia
I already suggested move this to a function +#ifndef MACH_HYP +/* Turn paging on. + * TODO: Why does setting the WP bit here cause a crash? + */ +set_cr0(get_cr0() | CR0_PG /* | CR0_WP */); +set_cr0(get_cr0() & ~(CR0_CD | CR0_NW)); +if (CPU_HAS_FEATURE(CPU_FEATURE_PGE)) +

Re: [PATCH 2/5 gnumach] i386: Refactor int stacks to be per cpu for SMP

2023-02-01 Thread Samuel Thibault
Hello, Damien Zammit, le mer. 01 févr. 2023 10:05:47 +, a ecrit: > This is a rather large commit, but difficult to break it up. Perhaps you can separate out the moving of the i386at_init code > @@ -448,47 +444,8 @@ i386at_init(void) >*/ > biosmem_setup(); > > - /* > -

Re: [PATCH 2/5 gnumach] i386: Refactor int stacks to be per cpu for SMP

2023-02-01 Thread Almudena Garcia
+/* Turn paging on. + * TODO: Why does setting the WP bit here cause a crash? + */ +set_cr0(get_cr0() | CR0_PG /* | CR0_WP */); +set_cr0(get_cr0() & ~(CR0_CD | CR0_NW)); +if (CPU_HAS_FEATURE(CPU_FEATURE_PGE)) +set_cr4(get_cr4() | CR4_PGE); Check my original paging_s

[PATCH 2/5 gnumach] i386: Refactor int stacks to be per cpu for SMP

2023-02-01 Thread Damien Zammit
This is a rather large commit, but difficult to break it up. This also serialises the AP bringup, so paging can be enabled per cpu one by one. Also-by: Almudena Garcia --- i386/i386/cpu_number.h | 2 + i386/i386/mp_desc.c | 226 i386/i386/mp_desc.h