Skip to content

Commit

Permalink
KVM: VMX: Allow real mode emulation using vm86 with dpl=0
Browse files Browse the repository at this point in the history
Real mode is always entered from protected mode with dpl=0.  Since
the dpl doesn't affect execution, and we already override it to 3
in the vmcs (as vmx requires), we can allow execution in that state.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
  • Loading branch information
Avi Kivity authored and Marcelo Tosatti committed Aug 27, 2012
1 parent c865c43 commit 495e116
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3317,7 +3317,7 @@ static bool rmode_segment_valid(struct kvm_vcpu *vcpu, int seg)
return false;
if (var.limit != 0xffff)
return false;
if (ar != 0xf3)
if ((ar | (3 << AR_DPL_SHIFT)) != 0xf3)
return false;

return true;
Expand Down

0 comments on commit 495e116

Please sign in to comment.