• Avi Kivity's avatar
    KVM: VMX: Separate saving pre-realmode state from setting segments · baa7e81e
    Avi Kivity authored
    Commit b246dd5d ("KVM: VMX: Fix KVM_SET_SREGS with big real mode
    segments") moved fix_rmode_seg() to vmx_set_segment(), so that it is
    applied not just on transitions to real mode, but also on KVM_SET_SREGS
    (migration).  However fix_rmode_seg() not only munges the vmcs segments,
    it also sets up the save area for us to restore when returning to
    protected mode or to return in vmx_get_segment().
    
    Move saving the segment into a new function, save_rmode_seg(), and
    call it just during the transition.
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
    baa7e81e
vmx.c 211 KB