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.
This commit is contained in:
@@ -2950,6 +2950,16 @@ out:
|
||||
}
|
||||
#endif
|
||||
|
||||
static int kvm_device_mmap(struct file *filp, struct vm_area_struct *vma)
|
||||
{
|
||||
struct kvm_device *dev = filp->private_data;
|
||||
|
||||
if (dev->ops->mmap)
|
||||
return dev->ops->mmap(dev, vma);
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int kvm_device_ioctl_attr(struct kvm_device *dev,
|
||||
int (*accessor)(struct kvm_device *dev,
|
||||
struct kvm_device_attr *attr),
|
||||
@@ -2994,6 +3004,13 @@ static int kvm_device_release(struct inode *inode, struct file *filp)
|
||||
struct kvm_device *dev = filp->private_data;
|
||||
struct kvm *kvm = dev->kvm;
|
||||
|
||||
if (dev->ops->release) {
|
||||
mutex_lock(&kvm->lock);
|
||||
list_del(&dev->vm_node);
|
||||
dev->ops->release(dev);
|
||||
mutex_unlock(&kvm->lock);
|
||||
}
|
||||
|
||||
kvm_put_kvm(kvm);
|
||||
return 0;
|
||||
}
|
||||
@@ -3002,6 +3019,7 @@ static const struct file_operations kvm_device_fops = {
|
||||
.unlocked_ioctl = kvm_device_ioctl,
|
||||
.release = kvm_device_release,
|
||||
KVM_COMPAT(kvm_device_ioctl),
|
||||
.mmap = kvm_device_mmap,
|
||||
};
|
||||
|
||||
struct kvm_device *kvm_device_from_filp(struct file *filp)
|
||||
|
Reference in New Issue
Block a user