diff --git a/hypervisor/dm/vpci/pci_pt.c b/hypervisor/dm/vpci/pci_pt.c index 9a95e1e15..429e2e21d 100644 --- a/hypervisor/dm/vpci/pci_pt.c +++ b/hypervisor/dm/vpci/pci_pt.c @@ -35,7 +35,6 @@ /* * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL */ static void vdev_pt_unmap_msix(struct pci_vdev *vdev) { @@ -63,7 +62,6 @@ static void vdev_pt_unmap_msix(struct pci_vdev *vdev) /* * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL */ void vdev_pt_map_msix(struct pci_vdev *vdev, bool hold_lock) { @@ -89,7 +87,6 @@ void vdev_pt_map_msix(struct pci_vdev *vdev, bool hold_lock) /** * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL */ static void vdev_pt_unmap_mem_vbar(struct pci_vdev *vdev, uint32_t idx) { @@ -111,7 +108,6 @@ static void vdev_pt_unmap_mem_vbar(struct pci_vdev *vdev, uint32_t idx) /** * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL */ static void vdev_pt_map_mem_vbar(struct pci_vdev *vdev, uint32_t idx) { @@ -136,7 +132,6 @@ static void vdev_pt_map_mem_vbar(struct pci_vdev *vdev, uint32_t idx) * @brief Allow IO bar access * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL */ static void vdev_pt_allow_io_vbar(struct pci_vdev *vdev, uint32_t idx) { @@ -155,7 +150,6 @@ static void vdev_pt_allow_io_vbar(struct pci_vdev *vdev, uint32_t idx) * @brief Deny IO bar access * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL */ static void vdev_pt_deny_io_vbar(struct pci_vdev *vdev, uint32_t idx) { @@ -242,7 +236,6 @@ void vdev_pt_write_vbar(struct pci_vdev *vdev, uint32_t idx, uint32_t val) * * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL * @pre vdev->pdev != NULL * * @return None @@ -365,7 +358,6 @@ static void init_bars(struct pci_vdev *vdev, bool is_sriov_bar) * * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL * @pre vdev->pdev != NULL * * @return None diff --git a/hypervisor/dm/vpci/vhostbridge.c b/hypervisor/dm/vpci/vhostbridge.c index 1a9a016ab..49647cb5b 100644 --- a/hypervisor/dm/vpci/vhostbridge.c +++ b/hypervisor/dm/vpci/vhostbridge.c @@ -42,7 +42,6 @@ /** * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL */ static void init_vhostbridge(struct pci_vdev *vdev) { @@ -101,7 +100,6 @@ static void deinit_vhostbridge(__unused struct pci_vdev *vdev) /** * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL */ static int32_t read_vhostbridge_cfg(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val) @@ -114,7 +112,6 @@ static int32_t read_vhostbridge_cfg(const struct pci_vdev *vdev, uint32_t offset /** * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL */ static int32_t write_vhostbridge_cfg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val) diff --git a/hypervisor/dm/vpci/vmsi.c b/hypervisor/dm/vpci/vmsi.c index 979d29826..0f62ecee9 100644 --- a/hypervisor/dm/vpci/vmsi.c +++ b/hypervisor/dm/vpci/vmsi.c @@ -57,7 +57,6 @@ static inline void enable_disable_msi(const struct pci_vdev *vdev, bool enable) * * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL * @pre vdev->pdev != NULL */ static void remap_vmsi(const struct pci_vdev *vdev) @@ -125,7 +124,6 @@ void write_vmsi_cfg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint /** * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL */ void deinit_vmsi(struct pci_vdev *vdev) { diff --git a/hypervisor/dm/vpci/vmsix.c b/hypervisor/dm/vpci/vmsix.c index 2b73ed930..45eda4ed5 100644 --- a/hypervisor/dm/vpci/vmsix.c +++ b/hypervisor/dm/vpci/vmsix.c @@ -72,7 +72,6 @@ static void mask_one_msix_vector(const struct pci_vdev *vdev, uint32_t index) /** * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL * @pre vdev->pdev != NULL */ static void remap_one_vmsix_entry(const struct pci_vdev *vdev, uint32_t index) @@ -260,7 +259,6 @@ void init_vmsix(struct pci_vdev *vdev) /** * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL */ void deinit_vmsix(struct pci_vdev *vdev) { diff --git a/hypervisor/dm/vpci/vpci.c b/hypervisor/dm/vpci/vpci.c index 38cc150dc..1d8982985 100644 --- a/hypervisor/dm/vpci/vpci.c +++ b/hypervisor/dm/vpci/vpci.c @@ -299,8 +299,7 @@ void deinit_vpci(struct acrn_vm *vm) /** * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL - * @pre vdev->vpci->vm->iommu != NULL + * @pre vpci2vm(vdev->vpci)->iommu != NULL */ static void assign_vdev_pt_iommu_domain(struct pci_vdev *vdev) { @@ -317,8 +316,7 @@ static void assign_vdev_pt_iommu_domain(struct pci_vdev *vdev) /** * @pre vdev != NULL * @pre vdev->vpci != NULL - * @pre vdev->vpci->vm != NULL - * @pre vdev->vpci->vm->iommu != NULL + * @pre vpci2vm(vdev->vpci)->iommu != NULL */ static void remove_vdev_pt_iommu_domain(const struct pci_vdev *vdev) { @@ -351,7 +349,6 @@ static void remove_vdev_pt_iommu_domain(const struct pci_vdev *vdev) * @param bdf Indicate the vdev's BDF * * @pre vpci != NULL - * @pre vpci->vm != NULL * * @return Return a available vdev instance, otherwise return NULL */