set pager in foc
Stefan Kalkowski
stefan.kalkowski at ...1...
Mon Jun 20 16:10:12 CEST 2011
Hello Chian,
On 18.06.2011 01:38, Chen Tian - SISA wrote:
> Hello,
>
>
>
> After the set_pager function of a thread is called through a
> cpu_session, the _pager of that thread is set and used when the actual
> platform thread starts.
That's true at least for the implementation of the rm_session interface
in core with respect to Genode/Fiasco.OC.
> But there is only one thread (pager) to resolve
> all page faults for all threads.
This is almost true for the Fiasco.OC version of Genode. Like Norman
explained in a previous mail, other platforms don't necessarily have
only one pager. In the current implementation for Fiasco.OC this is true
for normal Genode applications. L4Linux for example pages its VCPUs, and
applications itself. A VCPU (some kind of special thread concept in
recent Fiasco.OC revisions) is constructed by Genode's core process, but
afterwards the capability slot containing the global pager capability
gets overmapped to contain a special pager thread, which is running in
the L4Linux-kernel protection-domain.
> I think the pager mapping happened in
> platform_thread::start (platform_thread.cc:40-47). Can somebody please
> explain to me the meaning of this l4_task_map call?
In Fiasco.OC a pager gets assigned to a thread by choosing a capability
slot in the capability space of the target protection domain, wherein
the new thread will run. The capability in that slot should point to the
pager thread. That why we first map the capability of the pager (which
was set by the cpu_session interface first) into the capability space of
the target protection domain. This is what the following snipet does:
l4_task_map(_platform_pd->native_task(), L4_BASE_TASK_CAP,
l4_obj_fpage(_pager->cap().dst(), 0, L4_FPAGE_RWX),
_remote_pager_cap | L4_ITEM_MAP);
After that, you instruct the kernel to use the capability slot, we just
filled with life, as pager and exception-handler:
l4_thread_control_start();
l4_thread_control_pager(_remote_pager_cap);
l4_thread_control_exc_handler(_remote_pager_cap);
l4_thread_control_bind(_utcb, _platform_pd->native_task());
> I suspect that
> “_remote_pager_cap” is corresponding to the global pager, but cannot
> find any evidence. Thanks a lot.
The '_remote_pager_cap' denotes the capability slot in the thread's
capability space, whereby '_pager' is the capability slot in core's
capability space, that gets mapped to '_remote_pager_cap' by
l4_task_map. The '_pager' variable is set via the cpu_session interface,
like you've stated before. Although, this is normally the "one global
pager", Genode's design and the Fiasco.OC specific implementation is not
limited to use only that one pager thread.
Best regards
Stefan
>
>
>
> Best,
>
> Chen
>
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
>
>
>
> _______________________________________________
> Genode-main mailing list
> Genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
--
Stefan Kalkowski
Genode Labs
http://www.genode-labs.com/ · http://genode.org/
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
More information about the users
mailing list