diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2013-04-17 16:53:18 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-04-18 10:34:59 -0500 |
commit | 01b01010e8076b9fa048a370f85c696d8a25ed9f (patch) | |
tree | 6e85035c5344802ed0d5d68b4be39d782154cfc7 /src/include/kernel/intmsghandler.H | |
parent | bb42935e42d82c247d81ea03c4242ceccc41b487 (diff) | |
download | talos-hostboot-01b01010e8076b9fa048a370f85c696d8a25ed9f.tar.gz talos-hostboot-01b01010e8076b9fa048a370f85c696d8a25ed9f.zip |
Add thread-safety to kernel interrupt handler.
The interrupt handling was originally written with the intent
that only a single thread would receive interrupts. We
purposefully program the Interrupt Presenter hardware to
route all interrupts to a single core.
IPIs (Inter-processor Interrupts) are not routable by the ICP
and end up being delivered to the targeted thread. When we
trigger a winkle-wakeup of a thread, that thread gets the IPI
interrupt. Since we broadcast the IPI to all threads on a core
there is potential for multiple threads to be using the interrupt
object at once. Hence, we added a spinlock to protect it.
Change-Id: I736de774496b13cc9f344d389b9f249bbabeb036
Tested-by: Jenkins Server
Reviewed-by: Dean Sanner <dsanner@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/kernel/intmsghandler.H')
-rw-r--r-- | src/include/kernel/intmsghandler.H | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/include/kernel/intmsghandler.H b/src/include/kernel/intmsghandler.H index 88e1c2c1e..168b99d4a 100644 --- a/src/include/kernel/intmsghandler.H +++ b/src/include/kernel/intmsghandler.H @@ -68,15 +68,11 @@ class InterruptMsgHdlr : public MessageHandler MFRR_ADDR_OFFSET = 12, }; - // Notes: - // All external interrupts are routed to one cpu core - // External Interrupts are only processed one at a time - // So we don't need a spinlock /** * Constructor */ InterruptMsgHdlr(MessageQueue * i_msgQ) - : MessageHandler(NULL,i_msgQ) {} + : MessageHandler(&iv_lock,i_msgQ), iv_lock() {} /** * Destructor. @@ -150,6 +146,8 @@ class InterruptMsgHdlr : public MessageHandler static InterruptMsgHdlr * cv_instance; static uint64_t cv_ipc_base_address; + + Spinlock iv_lock; }; |