From: Avi Kivity Date: Sun, 10 Jun 2012 14:11:00 +0000 (+0300) Subject: KVM: x86 emulator: initialize memop X-Git-Tag: v3.6-rc1~124^2~34 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=cbd27ee783f1e56d56415e8c5f2492ccedd565c4;p=~emulex%2Finfiniband.git KVM: x86 emulator: initialize memop memop is not initialized; this can lead to a two-byte operation following a 4-byte operation to see garbage values. Usually truncation fixes things fot us later on, but at least in one case (call abs) it doesn't. Fix by moving memop to the auto-initialized field area. Signed-off-by: Avi Kivity --- diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index cd5c96b2496..c764f43b71c 100644 --- a/arch/x86/include/asm/kvm_emulate.h +++ b/arch/x86/include/asm/kvm_emulate.h @@ -280,9 +280,9 @@ struct x86_emulate_ctxt { u8 modrm_seg; bool rip_relative; unsigned long _eip; + struct operand memop; /* Fields above regs are cleared together. */ unsigned long regs[NR_VCPU_REGS]; - struct operand memop; struct operand *memopp; struct fetch_cache fetch; struct read_cache io_read;