RE: Will L4_Ipc loses from ThreadID by occurring pagefault while its writeback?

"Jan Stoess" <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
Hello Nakamura Kazutaka,

> 
> 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.

> In source code, it is
> 
>     if (! L4_IsNilThread (FromSpecifier)) {
>         *from = result; // << THIS line
> 	utcb[1] = mr1;

> 
> I think this pagefault as a cause of IPC partner ThreadID lost.
> Is this Idea correct?

Your get a pagefault while the Ipc user code is trying to set the from
id after the IPC. This is probably because the *from pointer passed to
L4_Ipc() points to a memory region not currently mapped into the
receiving thread's address space -- e.g., because the pointer is
invalid, or just because the memory region hasn't been touched
beforehand. 

But that doesn't mean that the partner thread id is lost. If the
pagefault is served correctly, the assignment instruction will be
re-executed, and this time it should succeed. You could verify this by
setting breakpoints before and after the faulting instructions, i.e.  at
the events

1) tcb ROOTTASK cpu 0: user write pagefault at 54202a05, ip=003004d7
2) RootServer: Ipc from nilthread

You can then inspect the instruction and the register/memory contents of
the source operand (i.e., result). If I read your traces right, it
should be 0x000ec001 for you in both cases. If so, there's probably
something wrong with your user-level code. 

But I suspect that the errors you're running into are a result from a
kernel bug you've discovered accidentially (see below).

> 
> 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?

No. When looking at your trace file, I saw that while trying to
associate the irq handler, L4 actually raises a page fault in user
level; that's the reason why it jumps into the kernel debugger, after
all. Since you apparently have continued execution afterwards, the page
fault was erroneously propagated to the pager.

The kernel page fault stems from a bug in the IDT handling. I've just
fixed that and commited it. Please check out the latest revision and
re-run your code; let me know if your still run into errors.

-Jan



--
Jan Stoess
System Architecture Group
University of Karlsruhe
Phone: +49 (721) 608-4056
Fax: +49 (721) 608-7664
eMail: [email protected]

> --
> Nakamura Kazutaka
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.