SMC in tz_vmm
Mahdi Aichouch
foxmehdi at ...9...
Fri Jan 23 10:36:11 CET 2015
Hello,
In my simple arm kernel I added a simple test case of the SMC instruction
to test
the switch from normal to secure world.
https://github.com/macdi/simple-arm-kernel/blob/master/kernel.c
This is what I think regarding regarding the execution flow when an SMC is
executed in the normal world:
When the processor in the normal world encounters the SMC instruction it
generates
an exception, this exception is caught in the exception function void
exception(unsigned const cpu)
defined in core/include/kernel/vm.h and execute the default switch case as
follow
void exception(unsigned const cpu) {
...
default:
PDBG("SMC instruction caught");
Cpu_job::_deactivate_own_share();
_context->submit(1);
}
As we can see this function interrupts the execution of the VM
then sends a message (I think to) to the VMM server in order to handle
the call to secure world.
This is the debug messages that I get when executing a simple test case.
int main(): --- start init ---
int main(): transferred 505 MB to init
int main(): --- init created, waiting for exit condition ---
[init] Could not open file "ld.lib.so"
[init] parent provides
[init] service "ROM"
[init] service "RAM"
[init] service "IRQ"
[init] service "IO_MEM"
[init] service "CAP"
[init] service "PD"
[init] service "RM"
[init] service "CPU"
[init] service "LOG"
[init] service "SIGNAL"
[init] service "VM"
[init] child "tz_vmm"
[init] RAM quota: 3932160
[init] ELF binary: tz_vmm
[init] priority: 0
[init -> tz_vmm] Start virtual machine
virtual void Kernel::Vm::exception(unsigned int): SMC instruction caught
[init -> tz_vmm] Hi from Normal Word!
Unfortunately, I was unable to follow the exact and complete execution flow
and the function calls
step by step while debugging the source code using my JTAG debugger.
I get this warning message when I tried to put a breakpoint in the source
code.
Starting target with image
/home/aichouch/DS-5-Workspace-examples/genode-14.11/build_hw_imx6_tz/var/run/tz_vmm/image.elf
Running from entry point
Execution stopped at: S:0x10001000
In image.elf (no debug info)
Breakpoint 2 unsilenced
break -p
"/home/aichouch/DS-5-Workspace-examples/genode-14.11/repos/base-hw/src/core/include/kernel/vm.h":90
WARNING(CMD452-COR167):
! Breakpoint 3 has been pended
! No compilation unit matching
"/home/aichouch/DS-5-Workspace-examples/genode-14.11/repos/base-hw/src/core/include/kernel/vm.h"
was found
Does anyone have an idea of how could I activate these debug information ?
Thank you very much in advance.
best regards,
Mahdi
On Fri, Jan 23, 2015 at 6:11 AM, chirag garg <chiragdthinker at ...9...>
wrote:
> Hi all,
>
> I have some doubts in Genode Flow, ARM provides the smc instruction to
> enter in the monitor-mode which performs the world switch between normal
> world and secure world.
>
> As tz_vmm script is also successfully achieving the above objective of
> world switch from the secure world to the normal world. But i am not able
> to figure out flow which will which execute a call of smc instruction in
> the run of tz_vmm script.
>
> Can anyone explain me the flow ?
>
> Thanks in advance.
>
> Regards
> Chirag Garg
> IIT Madras , Rise Lab
>
>
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> genode-main mailing list
> genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genode.org/pipermail/users/attachments/20150123/0e9b5114/attachment.html>
More information about the users
mailing list