seL4 / seL4

The seL4 microkernel

Home Page:https://sel4.systems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is this a bug for ctedelete() ?

hzoro opened this issue · comments

Kernel will return EXCEPTION_PREEMPTED when there's an interrupt waiting. Is it a design mistake that this time ctedelete() won't execute emptyslot() and won't return an error code to the user? If it isn't an design mistake, how do the user know if he should resend a cnode deletion request in this case?

exception_t cteDelete(cte_t *slot, bool_t exposed)
{
    finaliseSlot_ret_t fs_ret;

    fs_ret = finaliseSlot(slot, exposed);
    if (fs_ret.status != EXCEPTION_NONE) {
        return fs_ret.status;
    }

    if (exposed || fs_ret.success) {  // exposed = 1 in this situation
        emptySlot(slot, fs_ret.cleanupInfo);
    }
    return EXCEPTION_NONE;
}

Hi, #1074 might be useful.

For invocations, the ThreadState is by default set to Restart, i.e. the user pc would not be moved forward as it would if a successful invocation occurred (see activateThread() for ThreadState_Running). If the user invocation is preempted (EXCEPTION_PREEMPTED), the ThreadState does not change to Running and stays on Restart, and the syscall will be re-run again. You can see see this happen towards the end of handleInvocation().

Hi, @andybui01 , thank you for your answer, it's helpful.

I will close this issue.