Skip to content

Commit

Permalink
Find cpu struct directly in doorbell interrupt handler
Browse files Browse the repository at this point in the history
This fix accesses the cpu struct based on current thread
PIR instead of relying on an indirect pointer in the
current task struct.  It is attempting to eliminate a
weak consistency/timing issue on the thread wakeups on
the secondary cores.

Given the way hostboot wakes up from the doorbell, there
is a good chunck of code executed prior to the doorbell
interrupt handler --> this also adds a msgsync instruction
in the sreset (0x100) interrupt handler.

Change-Id: I23db1d786a8a8f0637a890e2ac5de6197ee9cabb
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71582
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
sannerd authored and dcrowell77 committed Feb 12, 2019
1 parent a733a70 commit 502ca3e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/kernel/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2010,2018
# Contributors Listed Below - COPYRIGHT 2010,2019
# [+] International Business Machines Corp.
# [+] Joel Stanley
#
Expand Down Expand Up @@ -765,6 +765,10 @@ intvect_system_reset:
;// Raise priority to high.
or 2,2,2

;// Need to send a msgysnc to prevent weak consistency issues
;// with doorbells (they execute this path prior to dbell intr)
.long 0x7C0006EC

;// Free up two registers temporarily.
mtsprg0 r1
mtsprg1 r2
Expand Down
7 changes: 4 additions & 3 deletions src/kernel/syscall.C
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,20 @@ void kernel_execute_hyp_doorbell()
doorbell_clear();

//Execute all work items on doorbell_actions stack
KernelWorkItem *l_work = t->cpu->doorbell_actions.pop();
cpu_t* l_cpu = CpuManager::getCurrentCPU();
KernelWorkItem *l_work = l_cpu->doorbell_actions.pop();
while(l_work != nullptr)
{
//Execute Work Item and then delete it
(*l_work)();
delete l_work;
l_work = t->cpu->doorbell_actions.pop();
l_work = l_cpu->doorbell_actions.pop();
}

//IPC messages come in only on the master, so
//If this is a doorbell to the master -- check
cpu_t* master = CpuManager::getMasterCPU();
if(t->cpu == master)
if(l_cpu == master)
{
size_t pir = getPIR();
printk("IPC msg pir %lx incoming\n", pir);
Expand Down

0 comments on commit 502ca3e

Please sign in to comment.