/* * 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;
}
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.