Hi Adrian,

I confirmed that seL4 mode is 'Load the seL4 kernel in hypervisor mode (NS))' and 'Install hooks in monitor mode' is set.

The call stack was main()->platform_init()->switch_to_hyp_mode(). The process terminated right after that last statement 'printf("Load seL4 in nonsecure HYP mode %x", scr);' in switch_to_hyp_mode().
It didn't get back to platform_init() (I inserted printf right after the callsite of switch_to_hyp_mode() in platform_init()). The last output was:

Load seL4 in nonsecure HYP mode 600001da

Yao

On Sun, Feb 26, 2017 at 6:36 PM, <Adrian.Danis@data61.csiro.au> wrote:
Hi Yao,

Can you confirm in the build configuration that 'seL4 mode' is set to 'Load the seL4 kernel in hypervisor mode (NS))' and 'Install hooks in monitor mode' in set? These should be set by the provided defconfigs. Also you can elaborate on what 'died here' means? Is there anything else output over the serial console? If its faulting or losing control of its execution what is the last instruction you know it has executed?

Adrian


On Mon 27-Feb-2017 12:54 PM, SHI, Yao wrote:
I am trying to boot CAmkES-ARM-VM and got problem in elfloader. I tested Jetson-TK1 and TK1-SOM. The results are same. I've set bootm_boot_mode=nonsec in u-boot and tracked registers in function switch_to_hyp_mode().

1) Enter switch_to_hyp_mode(), after
asm volatile ("mrc p15, 0, %0, c1, c1, 0":"=r"(scr));
==>
scr == 0x100, in which NS==0, HCE==1, SCD==0, SIF==0

2) Then switch_to_hyp_mode() changes NS to 1, so scr==0x101
asm volatile ("mcr p15, 0, %0, c1, c1, 0"::"r"(scr));

3) switch_to_hyp_mode() changes cpsr to Hyp mode

asm volatile ("cps %0\n\t"
"isb\n"
::"I"(HYPERVISOR_MODE));

4) The final step, switch_to_hyp_mode() reads cpsr,
asm volatile ("mrs %0, cpsr":"=r"(scr));
==>
scr == 0x6000001da, in which cpsr.M==0x1a, cpsr.I==1, cpsr.F==1, cpsr.A==1

Finally, the process died here.

My questions are,
1) Are NS==0 and HCE==1 correct when entering switch_to_hyp_mode() ?
2) Is the final status (cpsr.F==cpsr.I==cpsr.A==1) expected?
3) Any other mistake I might make?


Yao


_______________________________________________
Devel mailing list
Devel@sel4.systems
https://sel4.systems/lists/listinfo/devel