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-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=30b31ab6823988263c72a215fb875edec6161250;p=linux-beck.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 e96705542634..bdbbb1839e89 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; }