io->count -= io->cur_count;
io->cur_count = 0;
- if (!io->count)
- kvm_arch_ops->skip_emulated_instruction(vcpu);
return 0;
}
pio_dev = vcpu_find_pio_dev(vcpu, port);
if (!string) {
+ kvm_arch_ops->skip_emulated_instruction(vcpu);
kvm_arch_ops->cache_regs(vcpu);
memcpy(vcpu->pio_data, &vcpu->regs[VCPU_REGS_RAX], 4);
kvm_arch_ops->decache_regs(vcpu);
vcpu->run->io.count = now;
vcpu->pio.cur_count = now;
+ if (now == count)
+ kvm_arch_ops->skip_emulated_instruction(vcpu);
+
for (i = 0; i < nr_pages; ++i) {
spin_lock(&vcpu->kvm->lock);
page = gva_to_page(vcpu, address + i * PAGE_SIZE);