From: Avi Kivity Date: Tue, 21 Aug 2012 14:07:06 +0000 (+0300) Subject: KVM: x86 emulator: Fix #GP error code during linearization X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=0afbe2f8781a812c7e501ec129eff45b21f792af;p=deliverable%2Flinux.git KVM: x86 emulator: Fix #GP error code during linearization We want the segment selector, nor segment number. Signed-off-by: Avi Kivity Signed-off-by: Marcelo Tosatti --- diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 5b1c701cd6d0..1451cffd97eb 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -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,