<div dir="ltr"><div><div><div><div>Hi Stefan,<br><br></div>Thanks a lot for your response.<br><br></div>I have another questions. I have tried to measure the time for the context switch between the worlds. I make an <i>SMC</i>
call in the normal world (Linux) and modified the VMM to return to the
normal world without doing any operation. I take time t1 before calling
the SMC instruction and time t2 after the secure world switches back to
the normal world. Then the difference (t2 - t1) is the time for the
context switch. i am getting around <i>0.05</i> milliseconds. Is that the right way to measure the time for the context switch? FYI, i use <i>getrusage( )</i> function in Linux to measure t1 and t2. <br><br>How do we measure time for a process in Genode. Is there a method to get time in Genode? Thanks again for you help and time.<br><br></div>Kind regards,<br></div>Joseph<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 5, 2016 at 10:01 AM, Stefan Kalkowski <span dir="ltr"><<a href="mailto:stefan.kalkowski@...1..." target="_blank">stefan.kalkowski@...1...</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Joseph,<br>
<br>
On 04/04/2016 07:17 PM, Joseph Lee wrote:<br>
> Hi,<br>
><br>
> I used "*dma_alloc_coherent( )"* as described in this thread (<br>
<span class="">> <a href="https://sourceforge.net/p/genode/mailman/message/34685275/" rel="noreferrer" target="_blank">https://sourceforge.net/p/genode/mailman/message/34685275/</a>) to allocate<br>
> shared memory between the trustzone worlds in the tz_vmm example on i.mx53<br>
> qsb. It works well. But my questions is how do we prevent the normal world<br>
> from modifying this shared buffer while it is being used by the secure<br>
> world. Thanks in advance for answers.<br>
<br>
</span>this might be an issue in multi-processor environments only, where more<br>
than one core is used by the non-secure world. In the uni-processor case<br>
(the only one we experimented with TrustZone yet: CortexA8) either the<br>
secure world is running, or the normal world. As long as you do not<br>
schedule the non-secure Linux it won't run, and this is in the hands of<br>
the VMM, which handles traps and calls from the VM, and also makes it<br>
runnable again.<br>
<br>
But even in the multi-processor case I would question whether this is a<br>
problem. In the normal case the guest OS should not touch the shared<br>
buffer after it send a request to the secure world. The VMM then copies<br>
the message out of the shared buffer and parses it. If the guest OS<br>
maliciously changes the shared buffer during the copy process that would<br>
result in a broken message. But the guest OS could place such a<br>
malicious message already in the first place. The parsing routine of the<br>
VMM must be robust against any kind of content it gets anyway, similar<br>
to all kind of input-data handlers from unsecure sources (e.g.: web<br>
formular interpreter ...).<br>
<br>
regards<br>
Stefan<br>
<br>
><br>
><br>
><br>
> Kind regards,<br>
> Joseph<br>
><br>
><br>
><br>
> ------------------------------------------------------------------------------<br>
><br>
><br>
><br>
> _______________________________________________<br>
> genode-main mailing list<br>
> <a href="mailto:genode-main@lists.sourceforge.net">genode-main@...49....sourceforge.net</a><br>
> <a href="https://lists.sourceforge.net/lists/listinfo/genode-main" rel="noreferrer" target="_blank">https://lists.sourceforge.net/lists/listinfo/genode-main</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Stefan Kalkowski<br>
Genode Labs<br>
<br>
<a href="http://www.genode-labs.com/" rel="noreferrer" target="_blank">http://www.genode-labs.com/</a> · <a href="http://genode.org/" rel="noreferrer" target="_blank">http://genode.org/</a><br>
<br>
------------------------------------------------------------------------------<br>
_______________________________________________<br>
genode-main mailing list<br>
<a href="mailto:genode-main@lists.sourceforge.net">genode-main@...12...ceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/genode-main" rel="noreferrer" target="_blank">https://lists.sourceforge.net/lists/listinfo/genode-main</a><br>
</font></span></blockquote></div><br></div>