<div>Hi Dhiraj,</div>
<div> </div>
<div>Yes, one could use L4 native calls, and non SAS based iguana services, like high resolution timers, or driver servers (I guess), </div>
<div> </div>
<div>Cheers,</div>
<div> </div>
<div>Jorge</div>
<div><br><br> </div>
<div class="gmail_quote">On Thu, Feb 28, 2008 at 9:58 PM, Kalamkar, Dhiraj D <<a href="mailto:dhiraj.d.kalamkar@intel.com">dhiraj.d.kalamkar@intel.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div lang="EN-US" vlink="blue" link="blue">
<div>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi Jorge,</span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I am not sure whether OKLinux userland process can access Iguana services directly even after the changes you suggested in OKLinux scheduler. As far as I understand Iguana server and other services are based on Iguana Single Address Space (SAS). i.e. Iguana server and other services work on assumption that they have same virtual to physical mappings for all the threads in Iguana PD (of course with different access rights). As OKLinux user processes are external address spaces (EAS) they can not access iguana services directly.</span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Of course, after enabling IPC for userland OKLinux process, you can do a raw IPC to any L4 thread and may write services which don't assume Iguana SAS.</span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Please correct me if my understanding is wrong.</span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Regards,</span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Dhiraj</span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </span></font></p>
<div>
<div style="TEXT-ALIGN: center" align="center"><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">
<hr align="center" width="100%" size="2">
</span></font></div>
<p><b><font face="Tahoma" size="2"><span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</span></font></b><font face="Tahoma" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> <a href="mailto:developer-bounces@okl4.org" target="_blank">developer-bounces@okl4.org</a> [mailto:<a href="mailto:developer-bounces@okl4.org" target="_blank">developer-bounces@okl4.org</a>] <b><span style="FONT-WEIGHT: bold">On Behalf Of </span></b>Jorge Torres<br>
<b><span style="FONT-WEIGHT: bold">Sent:</span></b> Thursday, February 28, 2008 10:35 PM<br><b><span style="FONT-WEIGHT: bold">To:</span></b> Nelson Tam; developer<br><b><span style="FONT-WEIGHT: bold">Subject:</span></b> Re: [okl4-developer] Direct IPC from OKLinux userland processes toOKL4 services</span></font></p>
</div>
<div>
<div></div>
<div class="Wj3C7c">
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt"> </span></font></p>
<p style="MARGIN-BOTTOM: 12pt"><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">Hi Nelson, Damien,<br><br>Invariants about OKLinux scheduler, can be fixed, if one modifies the scheduler to be aware of this, Nelson could your tell, where is that one enables the IPC permission?, I think this could be achieved by some means setting the useland linux thread as I0/Bound when waiting for IPC, therefore it wont be scheduled by Linux, for this one will have to set a mechanism, one I can think of surely not the best is, turning the thread into an "iguana operation state" and back, this is:<br>
<br>Before performing L4IPC, and any other L4-iguana operations, userland linux thread must create a waitqueue via DECLARE_WAITQUEUE(), and add itself to such queue via add_wait_queue(), then notify an iguana's server (about this later), once done so, it is able to perform l4 native operations, after done, it should notify server (back to userandlinux request), server wakes up the queue, and userland thread continues with OKlinux userland code.<br>
<br>What the registering iguana server should do is to: flip-flop OKLINUXuserland thread priority to higher or lower priority than Linux's mian and timer threads (which is how the systems guarantees that userland threads are always scheduled by the linux scheduler and not the L4 scheduler). For this one will have to modify the Linux set thread and eas creation routines so it sets the scheduler register to be the server just mentioned. this would be something like:<br>
<br>.<br>.<br>.<br>OKLINUXUserland code<br>.<br>.<br>ENTER_IGUANA_STATE<br>.<br>L4-Iguana Native code<br>.<br>.<br>LEAVE_IGUANA_STATE<br>.<br>.<br>OKLINUXUserland code <br><br><br>I think that would be one simple way of doing this,<br>
<br>Best regards,<br><br>Jorge<br><br><br><br><br></span></font></p>
<div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">On Thu, Feb 28, 2008 at 2:11 AM, Nelson Tam <<a href="mailto:nelson@ok-labs.com" target="_blank">nelson@ok-labs.com</a>> wrote:</span></font></p>
<div>
<p style="MARGIN-BOTTOM: 12pt"><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">Hi Damien,<br><br>On 26/02/2008, at 01:27, Damien Schulz wrote:</span></font></p></div>
<div>
<p style="MARGIN-BOTTOM: 12pt"><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">> is it possible to have IPC directly from OKLinux userland processes<br>> - no matter if it is a good idea or not? So far I've written a<br>
> procfs module that is able to communicate with OKL4, but I'd like to<br>> directly use the IDL interface in my user processes.<br>><br>> If I understand it correctly, every linux process is started as an<br>
> OKL4 process, so it should be possible anyway. Is there a way to<br>> simply allow IPC or would that require further changes in the<br>> OKLinux fork() implementation?</span></font></p></div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">I'm sorry about the confusion earlier. Let me clarify a few things.<br><br>What I said in the previous email about OKLinux threads being able to<br>
use OKL4 services holds true for OKLinux _kernel_ threads only. There<br>are 2 threads in this category - called "timer_thread" and<br>"main_thread". You can find them in kernel-2.6.10-v1/arch/l4/kernel -<br>
take a look in sys_iguana.c and main.c. These 2 threads have their<br>own L4 space.<br><br>On the other hand, OKLinux _user_ threads runs your Linux userland<br>processes in a different L4 space from the kernel threads. The<br>
important thing here is that, L4 implements IPC security mechanisms on<br>a per-L4-address-space basis. While the OKLinux kernel space is given<br>permission to IPC any thread in other spaces, the OKLinux user space<br>is not allowed to do so. Therefore, your OKLinux user processes won't<br>
be able to communicate with OKL4 services.<br><br>Now you might be asking why can't you just configure the IPC<br>permissions so that the OKLinux user space can IPC everyone. The<br>short answer is that, the OKLinux kernel relies on some invariants on<br>
when and how OKLinux user threads get scheduled. Once you allow<br>OKLinux user threads to IPC freely, these invariants get violated.<br><br>I hope this answers your question.<br><font color="#888888"><span style="COLOR: #888888"><br>
Nelson.</span></font></span></font></p>
<div>
<div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt"><br><br>_______________________________________________<br>Developer mailing list<br><a href="mailto:Developer@okl4.org" target="_blank">Developer@okl4.org</a><br>
<a href="https://lists.okl4.org/mailman/listinfo/developer" target="_blank">https://lists.okl4.org/mailman/listinfo/developer</a></span></font></p></div></div></div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt"> </span></font></p></div></div></div></div></blockquote></div><br>