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