• Anthony Liguori's avatar
    KVM: When switching to a vm8086 task, load segments as 16-bit · c0c7c04b
    Anthony Liguori authored
    According to 16.2.5 in the SDM, eflags.vm in the tss is consulted before loading
    and new segments.  If eflags.vm == 1, then the segments are treated as 16-bit
    segments.  The LDTR and TR are not normally available in vm86 mode so if they
    happen to somehow get loaded, they need to be treated as 32-bit segments.
    
    This fixes an invalid vmentry failure in a custom OS that was happening after
    a task switch into vm8086 mode.  Since the segments were being mistakenly
    treated as 32-bit, we loaded garbage state.
    Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    c0c7c04b
x86.c 120 KB