diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2019-05-15 17:38:42 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-05-15 17:39:38 -0400 |
commit | 59c5c58c5b93285753d5c1de34d2e00039c27bc0 (patch) | |
tree | 19ac0493a5eb3bef477cb04f8117dad12b6bddb9 /virt | |
parent | f93f7ede087f2edcc18e4b02310df5749a6b5a61 (diff) | |
parent | 4894fbcce856635c9ab79f44e50826e86bb92110 (diff) |
Merge tag 'kvm-ppc-next-5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into HEAD
PPC KVM update for 5.2
* Support for guests to access the new POWER9 XIVE interrupt controller
hardware directly, reducing interrupt latency and overhead for guests.
* In-kernel implementation of the H_PAGE_INIT hypercall.
* Reduce memory usage of sparsely-populated IOMMU tables.
* Several bug fixes.
Second PPC KVM update for 5.2
* Fix a bug, fix a spelling mistake, remove some useless code.
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/kvm_main.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index f4e02cd8fa43..d22b1f4bfa56 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -2950,6 +2950,16 @@ out: | |||
2950 | } | 2950 | } |
2951 | #endif | 2951 | #endif |
2952 | 2952 | ||
2953 | static int kvm_device_mmap(struct file *filp, struct vm_area_struct *vma) | ||
2954 | { | ||
2955 | struct kvm_device *dev = filp->private_data; | ||
2956 | |||
2957 | if (dev->ops->mmap) | ||
2958 | return dev->ops->mmap(dev, vma); | ||
2959 | |||
2960 | return -ENODEV; | ||
2961 | } | ||
2962 | |||
2953 | static int kvm_device_ioctl_attr(struct kvm_device *dev, | 2963 | static int kvm_device_ioctl_attr(struct kvm_device *dev, |
2954 | int (*accessor)(struct kvm_device *dev, | 2964 | int (*accessor)(struct kvm_device *dev, |
2955 | struct kvm_device_attr *attr), | 2965 | struct kvm_device_attr *attr), |
@@ -2994,6 +3004,13 @@ static int kvm_device_release(struct inode *inode, struct file *filp) | |||
2994 | struct kvm_device *dev = filp->private_data; | 3004 | struct kvm_device *dev = filp->private_data; |
2995 | struct kvm *kvm = dev->kvm; | 3005 | struct kvm *kvm = dev->kvm; |
2996 | 3006 | ||
3007 | if (dev->ops->release) { | ||
3008 | mutex_lock(&kvm->lock); | ||
3009 | list_del(&dev->vm_node); | ||
3010 | dev->ops->release(dev); | ||
3011 | mutex_unlock(&kvm->lock); | ||
3012 | } | ||
3013 | |||
2997 | kvm_put_kvm(kvm); | 3014 | kvm_put_kvm(kvm); |
2998 | return 0; | 3015 | return 0; |
2999 | } | 3016 | } |
@@ -3002,6 +3019,7 @@ static const struct file_operations kvm_device_fops = { | |||
3002 | .unlocked_ioctl = kvm_device_ioctl, | 3019 | .unlocked_ioctl = kvm_device_ioctl, |
3003 | .release = kvm_device_release, | 3020 | .release = kvm_device_release, |
3004 | KVM_COMPAT(kvm_device_ioctl), | 3021 | KVM_COMPAT(kvm_device_ioctl), |
3022 | .mmap = kvm_device_mmap, | ||
3005 | }; | 3023 | }; |
3006 | 3024 | ||
3007 | struct kvm_device *kvm_device_from_filp(struct file *filp) | 3025 | struct kvm_device *kvm_device_from_filp(struct file *filp) |