Will L4_Ipc loses from ThreadID by occurring pagefault while its writeback?
Nakamura Kazutaka <[email protected]>
| Newsgroups | gmane.comp.micro-kernel.l4.l4ka.general |
|---|---|
| Message-ID | <86fxvn4rpn.wl%[email protected]> |
Hello
I'm writing pager for L4 on ia32.
To capture pagefault message,I had used L4_Wait.
But my pager could not capture pagefault ThreadID.
L4 kernel debugger's output and Sigma0 verbose message(attached file)
say an pagefault occurred while IPC partner writeback phase in
L4_Ipc(l4ka-pistachio/user/include/l4/ia32/syscall.h).
In source code, it is
L4_INLINE L4_MsgTag_t L4_Ipc (L4_ThreadId_t to,
L4_ThreadId_t FromSpecifier,
L4_Word_t Timeouts,
L4_ThreadId_t * from)
{
...<ommit>...
if (! L4_IsNilThread (FromSpecifier)) {
*from = result; // << THIS line
utcb[1] = mr1;
utcb[2] = mr2;
}
return mr0;
}
I think this pagefault as a cause of IPC partner ThreadID lost.
Is this Idea correct?
I concern about another cause.
This pager's pagee in same space with roottask, call
L4_ThreadControle that is privileged system call, and this error
occurs when calling this.
In other hand, when pagee touch their data, this error does not occur.
Can not L4 treat No Privilege Error correctly?
Thanks
--
Nakamura Kazutaka
trace.txt
(text/plain, 3.8 KB)
RootServer: Waiting IPC...
tcb ROOTTASK cpu 0: SYS_IPC: ROOTTASK->NIL_THRD (<-ANY_THRD), to: 0, t: 0 (l=0x0, u=0, t=0)
tcb ROOTTASK cpu 0: ipc send finished curr=ROOTTASK to=NIL_THRD from_tid ffffffff
tcb ROOTTASK cpu 0: ipc receive phase curr=ROOTTASK, from=ANY_THRD
tcb ROOTTASK cpu 0: ipc blocking receive (curr=ROOTTASK, from=ANY_THRD)
inthndlr: MySelf: ThreadID: Global: ec001, ThreadNo: 59, Version: 1, Local: bf000300
tcb 000ec001 cpu 0: SYS_THREAD_CONTROL: dest=IRQ_1, space=IRQ_1, scheduler=NIL_THRD, pager=000ec001, utcb=ffffffff
tcb 000ec001 cpu 0: SYS_THREAD_CONTROL for IRQ1 (IRQ=IRQ_1, handler=000ec001)
tcb 000ec001 cpu 0: kernel pagefault in space f0150000 @ e0000800, ip=f01154a1, type=0
tcb 000ec001 cpu 0: kernel pagefault in space f0150000 @ e0000800, ip=f01154a1, type=2
tcb 000ec001 cpu 0: kmem_alloc (4096 [4K]), ip: f0116be9
tcb 000ec001 cpu 0: kmem_alloc (1024 [1K]), ip: f0115654
tcb 000ec001 cpu 0: user read pagefault at 1608f0, ip=001608f0
kernel access raised user pagefault @ 001608f0, ip=001608f0, space=f0150000
--- "KD# kpf" ---
--------------------------------- (eip=f0113d0f, esp=f012a274) ---
> go
tcb 000ec001 cpu 0: save_state sp NIL_THRD ss ABORTED
tcb 000ec001 cpu 0: SYS_IPC: 000ec001->ROOTTASK (<-ROOTTASK), to: 0, t: ffe50002 (l=0xffe5, u=2, t=0)
tcb 000ec001 cpu 0: ipc send phase curr=000ec001, to=ROOTTASK
tcb 000ec001 cpu 0: IPC transfer message: src=000ec001, dst=ROOTTASK
tcb 000ec001 cpu 0: ipc send finished curr=000ec001 to=ROOTTASK from_tid e8001
tcb 000ec001 cpu 0: ipc receive phase curr=000ec001, from=ROOTTASK
tcb 000ec001 cpu 0: ipc closed wait from ROOTTASK, current=000ec001
tcb 000ec001 cpu 0: ipc blocking receive (curr=000ec001, from=ROOTTASK)
tcb ROOTTASK cpu 0: ipc ROOTTASK received msg from 000ec001 (virtual 00306c20)
tcb ROOTTASK cpu 0: user write pagefault at 54202a05, ip=003004d7
tcb ROOTTASK cpu 0: save_state sp NIL_THRD ss ABORTED
tcb ROOTTASK cpu 0: SYS_IPC: ROOTTASK->SIGMA0 (<-SIGMA0), to: 0, t: ffe20002 (l=0xffe2, u=2, t=0)
tcb ROOTTASK cpu 0: ipc send phase curr=ROOTTASK, to=SIGMA0
tcb ROOTTASK cpu 0: IPC transfer message: src=ROOTTASK, dst=SIGMA0
tcb ROOTTASK cpu 0: ipc send finished curr=ROOTTASK to=SIGMA0 from_tid e0001
tcb ROOTTASK cpu 0: ipc receive phase curr=ROOTTASK, from=SIGMA0
tcb ROOTTASK cpu 0: ipc closed wait from SIGMA0, current=ROOTTASK
tcb ROOTTASK cpu 0: ipc blocking receive (curr=ROOTTASK, from=SIGMA0)
tcb SIGMA0 cpu 0: ipc SIGMA0 received msg from ROOTTASK (virtual 00027cc0)
s0: got msg from 0x000e8001, (0xffe2, 0x54202a05, 0x003004d7)
s0: allocate_page (tid: 0xe8001, addr: 54202a05, log2size: 12)
tcb SIGMA0 cpu 0: SYS_IPC: SIGMA0->ROOTTASK (<-ANY_THRD), to: 4000000, t: 80 (l=0x0, u=0, t=2)
tcb SIGMA0 cpu 0: ipc send phase curr=SIGMA0, to=ROOTTASK
tcb SIGMA0 cpu 0: IPC transfer message: src=SIGMA0, dst=ROOTTASK
tcb SIGMA0 cpu 0: tag=00000080, untyped: 0, typed: 2, acceptor: 10
tcb SIGMA0 cpu 0: map item: snd_base=54202000, fpage=542020c7
tcb SIGMA0 cpu 0: map_fpage (f_spc=f0148000 f_fp=542020c7 t_spc=f0150000 t_fp=00000010)
tcb SIGMA0 cpu 0: kmem_alloc (8192 [8K]), ip: f0100d60
tcb SIGMA0 cpu 0: mdb_map (from {sigma0 pg=f0149540 addr=54202000 4KB} to {spc=f0150000 pg=f7402808 addr=54202000 4KB}) paddr=54202000
tcb SIGMA0 cpu 0: kmem_alloc (4096 [4K]), ip: f0103485
tcb SIGMA0 cpu 0: ipc send finished curr=SIGMA0 to=ROOTTASK from_tid ffffffff
tcb SIGMA0 cpu 0: ipc receive phase curr=SIGMA0, from=ANY_THRD
tcb SIGMA0 cpu 0: ipc blocking receive (curr=SIGMA0, from=ANY_THRD)
tcb ROOTTASK cpu 0: ipc ROOTTASK received msg from SIGMA0 (virtual NIL_THRD)
tcb ROOTTASK cpu 0: restore_state saved_partner NIL_THRD saved_state RUNNING
RootServer: Ipc from nilthread
RootServer: &fromTID: 0x54202a05, tcb ROOTTASK cpu 0: timeslice expired for ROOTTASK
&mt0: 0x54202a01
--- "RootServer: stop" ---
--------------------------------- (eip=003008f0, esp=00306d90) ---
>