Skip to content

Commit

Permalink
KVM: x86 emulator: Fix #GP error code during linearization
Browse files Browse the repository at this point in the history
We want the segment selector, nor segment number.

Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
avikivity authored and matosatti committed Aug 27, 2012
1 parent a562518 commit 0afbe2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,9 +725,9 @@ static int __linearize(struct x86_emulate_ctxt *ctxt,
return X86EMUL_CONTINUE;
bad:
if (addr.seg == VCPU_SREG_SS)
return emulate_ss(ctxt, addr.seg);
return emulate_ss(ctxt, sel);
else
return emulate_gp(ctxt, addr.seg);
return emulate_gp(ctxt, sel);
}

static int linearize(struct x86_emulate_ctxt *ctxt,
Expand Down

0 comments on commit 0afbe2f

Please sign in to comment.