mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
KVM: count number of assigned devices
If there are no assigned devices, the guest PAT are not providing any useful information and can be overridden to writeback; VMX always does this because it has the "IPAT" bit in its extended page table entries, but SVM does not have anything similar. Hook into VFIO and legacy device assignment so that they provide this information to KVM. Reviewed-by: Alex Williamson <[email protected]> Tested-by: Joerg Roedel <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
This commit is contained in:
parent
370777daab
commit
5544eb9b81
5 changed files with 45 additions and 0 deletions
|
|
@ -155,6 +155,8 @@ static int kvm_vfio_set_group(struct kvm_device *dev, long attr, u64 arg)
|
|||
list_add_tail(&kvg->node, &kv->group_list);
|
||||
kvg->vfio_group = vfio_group;
|
||||
|
||||
kvm_arch_start_assignment(dev->kvm);
|
||||
|
||||
mutex_unlock(&kv->lock);
|
||||
|
||||
kvm_vfio_update_coherency(dev);
|
||||
|
|
@ -190,6 +192,8 @@ static int kvm_vfio_set_group(struct kvm_device *dev, long attr, u64 arg)
|
|||
break;
|
||||
}
|
||||
|
||||
kvm_arch_end_assignment(dev->kvm);
|
||||
|
||||
mutex_unlock(&kv->lock);
|
||||
|
||||
kvm_vfio_group_put_external_user(vfio_group);
|
||||
|
|
@ -239,6 +243,7 @@ static void kvm_vfio_destroy(struct kvm_device *dev)
|
|||
kvm_vfio_group_put_external_user(kvg->vfio_group);
|
||||
list_del(&kvg->node);
|
||||
kfree(kvg);
|
||||
kvm_arch_end_assignment(dev->kvm);
|
||||
}
|
||||
|
||||
kvm_vfio_update_coherency(dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue