hv: rename 'assign_iommu_device' and 'unassign_iommu_device'
- rename 'assign_iommu_device' to 'assign_pt_device' - rename 'unassign_iommu_device' to 'unassign_pt_device' Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Acked-by: Eddie Dong <eddie.dong@inte.com>
This commit is contained in:
parent
ccecd55075
commit
869de39757
|
@ -326,9 +326,9 @@ The following API are provided during runtime:
|
|||
.. doxygenfunction:: resume_iommu
|
||||
:project: Project ACRN
|
||||
|
||||
.. doxygenfunction:: assign_iommu_device
|
||||
.. doxygenfunction:: assign_pt_device
|
||||
:project: Project ACRN
|
||||
|
||||
.. doxygenfunction:: unassign_iommu_device
|
||||
.. doxygenfunction:: unassign_pt_device
|
||||
:project: Project ACRN
|
||||
|
||||
|
|
|
@ -1261,7 +1261,7 @@ void destroy_iommu_domain(struct iommu_domain *domain)
|
|||
(void)memset(domain, 0U, sizeof(*domain));
|
||||
}
|
||||
|
||||
int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t devfun)
|
||||
int32_t assign_pt_device(struct iommu_domain *domain, uint8_t bus, uint8_t devfun)
|
||||
{
|
||||
int32_t status = 0;
|
||||
uint16_t bus_local = bus;
|
||||
|
@ -1283,7 +1283,7 @@ int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t de
|
|||
return status;
|
||||
}
|
||||
|
||||
int32_t unassign_iommu_device(const struct iommu_domain *domain, uint8_t bus, uint8_t devfun)
|
||||
int32_t unassign_pt_device(const struct iommu_domain *domain, uint8_t bus, uint8_t devfun)
|
||||
{
|
||||
int32_t status = 0;
|
||||
uint16_t bus_local = bus;
|
||||
|
|
|
@ -863,7 +863,7 @@ int32_t hcall_assign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
|||
}
|
||||
}
|
||||
if (bdf_valid && iommu_valid) {
|
||||
ret = assign_iommu_device(target_vm->iommu,
|
||||
ret = assign_pt_device(target_vm->iommu,
|
||||
(uint8_t)(bdf >> 8U), (uint8_t)(bdf & 0xffU));
|
||||
}
|
||||
} else {
|
||||
|
@ -907,7 +907,7 @@ int32_t hcall_deassign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
|
|||
}
|
||||
|
||||
if (bdf_valid) {
|
||||
ret = unassign_iommu_device(target_vm->iommu,
|
||||
ret = unassign_pt_device(target_vm->iommu,
|
||||
(uint8_t)(bdf >> 8U), (uint8_t)(bdf & 0xffU));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -309,7 +309,7 @@ static void assign_vdev_pt_iommu_domain(const struct pci_vdev *vdev)
|
|||
hva2hpa(vm->arch_vm.nworld_eptp), 48U);
|
||||
}
|
||||
|
||||
ret = assign_iommu_device(vm->iommu, (uint8_t)vdev->pdev->bdf.bits.b,
|
||||
ret = assign_pt_device(vm->iommu, (uint8_t)vdev->pdev->bdf.bits.b,
|
||||
(uint8_t)(vdev->pdev->bdf.value & 0xFFU));
|
||||
if (ret != 0) {
|
||||
panic("failed to assign iommu device!");
|
||||
|
@ -326,13 +326,13 @@ static void remove_vdev_pt_iommu_domain(const struct pci_vdev *vdev)
|
|||
int32_t ret;
|
||||
struct acrn_vm *vm = vdev->vpci->vm;
|
||||
|
||||
ret = unassign_iommu_device(vm->iommu, (uint8_t)vdev->pdev->bdf.bits.b,
|
||||
ret = unassign_pt_device(vm->iommu, (uint8_t)vdev->pdev->bdf.bits.b,
|
||||
(uint8_t)(vdev->pdev->bdf.value & 0xFFU));
|
||||
if (ret != 0) {
|
||||
/*
|
||||
*TODO
|
||||
* panic needs to be removed here
|
||||
* Currently unassign_iommu_device can fail for multiple reasons
|
||||
* Currently unassign_pt_device can fail for multiple reasons
|
||||
* Once all the reasons and methods to avoid them can be made sure
|
||||
* panic here is not necessary.
|
||||
*/
|
||||
|
|
|
@ -553,7 +553,7 @@ struct iommu_domain;
|
|||
* @pre domain != NULL
|
||||
*
|
||||
*/
|
||||
int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t devfun);
|
||||
int32_t assign_pt_device(struct iommu_domain *domain, uint8_t bus, uint8_t devfun);
|
||||
|
||||
/**
|
||||
* @brief Unassign a device specified by bus & devfun from a iommu domain .
|
||||
|
@ -570,7 +570,7 @@ int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t de
|
|||
* @pre domain != NULL
|
||||
*
|
||||
*/
|
||||
int32_t unassign_iommu_device(const struct iommu_domain *domain, uint8_t bus, uint8_t devfun);
|
||||
int32_t unassign_pt_device(const struct iommu_domain *domain, uint8_t bus, uint8_t devfun);
|
||||
|
||||
/**
|
||||
* @brief Create a iommu domain for a VM specified by vm_id.
|
||||
|
|
Loading…
Reference in New Issue