{
/* TODO: String I/O for in kernel device */
+ mutex_lock(&vcpu->kvm->lock);
if (vcpu->pio.in)
kvm_iodevice_read(pio_dev, vcpu->pio.port,
vcpu->pio.size,
kvm_iodevice_write(pio_dev, vcpu->pio.port,
vcpu->pio.size,
pd);
+ mutex_unlock(&vcpu->kvm->lock);
}
static void pio_string_write(struct kvm_io_device *pio_dev,
void *pd = vcpu->pio_data;
int i;
+ mutex_lock(&vcpu->kvm->lock);
for (i = 0; i < io->cur_count; i++) {
kvm_iodevice_write(pio_dev, io->port,
io->size,
pd);
pd += io->size;
}
+ mutex_unlock(&vcpu->kvm->lock);
}
int kvm_emulate_pio (struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
if (copy_from_user(&irq_event, argp, sizeof irq_event))
goto out;
if (irqchip_in_kernel(kvm)) {
+ mutex_lock(&kvm->lock);
if (irq_event.irq < 16)
kvm_pic_set_irq(pic_irqchip(kvm),
irq_event.irq,
kvm_ioapic_set_irq(kvm->vioapic,
irq_event.irq,
irq_event.level);
+ mutex_unlock(&kvm->lock);
r = 0;
}
break;