# Linux Kernel Module Cheat

###### 33.10.3.1.4. gem5 ARM WFE

gem5 390a74f59934b85d91489f8a563450d8321b602d does not sleep on the first WFE on either syscall emulation or full system, because the code does:

    Fault WfeInst::execute(
        ExecContext *xc, Trace::InstRecord *traceData) const
    {
    [...]
        if (SevMailbox == 1) {
            SevMailbox = 0;
            PseudoInst::quiesceSkip(tc);
        } else if (tc->getCpuPtr()->getInterruptController(
                    tc->threadId())->checkInterrupts(tc)) {
            PseudoInst::quiesceSkip(tc);
        } else {
            fault = trapWFx(tc, cpsr, scr, true);
            if (fault == NoFault) {
                PseudoInst::quiesce(tc);
            } else {
                PseudoInst::quiesceSkip(tc);
            }
        }

where "quiesce" means "sleep" for laymen like Ciro, and `quiesceSkip` means don’t sleep.

`SevMailbox` is read from `MISCREG_SEV_MAILBOX` which is initialized to `1` at:

    ISA::clear()
    {
    [...]
        miscRegs[MISCREG_SEV_MAILBOX] = 1;