bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] x86_64: install emergency handler for double fault


From: Luca Dariz
Subject: Re: [PATCH 2/3] x86_64: install emergency handler for double fault
Date: Mon, 19 Jun 2023 19:51:13 +0200

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

[Prev in Thread] Current Thread [Next in Thread]