From: Avi Kivity Date: Wed, 17 Nov 2010 13:28:22 +0000 (+0200) Subject: KVM: x86 emulator: do not perform address calculations on linear addresses X-Git-Tag: v2.6.38-rc1~244^2~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30b31ab6823988263c72a215fb875edec6161250;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git KVM: x86 emulator: do not perform address calculations on linear addresses Linear addresses are supposed to already have segment checks performed on them; if we play with these addresses the checks become invalid. 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 e967055..bdbbb18 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -568,7 +568,8 @@ static int read_descriptor(struct x86_emulate_ctxt *ctxt, ctxt->vcpu, NULL); if (rc != X86EMUL_CONTINUE) return rc; - rc = ops->read_std(linear(ctxt, addr) + 2, address, op_bytes, + addr.ea += 2; + rc = ops->read_std(linear(ctxt, addr), address, op_bytes, ctxt->vcpu, NULL); return rc; }