diff options
Diffstat (limited to 'arch/ia64/kvm/kvm-ia64.c')
-rw-r--r-- | arch/ia64/kvm/kvm-ia64.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index 73c5c2b05f64..d7bac1f75af0 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -979,11 +979,13 @@ long kvm_arch_vm_ioctl(struct file *filp, | |||
979 | r = -EFAULT; | 979 | r = -EFAULT; |
980 | if (copy_from_user(&irq_event, argp, sizeof irq_event)) | 980 | if (copy_from_user(&irq_event, argp, sizeof irq_event)) |
981 | goto out; | 981 | goto out; |
982 | r = -ENXIO; | ||
982 | if (irqchip_in_kernel(kvm)) { | 983 | if (irqchip_in_kernel(kvm)) { |
983 | __s32 status; | 984 | __s32 status; |
984 | status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, | 985 | status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, |
985 | irq_event.irq, irq_event.level); | 986 | irq_event.irq, irq_event.level); |
986 | if (ioctl == KVM_IRQ_LINE_STATUS) { | 987 | if (ioctl == KVM_IRQ_LINE_STATUS) { |
988 | r = -EFAULT; | ||
987 | irq_event.status = status; | 989 | irq_event.status = status; |
988 | if (copy_to_user(argp, &irq_event, | 990 | if (copy_to_user(argp, &irq_event, |
989 | sizeof irq_event)) | 991 | sizeof irq_event)) |
@@ -1535,8 +1537,10 @@ long kvm_arch_vcpu_ioctl(struct file *filp, | |||
1535 | goto out; | 1537 | goto out; |
1536 | 1538 | ||
1537 | if (copy_to_user(user_stack, stack, | 1539 | if (copy_to_user(user_stack, stack, |
1538 | sizeof(struct kvm_ia64_vcpu_stack))) | 1540 | sizeof(struct kvm_ia64_vcpu_stack))) { |
1541 | r = -EFAULT; | ||
1539 | goto out; | 1542 | goto out; |
1543 | } | ||
1540 | 1544 | ||
1541 | break; | 1545 | break; |
1542 | } | 1546 | } |
@@ -1802,7 +1806,8 @@ static int kvm_ia64_sync_dirty_log(struct kvm *kvm, | |||
1802 | { | 1806 | { |
1803 | struct kvm_memory_slot *memslot; | 1807 | struct kvm_memory_slot *memslot; |
1804 | int r, i; | 1808 | int r, i; |
1805 | long n, base; | 1809 | long base; |
1810 | unsigned long n; | ||
1806 | unsigned long *dirty_bitmap = (unsigned long *)(kvm->arch.vm_base + | 1811 | unsigned long *dirty_bitmap = (unsigned long *)(kvm->arch.vm_base + |
1807 | offsetof(struct kvm_vm_data, kvm_mem_dirty_log)); | 1812 | offsetof(struct kvm_vm_data, kvm_mem_dirty_log)); |
1808 | 1813 | ||
@@ -1815,7 +1820,7 @@ static int kvm_ia64_sync_dirty_log(struct kvm *kvm, | |||
1815 | if (!memslot->dirty_bitmap) | 1820 | if (!memslot->dirty_bitmap) |
1816 | goto out; | 1821 | goto out; |
1817 | 1822 | ||
1818 | n = ALIGN(memslot->npages, BITS_PER_LONG) / 8; | 1823 | n = kvm_dirty_bitmap_bytes(memslot); |
1819 | base = memslot->base_gfn / BITS_PER_LONG; | 1824 | base = memslot->base_gfn / BITS_PER_LONG; |
1820 | 1825 | ||
1821 | for (i = 0; i < n/sizeof(long); ++i) { | 1826 | for (i = 0; i < n/sizeof(long); ++i) { |
@@ -1831,7 +1836,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, | |||
1831 | struct kvm_dirty_log *log) | 1836 | struct kvm_dirty_log *log) |
1832 | { | 1837 | { |
1833 | int r; | 1838 | int r; |
1834 | int n; | 1839 | unsigned long n; |
1835 | struct kvm_memory_slot *memslot; | 1840 | struct kvm_memory_slot *memslot; |
1836 | int is_dirty = 0; | 1841 | int is_dirty = 0; |
1837 | 1842 | ||
@@ -1850,7 +1855,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, | |||
1850 | if (is_dirty) { | 1855 | if (is_dirty) { |
1851 | kvm_flush_remote_tlbs(kvm); | 1856 | kvm_flush_remote_tlbs(kvm); |
1852 | memslot = &kvm->memslots->memslots[log->slot]; | 1857 | memslot = &kvm->memslots->memslots[log->slot]; |
1853 | n = ALIGN(memslot->npages, BITS_PER_LONG) / 8; | 1858 | n = kvm_dirty_bitmap_bytes(memslot); |
1854 | memset(memslot->dirty_bitmap, 0, n); | 1859 | memset(memslot->dirty_bitmap, 0, n); |
1855 | } | 1860 | } |
1856 | r = 0; | 1861 | r = 0; |