From 869de397575dde5cfca98480a6bdaf48fc9ee115 Mon Sep 17 00:00:00 2001 From: Shiqing Gao Date: Mon, 15 Apr 2019 11:42:11 +0800 Subject: [PATCH] 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 Acked-by: Eddie Dong --- doc/developer-guides/hld/hv-vt-d.rst | 4 ++-- hypervisor/arch/x86/vtd.c | 4 ++-- hypervisor/common/hypercall.c | 4 ++-- hypervisor/dm/vpci/vpci.c | 6 +++--- hypervisor/include/arch/x86/vtd.h | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/developer-guides/hld/hv-vt-d.rst b/doc/developer-guides/hld/hv-vt-d.rst index 0476aeb29..a1ff61d40 100644 --- a/doc/developer-guides/hld/hv-vt-d.rst +++ b/doc/developer-guides/hld/hv-vt-d.rst @@ -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 diff --git a/hypervisor/arch/x86/vtd.c b/hypervisor/arch/x86/vtd.c index 3320fe033..f9132b36e 100644 --- a/hypervisor/arch/x86/vtd.c +++ b/hypervisor/arch/x86/vtd.c @@ -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; diff --git a/hypervisor/common/hypercall.c b/hypervisor/common/hypercall.c index e17aad930..ea4cf5039 100644 --- a/hypervisor/common/hypercall.c +++ b/hypervisor/common/hypercall.c @@ -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)); } } diff --git a/hypervisor/dm/vpci/vpci.c b/hypervisor/dm/vpci/vpci.c index 94a2d93fb..68c54c993 100644 --- a/hypervisor/dm/vpci/vpci.c +++ b/hypervisor/dm/vpci/vpci.c @@ -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. */ diff --git a/hypervisor/include/arch/x86/vtd.h b/hypervisor/include/arch/x86/vtd.h index 993b806d4..bde63b5d4 100644 --- a/hypervisor/include/arch/x86/vtd.h +++ b/hypervisor/include/arch/x86/vtd.h @@ -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.