Il 17/06/23 23:12, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 15 juin 2023 23:49:30 +0200, a ecrit:
diff --git a/i386/i386/ktss.c b/i386/i386/ktss.c
index 1d880167..52f3722c 100644
--- a/i386/i386/ktss.c
+++ b/i386/i386/ktss.c
@@ -61,6 +61,7 @@ ktss_fill(struct task_tss *myktss, struct real_descriptor 
*mygdt)
        /* Initialize the master TSS.  */
  #ifdef __x86_64__
        myktss->tss.rsp0 = (unsigned long)(exception_stack+1024);
+       myktss->tss.ist1 = (unsigned long)(exception_stack+1024);

Shouldn't we use a different stack, to avoid overwriting information
from the first fault?

you're right, otherwise it will be less useful in case a double fault happens before scheduling starts (which then overwrites rsp0 with the pcb stack on every context switch).

Thinking about the smp case, are the cpu started in parallel or sequentially? There might also be a need to set a cpu-specific first rsp0, if there is the possibility to have early interrupts concurrently.


Luca


Reply via email to