Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'kvm-updates/3.0' of git://git.kernel.org/pub/scm/virt/kvm/kvm

* 'kvm-updates/3.0' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: x86 emulator: fix %rip-relative addressing with immediate source operand

+7 -5
+7 -5
arch/x86/kvm/emulate.c
··· 3372 3372 int def_op_bytes, def_ad_bytes, goffset, simd_prefix; 3373 3373 bool op_prefix = false; 3374 3374 struct opcode opcode; 3375 - struct operand memop = { .type = OP_NONE }; 3375 + struct operand memop = { .type = OP_NONE }, *memopp = NULL; 3376 3376 3377 3377 c->eip = ctxt->eip; 3378 3378 c->fetch.start = c->eip; ··· 3547 3547 if (memop.type == OP_MEM && c->ad_bytes != 8) 3548 3548 memop.addr.mem.ea = (u32)memop.addr.mem.ea; 3549 3549 3550 - if (memop.type == OP_MEM && c->rip_relative) 3551 - memop.addr.mem.ea += c->eip; 3552 - 3553 3550 /* 3554 3551 * Decode and fetch the source operand: register, memory 3555 3552 * or immediate. ··· 3568 3571 c->op_bytes; 3569 3572 srcmem_common: 3570 3573 c->src = memop; 3574 + memopp = &c->src; 3571 3575 break; 3572 3576 case SrcImmU16: 3573 3577 rc = decode_imm(ctxt, &c->src, 2, false); ··· 3665 3667 case DstMem: 3666 3668 case DstMem64: 3667 3669 c->dst = memop; 3670 + memopp = &c->dst; 3668 3671 if ((c->d & DstMask) == DstMem64) 3669 3672 c->dst.bytes = 8; 3670 3673 else ··· 3699 3700 /* Special instructions do their own operand decoding. */ 3700 3701 default: 3701 3702 c->dst.type = OP_NONE; /* Disable writeback. */ 3702 - return 0; 3703 + break; 3703 3704 } 3704 3705 3705 3706 done: 3707 + if (memopp && memopp->type == OP_MEM && c->rip_relative) 3708 + memopp->addr.mem.ea += c->eip; 3709 + 3706 3710 return (rc == X86EMUL_UNHANDLEABLE) ? EMULATION_FAILED : EMULATION_OK; 3707 3711 } 3708 3712