diff options
Diffstat (limited to 'drivers/kvm/x86_emulate.c')
-rw-r--r-- | drivers/kvm/x86_emulate.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c index e6979475bee7..8e2162fc6f70 100644 --- a/drivers/kvm/x86_emulate.c +++ b/drivers/kvm/x86_emulate.c | |||
@@ -1528,7 +1528,9 @@ special_insn: | |||
1528 | case 0xaa ... 0xab: /* stos */ | 1528 | case 0xaa ... 0xab: /* stos */ |
1529 | c->dst.type = OP_MEM; | 1529 | c->dst.type = OP_MEM; |
1530 | c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes; | 1530 | c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes; |
1531 | c->dst.ptr = (unsigned long *)cr2; | 1531 | c->dst.ptr = (unsigned long *)register_address( |
1532 | ctxt->es_base, | ||
1533 | c->regs[VCPU_REGS_RDI]); | ||
1532 | c->dst.val = c->regs[VCPU_REGS_RAX]; | 1534 | c->dst.val = c->regs[VCPU_REGS_RAX]; |
1533 | register_address_increment(c->regs[VCPU_REGS_RDI], | 1535 | register_address_increment(c->regs[VCPU_REGS_RDI], |
1534 | (ctxt->eflags & EFLG_DF) ? -c->dst.bytes | 1536 | (ctxt->eflags & EFLG_DF) ? -c->dst.bytes |
@@ -1538,9 +1540,13 @@ special_insn: | |||
1538 | c->dst.type = OP_REG; | 1540 | c->dst.type = OP_REG; |
1539 | c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes; | 1541 | c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes; |
1540 | c->dst.ptr = (unsigned long *)&c->regs[VCPU_REGS_RAX]; | 1542 | c->dst.ptr = (unsigned long *)&c->regs[VCPU_REGS_RAX]; |
1541 | if ((rc = ops->read_emulated(cr2, &c->dst.val, | 1543 | if ((rc = ops->read_emulated(register_address( |
1542 | c->dst.bytes, | 1544 | c->override_base ? *c->override_base : |
1543 | ctxt->vcpu)) != 0) | 1545 | ctxt->ds_base, |
1546 | c->regs[VCPU_REGS_RSI]), | ||
1547 | &c->dst.val, | ||
1548 | c->dst.bytes, | ||
1549 | ctxt->vcpu)) != 0) | ||
1544 | goto done; | 1550 | goto done; |
1545 | register_address_increment(c->regs[VCPU_REGS_RSI], | 1551 | register_address_increment(c->regs[VCPU_REGS_RSI], |
1546 | (ctxt->eflags & EFLG_DF) ? -c->dst.bytes | 1552 | (ctxt->eflags & EFLG_DF) ? -c->dst.bytes |