• Paolo Bonzini's avatar
    KVM: x86: do not go through ctxt->ops when emulating rsm · 1d0da94c
    Paolo Bonzini authored
    Now that RSM is implemented in a single emulator callback, there is no
    point in going through other callbacks for the sake of modifying
    processor state.  Just invoke KVM's own internal functions directly,
    and remove the callbacks that were only used by em_rsm; the only
    substantial difference is in the handling of the segment registers
    and descriptor cache, which have to be parsed into a struct kvm_segment
    instead of a struct desc_struct.
    
    This also fixes a bug where emulator_set_segment was shifting the
    limit left by 12 if the G bit is set, but the limit had not been
    shifted right upon entry to SMM.
    
    The emulator context is still used to restore EIP and the general
    purpose registers.
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
    Message-Id: <20220929172016.319443-5-pbonzini@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    1d0da94c
x86.c 356 KB