diff options
author | Dean Sanner <dsanner@us.ibm.com> | 2017-12-05 15:10:45 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-09-24 12:17:16 -0500 |
commit | fcfd722a6abb01f780c10de0f5d801a9c4210ebd (patch) | |
tree | 49cfafdc273b1aa7989d851d7c17fbb74dd54b0b /src/kernel/syscall.C | |
parent | 69cc45d8f059a113f6bad12e1fdd82123497893a (diff) | |
download | talos-hostboot-fcfd722a6abb01f780c10de0f5d801a9c4210ebd.tar.gz talos-hostboot-fcfd722a6abb01f780c10de0f5d801a9c4210ebd.zip |
Support HB running in SMF
Support SMF for P9N/P9C. Lots of minor tweaks to make this
work, but the biggest is to run userspace in problem state
This is needed because for SMF Hostboot will need to run in S=1,
HV=0,PR=1 (and kernel in S=1, HV=1, PR=0)
This commit makes P9 HB userpsace run in HV=0 PR=1 and kernel in
HV=1, PR=0.
Change-Id: Ia4771df5e8858c6b7ae54b0746e62b283afb4bc4
RTC: 197243
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/50530
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Dean Sanner <dsanner@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/kernel/syscall.C')
-rw-r--r-- | src/kernel/syscall.C | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/kernel/syscall.C b/src/kernel/syscall.C index 13f6288fd..8b7f02243 100644 --- a/src/kernel/syscall.C +++ b/src/kernel/syscall.C @@ -50,14 +50,15 @@ extern "C" -void kernel_execute_hype_doorbell() +void kernel_execute_hyp_doorbell() { task_t* t = TaskManager::getCurrentTask(); + task_t* l_task_post = nullptr; doorbell_clear(); //Execute all work items on doorbell_actions stack KernelWorkItem *l_work = t->cpu->doorbell_actions.pop(); - while(l_work != NULL) + while(l_work != nullptr) { //Execute Work Item and then delete it (*l_work)(); @@ -77,13 +78,18 @@ void kernel_execute_hype_doorbell() InterruptMsgHdlr::sendIpcMsg(pir); } - if (t->cpu->idle_task == t) - { - t->cpu->scheduler->returnRunnable(); - t->cpu->scheduler->setNextRunnable(); - } - DeferredQueue::execute(); + + // Mustn't switch tasks if external interrupt due to + // the fact external interrupts come in as HYP exceptions + // and all other come in as regular excpetions. If HYP + // comes on top of regular... need to leave existing task + // as is. The custom implementation of sendMessage of InterruptMsgHdlr + // will take care of task switching safely. + + //check to see if work switched the task + l_task_post = TaskManager::getCurrentTask(); + kassert(t == l_task_post); } extern "C" @@ -738,15 +744,18 @@ namespace Systemcalls void CpuSprValue(task_t *t) { uint64_t spr = TASK_GETARG0(t); + uint64_t l_smf_bit = 0x0; switch (spr) { case CPU_SPR_MSR: - TASK_SETRTN(t, CpuManager::WAKEUP_MSR_VALUE); + //Set SMF bit based on current setting (HB never turns off) + l_smf_bit = getMSR() & MSR_SMF_MASK; + TASK_SETRTN(t, WAKEUP_MSR_VALUE | l_smf_bit); break; case CPU_SPR_LPCR: - TASK_SETRTN(t, CpuManager::WAKEUP_LPCR_VALUE); + TASK_SETRTN(t, WAKEUP_LPCR_VALUE); break; case CPU_SPR_HRMOR: @@ -805,9 +814,9 @@ namespace Systemcalls if (STOP_INSTRUCTION == (*instruction)) // Verify 'nap' instruction, // otherwise just return. { - // Disable EE, PR, IR, DR so 'nap' can be executed. + // Disable HV, EE, PR, IR, DR so 'nap' can be executed. // (which means to stay in HV state) - t->context.msr_mask = 0xC030; + t->context.msr_mask = 0x100000000000D030; } }; |