diff --git a/[refs] b/[refs] index 80956e70e016..6d9314ce33d5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 78f7826868da8e27d097802139a3fec39f47f3b8 +refs/heads/master: 4e62417bf317504c0b85e0d7abd236f334f54eaf diff --git a/trunk/drivers/kvm/x86_emulate.c b/trunk/drivers/kvm/x86_emulate.c index 0a8696d9b82c..a6ace302e0cd 100644 --- a/trunk/drivers/kvm/x86_emulate.c +++ b/trunk/drivers/kvm/x86_emulate.c @@ -825,6 +825,14 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) if (twobyte && b == 0x01 && modrm_reg == 7) break; srcmem_common: + /* + * For instructions with a ModR/M byte, switch to register + * access if Mod = 3. + */ + if ((d & ModRM) && modrm_mod == 3) { + src.type = OP_REG; + break; + } src.type = OP_MEM; src.ptr = (unsigned long *)cr2; src.val = 0; @@ -893,6 +901,14 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) dst.ptr = (unsigned long *)cr2; dst.bytes = (d & ByteOp) ? 1 : op_bytes; dst.val = 0; + /* + * For instructions with a ModR/M byte, switch to register + * access if Mod = 3. + */ + if ((d & ModRM) && modrm_mod == 3) { + dst.type = OP_REG; + break; + } if (d & BitOp) { unsigned long mask = ~(dst.bytes * 8 - 1);