Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68406
b: refs/heads/master
c: 9cf9882
h: refs/heads/master
v: v3
  • Loading branch information
Eddie Dong authored and Avi Kivity committed Oct 13, 2007
1 parent 62498e3 commit 446330b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b6958ce44a11a9e9425d2b67a653b1ca2a27796f
refs/heads/master: 9cf98828d12285d1fb43e774c8c100a55f8f34e1
6 changes: 6 additions & 0 deletions trunk/drivers/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1790,6 +1790,7 @@ static void kernel_pio(struct kvm_io_device *pio_dev,
{
/* 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,
Expand All @@ -1798,6 +1799,7 @@ static void kernel_pio(struct kvm_io_device *pio_dev,
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,
Expand All @@ -1807,12 +1809,14 @@ 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,
Expand Down Expand Up @@ -2818,13 +2822,15 @@ static long kvm_vm_ioctl(struct file *filp,
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,
irq_event.level);
kvm_ioapic_set_irq(kvm->vioapic,
irq_event.irq,
irq_event.level);
mutex_unlock(&kvm->lock);
r = 0;
}
break;
Expand Down

0 comments on commit 446330b

Please sign in to comment.