diff --git a/[refs] b/[refs] index f1fb39595805..a30de7089e61 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 49704f26586ca87fcab4fe9323fff8db41e78910 +refs/heads/master: 0521e4c0bc73aa86152ee4e4bd03724c8a9e1d6b diff --git a/trunk/arch/x86/kvm/emulate.c b/trunk/arch/x86/kvm/emulate.c index cb2efa463793..4c5ff22d101a 100644 --- a/trunk/arch/x86/kvm/emulate.c +++ b/trunk/arch/x86/kvm/emulate.c @@ -637,9 +637,12 @@ static int do_fetch_insn_byte(struct x86_emulate_ctxt *ctxt, int size, cur_size; if (eip == fc->end) { + unsigned long linear = eip + ctxt->cs_base; + if (ctxt->mode != X86EMUL_MODE_PROT64) + linear &= (u32)-1; cur_size = fc->end - fc->start; size = min(15UL - cur_size, PAGE_SIZE - offset_in_page(eip)); - rc = ops->fetch(ctxt->cs_base + eip, fc->data + cur_size, + rc = ops->fetch(linear, fc->data + cur_size, size, ctxt->vcpu, &ctxt->exception); if (rc != X86EMUL_CONTINUE) return rc;