I am trying to locate all exit points when the kernel returns to user mode in ppc64 2.6.16 kernels for POWER5. Am I correct in assuming that system calls and returns from exceptions and interrupts are the only way for kernel to continue in user context. In files entry_64.S and head_64.S I found instructions "rfid" which returns from interrupts and system calls. Is there any other way for the kernel to return to user mode?
Pinned topic Exit points returning from kernel to user mode
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2008-11-05T04:52:10Z at 2008-11-05T04:52:10Z by SystemAdmin
SystemAdmin 110000D4XK706 Posts
Re: Exit points returning from kernel to user mode2008-11-05T04:52:10ZThis is the accepted answer. This is the accepted answer.Your assumption is correct. The only way that control is transferred from the kernel to a user process is via the rfid instruction. However, not all the rfid instructions in entry_64.S and head_64.S are there to transfer control to a user process; some of them transfer control from an exception prolog (also known as first-level interrupt handler) to the main body of the exception handler while turning on the MMU, or are used at boot time or when calling RTAS (Run Time Abstraction Services firmware).
Generally, rfid is used when turning address translation on or off for instruction accesses as well as for returning from a system call or interrupt to the previous context.