Hello: From the l4-x2 manual it is said the reply from the exception handler contains a label, an instruction pointer where the faulting thread is resumed. I want to know whether it is implemented in the Fiasco. I try to do this. Modify the utcb before send ipc resume the exception thread but it seems no any effect about the instruction pointer and stack pointer of resumed exception thread. Thanks. Cheng Guanghui
On Sun Oct 11, 2009 at 22:17:49 +0800, Guanghui, Cheng wrote:
From the l4-x2 manual it is said the reply from the exception handler contains a label, an instruction pointer where the faulting thread is resumed. I want to know whether it is implemented in the Fiasco. I try to do this. Modify the utcb before send ipc resume the exception thread but it seems no any effect about the instruction pointer and stack pointer of resumed exception thread.
My guess would be that you did not set the number of words to send in the reply. Set L4_UTCB_EXCEPTION_REGS_SIZE in the msgtag-words field of the reply.
Adam
On Monday 12 October 2009 02:03:41 Adam Lackorzynski wrote:
On Sun Oct 11, 2009 at 22:17:49 +0800, Guanghui, Cheng wrote:
From the l4-x2 manual it is said the reply from the exception handler contains a label, an instruction pointer where the faulting thread is resumed. I want to know whether it is implemented in the Fiasco. I try to do this. Modify the utcb before send ipc resume the exception thread but it seems no any effect about the instruction pointer and stack pointer of resumed exception thread.
My guess would be that you did not set the number of words to send in the reply. Set L4_UTCB_EXCEPTION_REGS_SIZE in the msgtag-words field of the reply.
Hello Adam: Now i use L4_UTCB_EXCEPTION_REGS_SIZE and i could fix the thread with esp and eip by exception handler UTCB. And the thread could start with new instruction pointer and new stack pointer. But it still has some problem when the thread quit from new function. So i want to know how an thread is resumed by exception reply. I mean which part of code in kernel could finish the thread wakeup. I read the receive.c but i don't find it. Thanks. Cheng
On Tue Oct 13, 2009 at 13:01:46 +0800, Guanghui, Cheng wrote:
On Monday 12 October 2009 02:03:41 Adam Lackorzynski wrote:
On Sun Oct 11, 2009 at 22:17:49 +0800, Guanghui, Cheng wrote:
From the l4-x2 manual it is said the reply from the exception handler contains a label, an instruction pointer where the faulting thread is resumed. I want to know whether it is implemented in the Fiasco. I try to do this. Modify the utcb before send ipc resume the exception thread but it seems no any effect about the instruction pointer and stack pointer of resumed exception thread.
My guess would be that you did not set the number of words to send in the reply. Set L4_UTCB_EXCEPTION_REGS_SIZE in the msgtag-words field of the reply.
Hello Adam: Now i use L4_UTCB_EXCEPTION_REGS_SIZE and i could fix the thread with esp and eip by exception handler UTCB. And the thread could start with new instruction pointer and new stack pointer. But it still has some problem when the thread quit from new function. So i want to know how an thread is resumed by exception reply. I mean which part of code in kernel could finish the thread wakeup. I read the receive.c but i don't find it.
The function copy_utcb_to_ts copies the state from the utcb of the exception handler over the state of the thread. The thread then resumes with this new state. I think what you have to do is to e.g. prepare the stack of the thread in a way that when the new function's ret is called it resumes at the position it was intercepted. Is this possible?
Adam
l4-hackers@os.inf.tu-dresden.de