Skip to content

Commit 869de39

Browse files
shiqinggEddie Dong
authored andcommitted
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>
1 parent ccecd55 commit 869de39

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

doc/developer-guides/hld/hv-vt-d.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ The following API are provided during runtime:
326326
.. doxygenfunction:: resume_iommu
327327
:project: Project ACRN
328328

329-
.. doxygenfunction:: assign_iommu_device
329+
.. doxygenfunction:: assign_pt_device
330330
:project: Project ACRN
331331

332-
.. doxygenfunction:: unassign_iommu_device
332+
.. doxygenfunction:: unassign_pt_device
333333
:project: Project ACRN
334334

hypervisor/arch/x86/vtd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ void destroy_iommu_domain(struct iommu_domain *domain)
12611261
(void)memset(domain, 0U, sizeof(*domain));
12621262
}
12631263

1264-
int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t devfun)
1264+
int32_t assign_pt_device(struct iommu_domain *domain, uint8_t bus, uint8_t devfun)
12651265
{
12661266
int32_t status = 0;
12671267
uint16_t bus_local = bus;
@@ -1283,7 +1283,7 @@ int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t de
12831283
return status;
12841284
}
12851285

1286-
int32_t unassign_iommu_device(const struct iommu_domain *domain, uint8_t bus, uint8_t devfun)
1286+
int32_t unassign_pt_device(const struct iommu_domain *domain, uint8_t bus, uint8_t devfun)
12871287
{
12881288
int32_t status = 0;
12891289
uint16_t bus_local = bus;

hypervisor/common/hypercall.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ int32_t hcall_assign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
863863
}
864864
}
865865
if (bdf_valid && iommu_valid) {
866-
ret = assign_iommu_device(target_vm->iommu,
866+
ret = assign_pt_device(target_vm->iommu,
867867
(uint8_t)(bdf >> 8U), (uint8_t)(bdf & 0xffU));
868868
}
869869
} else {
@@ -907,7 +907,7 @@ int32_t hcall_deassign_ptdev(struct acrn_vm *vm, uint16_t vmid, uint64_t param)
907907
}
908908

909909
if (bdf_valid) {
910-
ret = unassign_iommu_device(target_vm->iommu,
910+
ret = unassign_pt_device(target_vm->iommu,
911911
(uint8_t)(bdf >> 8U), (uint8_t)(bdf & 0xffU));
912912
}
913913
}

hypervisor/dm/vpci/vpci.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static void assign_vdev_pt_iommu_domain(const struct pci_vdev *vdev)
309309
hva2hpa(vm->arch_vm.nworld_eptp), 48U);
310310
}
311311

312-
ret = assign_iommu_device(vm->iommu, (uint8_t)vdev->pdev->bdf.bits.b,
312+
ret = assign_pt_device(vm->iommu, (uint8_t)vdev->pdev->bdf.bits.b,
313313
(uint8_t)(vdev->pdev->bdf.value & 0xFFU));
314314
if (ret != 0) {
315315
panic("failed to assign iommu device!");
@@ -326,13 +326,13 @@ static void remove_vdev_pt_iommu_domain(const struct pci_vdev *vdev)
326326
int32_t ret;
327327
struct acrn_vm *vm = vdev->vpci->vm;
328328

329-
ret = unassign_iommu_device(vm->iommu, (uint8_t)vdev->pdev->bdf.bits.b,
329+
ret = unassign_pt_device(vm->iommu, (uint8_t)vdev->pdev->bdf.bits.b,
330330
(uint8_t)(vdev->pdev->bdf.value & 0xFFU));
331331
if (ret != 0) {
332332
/*
333333
*TODO
334334
* panic needs to be removed here
335-
* Currently unassign_iommu_device can fail for multiple reasons
335+
* Currently unassign_pt_device can fail for multiple reasons
336336
* Once all the reasons and methods to avoid them can be made sure
337337
* panic here is not necessary.
338338
*/

hypervisor/include/arch/x86/vtd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ struct iommu_domain;
553553
* @pre domain != NULL
554554
*
555555
*/
556-
int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t devfun);
556+
int32_t assign_pt_device(struct iommu_domain *domain, uint8_t bus, uint8_t devfun);
557557

558558
/**
559559
* @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
570570
* @pre domain != NULL
571571
*
572572
*/
573-
int32_t unassign_iommu_device(const struct iommu_domain *domain, uint8_t bus, uint8_t devfun);
573+
int32_t unassign_pt_device(const struct iommu_domain *domain, uint8_t bus, uint8_t devfun);
574574

575575
/**
576576
* @brief Create a iommu domain for a VM specified by vm_id.

0 commit comments

Comments
 (0)