[SMP/Debug] New syscall to send arbitrary SGIs

Created a new syscall, seL4_DebugSendIPI for ARM to send arbitrary SGIs
(software generated interrupts) to arbitrary cores. As SGIs are
specifically PPIs (private interrupts), this syscall effectively allows
to trigger PPIs on arbitrary cores, for debug/testing purposes.
This commit is contained in:
Sylvain Gauthier 2019-06-26 15:27:11 +10:00
parent 9b1877de21
commit 49d3f2202d
5 changed files with 43 additions and 0 deletions

View file

@ -41,6 +41,7 @@ Upcoming release: BREAKING
* Non-hyp support added for Arm GICv3 interrupt controller.
* Add initial i.MX8M Quad evk 64-bit Support. Currently only AArch64 EL1 non-secure is supported.
* Add FVP platform with fixed configuration. This currently assumes A57 configuration described in tools/dts/fvp.dts.
* Add new seL4_DebugSendIPI syscall to send arbitrary SGIs on ARM when SMP and DEBUG_BUILD are activated.
## Upgrade Notes
---

View file

@ -360,6 +360,13 @@ LIBSEL4_INLINE_FUNC void seL4_DebugNameThread(seL4_CPtr tcb, const char *name)
arm_sys_send_recv(seL4_SysDebugNameThread, tcb, &unused0, 0, &unused1, &unused2, &unused3, &unused4, &unused5);
}
#if CONFIG_MAX_NUM_NODES > 1
LIBSEL4_INLINE_FUNC void seL4_DebugSendIPI(seL4_Uint8 target, unsigned irq)
{
arm_sys_send(seL4_SysDebugSendIPI, target, irq, 0, 0, 0, 0);
}
#endif
#endif
#ifdef CONFIG_DANGEROUS_CODE_INJECTION

View file

@ -37,6 +37,9 @@
<syscall name="DebugSnapshot" />
<syscall name="DebugNameThread"/>
</config>
<config condition="defined CONFIG_DEBUG_BUILD &amp;&amp; CONFIG_MAX_NUM_NODES > 1">
<syscall name="DebugSendIPI"/>
</config>
<config condition="defined CONFIG_DANGEROUS_CODE_INJECTION">
<syscall name="DebugRun"/>
</config>

View file

@ -336,6 +336,20 @@ seL4_DebugCapIdentify(seL4_CPtr cap);
*/
LIBSEL4_INLINE_FUNC void
seL4_DebugNameThread(seL4_CPtr tcb, const char *name);
#if CONFIG_MAX_NUM_NODES > 1 && defined CONFIG_ARCH_ARM
/**
* @xmlonly <manual name="Send SGI 0-15" label="sel4_debugsendipi"/> @endxmlonly
* @brief Sends arbitrary SGI.
*
* Send an arbitrary SGI (core-specific interrupt 0-15) to the specified target core.
*
* @param target The target core ID.
* @param irq The SGI number (0-15).
*
*/
LIBSEL4_INLINE_FUNC void
seL4_DebugSendIPI(seL4_Uint8 target, unsigned irq);
#endif
#endif
#ifdef CONFIG_DANGEROUS_CODE_INJECTION

View file

@ -119,6 +119,24 @@ exception_t handleUnknownSyscall(word_t w)
setThreadName(TCB_PTR(cap_thread_cap_get_capTCBPtr(lu_ret.cap)), name);
return EXCEPTION_NONE;
}
#if defined ENABLE_SMP_SUPPORT && defined CONFIG_ARCH_ARM
if (w == SysDebugSendIPI) {
seL4_Word target = getRegister(NODE_STATE(ksCurThread), capRegister);
irq_t irq = getRegister(NODE_STATE(ksCurThread), msgInfoRegister);
if (target > CONFIG_MAX_NUM_NODES) {
userError("SysDebugSendIPI: Invalid target, halting");
halt();
}
if (irq > 15) {
userError("SysDebugSendIPI: Invalid IRQ, not a SGI, halting");
halt();
}
ipi_send_target(irq, BIT(target));
return EXCEPTION_NONE;
}
#endif /* ENABLE_SMP_SUPPORT && CONFIG_ARCH_ARM */
#endif /* CONFIG_DEBUG_BUILD */
#ifdef CONFIG_DANGEROUS_CODE_INJECTION