From cb444552aebafa54ceb0417c12d61cd48fbc65e0 Mon Sep 17 00:00:00 2001 From: Bill Hoffa Date: Tue, 9 Jan 2018 08:16:44 -0600 Subject: Multi-Drawer (IPC) Interrupt/Messaging Support - Use doorbells instead of IPIs (no IPI support using LSI interupts in the XIVE intr architecture) - New message type from kernel to userspace so the kernel can notify the HB userspace Interrupt Resource Provider (INTRP) that an IPC message was sent to the particular HB instance (in P8 this happened automatically as that was part of the IPI architecture). - Re-enable testcase that validates that an IPC message can be successfully sent. Change-Id: Ic846f8dca45217205ed61d8381a573e995cb16f2 RTC: 150861 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/52004 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Christian R. Geddes Tested-by: FSP CI Jenkins Reviewed-by: Prachi Gupta Reviewed-by: Daniel M. Crowell --- src/include/kernel/doorbell.H | 10 +++++----- src/include/kernel/intmsghandler.H | 16 ++++++++++++++-- src/include/kernel/workitem.H | 7 ++++--- 3 files changed, 23 insertions(+), 10 deletions(-) (limited to 'src/include/kernel') diff --git a/src/include/kernel/doorbell.H b/src/include/kernel/doorbell.H index 8275c4fc7..1d01ce119 100644 --- a/src/include/kernel/doorbell.H +++ b/src/include/kernel/doorbell.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -50,11 +50,11 @@ void doorbell_send(uint64_t i_pir); */ void send_doorbell_wakeup(uint64_t i_pir); -/* TODO RTC 150861 - * send_doorbell_ipc +/** Send an IPC message using a doorbell * - * void send_doorbell_ipc(cpu_t *i_cpu, uint64_t pir); -**/ + * @param i_pir - PIR to send IPC message to + */ +void send_doorbell_ipc(uint64_t i_pir); enum { diff --git a/src/include/kernel/intmsghandler.H b/src/include/kernel/intmsghandler.H index 8f7c08559..9e5a001ed 100644 --- a/src/include/kernel/intmsghandler.H +++ b/src/include/kernel/intmsghandler.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2016 */ +/* Contributors Listed Below - COPYRIGHT 2011,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -73,8 +73,11 @@ class InterruptMsgHdlr : public MessageHandler ACK_HYPERVISOR_INT_REG_OFFSET = 0x830, INTP_BAR_VALUE = 0xFFFFE000, // upper 32 bits of IPCBAR - INTERPROC_XISR = 2, //IPI XISR is 2 + + MSG_KEY_THREAD_WKUP = 0x8000000000000000ul, + MSG_KEY_ADD_CPU_CORE = 0x4000000000000000ul, + MSG_KEY_IPC_MSG = 0x2000000000000000ul, }; /** @@ -155,6 +158,15 @@ class InterruptMsgHdlr : public MessageHandler */ static void sendThreadWakeupMsg(uint64_t i_pir); + /** + * Send message to interrupt resource provider (intrrP) in userspace to + * indicate it was sent an IPC message. The intrrp will re-route the + * message to the appropriate handler. + * + * @param[in] i_pir - The PIR of the CPU to send doorbell to. + */ + static void sendIpcMsg(uint64_t i_pir); + /** * Issue the sbe/mailbox workaround (issue a mbox EOI to mailbox) * diff --git a/src/include/kernel/workitem.H b/src/include/kernel/workitem.H index 3a41cc526..6d2f4b6b1 100644 --- a/src/include/kernel/workitem.H +++ b/src/include/kernel/workitem.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -54,7 +54,6 @@ class CpuWakeupDoorbellWorkItem : public KernelWorkItem }; -/* TODO RTC 150861 //A work item to be created/executed during an IPC scenario class IPCDoorbellWorkItem : public KernelWorkItem @@ -62,7 +61,9 @@ class IPCDoorbellWorkItem : public KernelWorkItem public: //Implement operator() function void operator() (void); + + //No data to clean up, use default destructor + ~IPCDoorbellWorkItem() = default; }; -**/ #endif -- cgit v1.2.1