Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315874
b: refs/heads/master
c: 79d5b4c
h: refs/heads/master
v: v3
  • Loading branch information
Avi Kivity committed Jul 9, 2012
1 parent ef30427 commit a615c2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d6eede4a0492c7478d44d7c8fae80c3bcf529d9
refs/heads/master: 79d5b4c3cd809c770d4bf9812635647016c56011
12 changes: 8 additions & 4 deletions trunk/arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1324,8 +1324,14 @@ static int load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
goto load;
}

/* NULL selector is not valid for TR, CS and SS */
if ((seg == VCPU_SREG_CS || seg == VCPU_SREG_SS || seg == VCPU_SREG_TR)
rpl = selector & 3;
cpl = ctxt->ops->cpl(ctxt);

/* NULL selector is not valid for TR, CS and SS (except for long mode) */
if ((seg == VCPU_SREG_CS
|| (seg == VCPU_SREG_SS
&& (ctxt->mode != X86EMUL_MODE_PROT64 || rpl != cpl))
|| seg == VCPU_SREG_TR)
&& null_selector)
goto exception;

Expand All @@ -1352,9 +1358,7 @@ static int load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
goto exception;
}

rpl = selector & 3;
dpl = seg_desc.dpl;
cpl = ctxt->ops->cpl(ctxt);

switch (seg) {
case VCPU_SREG_SS:
Expand Down

0 comments on commit a615c2d

Please sign in to comment.