Skip to content
  • Paolo Bonzini's avatar
    9982f74b
    target-i386: mask NMIs on entry to SMM · 9982f74b
    Paolo Bonzini authored
    
    
    QEMU is not blocking NMIs on entry to SMM.  Implementing this has to
    cover a few corner cases, because:
    
    - NMIs can then be enabled by an IRET instruction and there
    is no mechanism to _set_ the "NMIs masked" flag on exit from SMM:
    "A special case can occur if an SMI handler nests inside an NMI handler
    and then another NMI occurs. [...] When the processor enters SMM while
    executing an NMI handler, the processor saves the SMRAM state save map
    but does not save the attribute to keep NMI interrupts disabled.
    
    - However, there is some hidden state, because "If NMIs were blocked
    before the SMI occurred [and no IRET is executed while in SMM], they
    are blocked after execution of RSM."  This is represented by the new
    HF2_SMM_INSIDE_NMI_MASK bit.  If it is zero, NMIs are _unblocked_
    on exit from RSM.
    
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    9982f74b
    target-i386: mask NMIs on entry to SMM
    Paolo Bonzini authored
    
    
    QEMU is not blocking NMIs on entry to SMM.  Implementing this has to
    cover a few corner cases, because:
    
    - NMIs can then be enabled by an IRET instruction and there
    is no mechanism to _set_ the "NMIs masked" flag on exit from SMM:
    "A special case can occur if an SMI handler nests inside an NMI handler
    and then another NMI occurs. [...] When the processor enters SMM while
    executing an NMI handler, the processor saves the SMRAM state save map
    but does not save the attribute to keep NMI interrupts disabled.
    
    - However, there is some hidden state, because "If NMIs were blocked
    before the SMI occurred [and no IRET is executed while in SMM], they
    are blocked after execution of RSM."  This is represented by the new
    HF2_SMM_INSIDE_NMI_MASK bit.  If it is zero, NMIs are _unblocked_
    on exit from RSM.
    
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading