/* * An exception was just taken from userspace. Since interrupts are disabled * here, no scheduling should have messed with the registers yet and they * will be whatever is live in userspace. So read the SSP before enabling * interrupts so locking the fpregs to do it later is not required.
*/
rdmsrq(MSR_IA32_PL3_SSP, ssp);
/* * By definition, all missing-ENDBRANCH #CPs are a result of WFE && !ENDBR. * * For the kernel IBT no ENDBR selftest where #CPs are deliberately triggered, * the WFE state of the interrupted context needs to be cleared to let execution * continue. Otherwise when the CPU resumes from the instruction that just * caused the previous #CP, another missing-ENDBRANCH #CP is raised and the CPU * enters a dead loop. * * This is not a problem with IDT because it doesn't preserve WFE and IRET doesn't * set WFE. But FRED provides space on the entry stack (in an expanded CS area) * to save and restore the WFE state, thus the WFE state is no longer clobbered, * so software must clear it.
*/ staticvoid ibt_clear_fred_wfe(struct pt_regs *regs)
{ /* * No need to do any FRED checks. * * For IDT event delivery, the high-order 48 bits of CS are pushed * as 0s into the stack, and later IRET ignores these bits. * * For FRED, a test to check if fred_cs.wfe is set would be dropped * by compilers.
*/
regs->fred_cs.wfe = 0;
}
staticint __init ibt_setup(char *str)
{ if (!strcmp(str, "off"))
setup_clear_cpu_cap(X86_FEATURE_IBT);
if (!strcmp(str, "warn"))
ibt_fatal = false;
return1;
}
__setup("ibt=", ibt_setup);
DEFINE_IDTENTRY_ERRORCODE(exc_control_protection)
{ if (user_mode(regs)) { if (cpu_feature_enabled(X86_FEATURE_USER_SHSTK))
do_user_cp_fault(regs, error_code); else
do_unexpected_cp(regs, error_code);
} else { if (cpu_feature_enabled(X86_FEATURE_IBT))
do_kernel_cp_fault(regs, error_code); else
do_unexpected_cp(regs, error_code);
}
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.13Bemerkung:
(vorverarbeitet am 2026-06-06)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.