summaryrefslogtreecommitdiffstats
path: root/src/kernel/cpumgr.C
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2012-09-13 17:26:13 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2012-09-21 14:27:08 -0500
commitf754a2a6f0079f3424e2368ae3c3635ac8440612 (patch)
treedb7821f2e34e36f40fae69277e0cefb93573adaf /src/kernel/cpumgr.C
parent337654733b5bb5ba1a33b41c0fecf78c36185b13 (diff)
downloadtalos-hostboot-f754a2a6f0079f3424e2368ae3c3635ac8440612.tar.gz
talos-hostboot-f754a2a6f0079f3424e2368ae3c3635ac8440612.zip
Fixes for winkle state.
The memory profiling tools sometimes encountered a condition where the kernel stack was becoming corrupted. I tracked it down to the winkle code storing the winkle-save state at the wrong end of the stack. Moving the winkle-save area to the bottom of the stack, which is where I originally intended it to go. Also noticed that the task issuing the winkle was in "running" state while waiting for the cores to come out of winkle. Ensure that the kernel updates the task state with a non-running status while we are waiting for winkle to complete. Change-Id: I07a56ea6f24cbc09362f9227d81915da5bc9f148 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1737 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/kernel/cpumgr.C')
-rw-r--r--src/kernel/cpumgr.C11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/kernel/cpumgr.C b/src/kernel/cpumgr.C
index 791d14703..db79a15bf 100644
--- a/src/kernel/cpumgr.C
+++ b/src/kernel/cpumgr.C
@@ -177,8 +177,15 @@ void CpuManager::startCPU(ssize_t i)
}
cpu->scheduler = &Singleton<Scheduler>::instance();
cpu->scheduler_extra = NULL;
- cpu->kernel_stack =
- (void*) (((uint64_t)PageManager::allocatePage(4)) + 16320);
+
+ const size_t kernel_page_count = 4;
+ const size_t kernel_page_offset = kernel_page_count * PAGESIZE -
+ 8 * sizeof(uint64_t);
+ cpu->kernel_stack_bottom = PageManager::allocatePage(kernel_page_count);
+ cpu->kernel_stack = reinterpret_cast<void*>(
+ reinterpret_cast<uintptr_t>(cpu->kernel_stack_bottom) +
+ kernel_page_offset);
+
cpu->xscom_mutex = (mutex_t)MUTEX_INITIALIZER;
// Create idle task.
OpenPOWER on IntegriCloud