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:
Shiqing Gao 2019-04-15 11:42:11 +08:00 committed by Eddie Dong
parent ccecd55075
commit 869de39757
5 changed files with 11 additions and 11 deletions

View File

@ -326,9 +326,9 @@ The following API are provided during runtime:
.. doxygenfunction:: resume_iommu .. doxygenfunction:: resume_iommu
:project: Project ACRN :project: Project ACRN
.. doxygenfunction:: assign_iommu_device .. doxygenfunction:: assign_pt_device
:project: Project ACRN :project: Project ACRN
.. doxygenfunction:: unassign_iommu_device .. doxygenfunction:: unassign_pt_device
:project: Project ACRN :project: Project ACRN

View File

@ -1261,7 +1261,7 @@ void destroy_iommu_domain(struct iommu_domain *domain)
(void)memset(domain, 0U, sizeof(*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; int32_t status = 0;
uint16_t bus_local = bus; 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; 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; int32_t status = 0;
uint16_t bus_local = bus; uint16_t bus_local = bus;

View File

@ -863,7 +863,7 @@ int32_t hcall_assign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
} }
} }
if (bdf_valid && iommu_valid) { 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)); (uint8_t)(bdf >> 8U), (uint8_t)(bdf & 0xffU));
} }
} else { } else {
@ -907,7 +907,7 @@ int32_t hcall_deassign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
} }
if (bdf_valid) { 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)); (uint8_t)(bdf >> 8U), (uint8_t)(bdf & 0xffU));
} }
} }

View File

@ -309,7 +309,7 @@ static void assign_vdev_pt_iommu_domain(const struct pci_vdev *vdev)
hva2hpa(vm->arch_vm.nworld_eptp), 48U); 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)); (uint8_t)(vdev->pdev->bdf.value & 0xFFU));
if (ret != 0) { if (ret != 0) {
panic("failed to assign iommu device!"); 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; int32_t ret;
struct acrn_vm *vm = vdev->vpci->vm; 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)); (uint8_t)(vdev->pdev->bdf.value & 0xFFU));
if (ret != 0) { if (ret != 0) {
/* /*
*TODO *TODO
* panic needs to be removed here * 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 * Once all the reasons and methods to avoid them can be made sure
* panic here is not necessary. * panic here is not necessary.
*/ */

View File

@ -553,7 +553,7 @@ struct iommu_domain;
* @pre domain != NULL * @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 . * @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 * @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. * @brief Create a iommu domain for a VM specified by vm_id.