Skip to content

Commit

Permalink
KVM: x86 emulator: VM86 segments must have DPL 3
Browse files Browse the repository at this point in the history
Setting the segment DPL to 0 for at least the VM86 code segment makes
the VM entry fail on VMX.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Kevin Wolf authored and Avi Kivity committed Mar 8, 2012
1 parent 7f3d35f commit 66b0ab8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,8 @@ static int load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
seg_desc.type = 3;
seg_desc.p = 1;
seg_desc.s = 1;
if (ctxt->mode == X86EMUL_MODE_VM86)
seg_desc.dpl = 3;
goto load;
}

Expand Down

0 comments on commit 66b0ab8

Please sign in to comment.