summaryrefslogtreecommitdiffstats
path: root/src/kernel/start.S
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2011-07-15 12:03:19 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-07-18 12:04:40 -0500
commitbe301c4ea87c944bd1c51ca2c73ac719cec6b495 (patch)
tree529436aa13474e54badc7cd6690ae28f7eeda766 /src/kernel/start.S
parent62faccd737f97dd4c485770f59bacf1b44dcbc3b (diff)
downloadtalos-hostboot-be301c4ea87c944bd1c51ca2c73ac719cec6b495.tar.gz
talos-hostboot-be301c4ea87c944bd1c51ca2c73ac719cec6b495.zip
Add user-space stub for task entry.
This will prevent kernel space from needing to dereference user-space addresses for starting a task, which is safer and is easier for VMM. Change-Id: Icad3b832550cedbf291ed8b032840f4049fba18e Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/202 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: MATTHEW S. BARTH <msbarth@us.ibm.com>
Diffstat (limited to 'src/kernel/start.S')
-rw-r--r--src/kernel/start.S23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/kernel/start.S b/src/kernel/start.S
index ac57926b4..381e33bde 100644
--- a/src/kernel/start.S
+++ b/src/kernel/start.S
@@ -360,6 +360,29 @@ system_call_fast_path:
1:
rfid ;// Return from interrupt.
+
+ ;// @fn userspace_task_entry
+ ;// Stub to load the function address and TOC base from userspace and
+ ;// jump to task entry point. Used so the kernel doesn't need to
+ ;// dereference userspace addresses (which could be bad).
+ ;//
+ ;// Requires:
+ ;// * GPR4 -> Function pointer.
+ ;// * LR -> task_end stub.
+ ;// * GPR3 -> Task argument.
+ ;// * GPR1 -> Task stack pointer.
+ ;// Results:
+ ;// * TOC base -> GPR2
+ ;// * Function Address -> CTR
+ ;// * GPR1, GPR3 preserved.
+ ;// * Branch to CTR (no link).
+.global userspace_task_entry
+userspace_task_entry:
+ ld r5, 0(r4)
+ mtctr r5
+ ld r2, 8(r4)
+ bctr
+
.section .data
.balign 1024
kernel_stack:
OpenPOWER on IntegriCloud