diff options
author | Kevin Wolf <kwolf@redhat.com> | 2012-02-08 08:34:39 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-03-08 07:10:27 -0500 |
commit | 66b0ab8fac1031ffc70eb77491048339f2717a54 (patch) | |
tree | d323e068a9f6a95fb46c2fc41b66c3a9ed0c90d4 | |
parent | 7f3d35fddd173e52886d03bc34b5b5d6f5bea343 (diff) |
KVM: x86 emulator: VM86 segments must have DPL 3
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>
-rw-r--r-- | arch/x86/kvm/emulate.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index fa310a48591c..b19e9fffe582 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -1244,6 +1244,8 @@ static int load_segment_descriptor(struct x86_emulate_ctxt *ctxt, | |||
1244 | seg_desc.type = 3; | 1244 | seg_desc.type = 3; |
1245 | seg_desc.p = 1; | 1245 | seg_desc.p = 1; |
1246 | seg_desc.s = 1; | 1246 | seg_desc.s = 1; |
1247 | if (ctxt->mode == X86EMUL_MODE_VM86) | ||
1248 | seg_desc.dpl = 3; | ||
1247 | goto load; | 1249 | goto load; |
1248 | } | 1250 | } |
1249 | 1251 | ||