aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-09-28 13:49:33 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-09-28 13:49:33 +0100
commit69f773c57276c97ea79bbfa7324366b211d36e79 (patch)
tree97b99de8164829f80a7399d3cdd689e09d2ac1e2
parent817fbb643280d4194c1933a2159a5a14fe4c29c8 (diff)
downloadxen-69f773c57276c97ea79bbfa7324366b211d36e79.tar.gz
xen-69f773c57276c97ea79bbfa7324366b211d36e79.tar.bz2
xen-69f773c57276c97ea79bbfa7324366b211d36e79.zip
Currently the mmio_operands assumes writing to memory when operand 0 is
register or immediate, this is false for cmp/test opcode. This patch resolve this problem, please review. Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
-rw-r--r--xen/arch/x86/vmx_platform.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/xen/arch/x86/vmx_platform.c b/xen/arch/x86/vmx_platform.c
index d7ef47d718..8052b1c7cd 100644
--- a/xen/arch/x86/vmx_platform.c
+++ b/xen/arch/x86/vmx_platform.c
@@ -833,12 +833,16 @@ void handle_mmio(unsigned long va, unsigned long gpa)
mmio_operands(IOREQ_TYPE_XOR, gpa, &mmio_inst, mpcip, regs);
break;
- case INSTR_CMP:
- mmio_operands(IOREQ_TYPE_COPY, gpa, &mmio_inst, mpcip, regs);
- break;
-
+ case INSTR_CMP: /* Pass through */
case INSTR_TEST:
- mmio_operands(IOREQ_TYPE_COPY, gpa, &mmio_inst, mpcip, regs);
+ mpcip->flags = mmio_inst.flags;
+ mpcip->instr = mmio_inst.instr;
+ mpcip->operand[0] = mmio_inst.operand[0]; /* source */
+ mpcip->operand[1] = mmio_inst.operand[1]; /* destination */
+ mpcip->immediate = mmio_inst.immediate;
+
+ /* send the request and wait for the value */
+ send_mmio_req(IOREQ_TYPE_COPY, gpa, 1, mmio_inst.op_size, 0, IOREQ_READ, 0);
break;
default: