title: Must IRET  be used when returning from an interrupt?
body: <p>IRET can restore the registers from the stack,including EFLAGS, ESP, EIP and so on, but we can also restore the registers all by ourselves.  For example, "movl" can be used to restore the %esp register, "jmp" can jump the address pointed to EIP which is stored on the stack.</p>
  
  <p>The linux kernel returns from all interrupts by IRET, which is a weight instruction.</p>
  
  <p>Some kernel operations (like context switches) happen frequently.</p>
  
  <p>Isn't IRET a waste?</p>