lkml.org 
[lkml]   [2022]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 6/7] KVM: VMX: Provide separate subroutines for invoking NMI vs. IRQ handlers
Date
> > > +	 * "Restore" RSP from RBP, even though IRET has already unwound
> > > RSP to
> > > + * the correct value. objtool doesn't know the callee will IRET and,
> > > + * without the explicit restore, thinks the stack is getting walloped.
> > > + * Using an unwind hint is problematic due to x86-64's dynamic
> > > alignment.
> > > + */
> > > + mov %_ASM_BP, %_ASM_SP
> > > + pop %_ASM_BP
> > > + RET
> >
> > For NMI, after this RET instruction, we continue to block NMIs. IRET
> instead?
>
> No, IRET has already been done by the kernel-provided handler, e.g.
> asm_exc_nmi_kvm_vmx()
> by way of error_return(). That's why the CALL above (that got snipped) is
> preceded
> by the creation of a synthetic NMI/IRQ stack frame: the target returns from
> the CALL
> via IRET, not RET.


You're right, this assembly makes another call into the asm entry point, which
returns here with IRET.

\
 
 \ /
  Last update: 2022-12-15 04:07    [W:0.088 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site