/* * This function handles the case when an NMI is raised in the #VC * exception handler entry code, before the #VC handler has switched off * its IST stack. In this case, the IST entry for #VC must be adjusted, * so that any nested #VC exception will not overwrite the stack * contents of the interrupted #VC handler. * * The IST entry is adjusted unconditionally so that it can be also be * unconditionally adjusted back in __sev_es_ist_exit(). Otherwise a * nested sev_es_ist_exit() call may adjust back the IST entry too * early. * * The __sev_es_ist_enter() and __sev_es_ist_exit() functions always run * on the NMI IST stack, as they are only called from NMI handling code * right now.
*/ void noinstr __sev_es_ist_enter(struct pt_regs *regs)
{ unsignedlong old_ist, new_ist;
/* Read old IST entry */
new_ist = old_ist = __this_cpu_read(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC]);
/* * If NMI happened while on the #VC IST stack, set the new IST * value below regs->sp, so that the interrupted stack frame is * not overwritten by subsequent #VC exceptions.
*/ if (on_vc_stack(regs))
new_ist = regs->sp;
/* * Reserve additional 8 bytes and store old IST value so this * adjustment can be unrolled in __sev_es_ist_exit().
*/
new_ist -= sizeof(old_ist);
*(unsignedlong *)new_ist = old_ist;
/* Set new IST entry */
this_cpu_write(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC], new_ist);
}
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.