arm: cortex_r: config_userspace: nested interrupt level is not decremented following syscall


Phil Erwin Jr
 

In v2.3 when building with CONFIG_USERSPACE enabled, I see that we do not do a context switch a short time after POR.  I've chased this back and found the the cpus[0].nested has incremented to 6, so the code in z_arm_int_exit() thinks we are in a nested interrupt, and does not switch to another task.

The flaw is because of our syscall path.  On each syscall, we increment the nested count upon entry to the SVC (z_arm_svc in swap_helper.S), but then we go through z_arm_do_syscall (userspace.S) and return from the syscall without ever decrementing nested. 

The Cortex M code appears to work the same way to me.

It seems to me that the system call should exit by means of branching to z_arm_exc_exit, as is done elsewhere.

Comments?

Phil

Join devel@lists.zephyrproject.org to automatically receive all group messages.