Home
last modified time | relevance | path

Searched full:viommu (Results 1 – 19 of 19) sorted by relevance

/linux/drivers/iommu/iommufd/
H A Dviommu.c8 struct iommufd_viommu *viommu = in iommufd_viommu_destroy() local
11 if (viommu->ops && viommu->ops->destroy) in iommufd_viommu_destroy()
12 viommu->ops->destroy(viommu); in iommufd_viommu_destroy()
13 refcount_dec(&viommu->hwpt->common.obj.users); in iommufd_viommu_destroy()
14 xa_destroy(&viommu->vdevs); in iommufd_viommu_destroy()
26 struct iommufd_viommu *viommu; in iommufd_viommu_alloc_ioctl() local
53 * vIOMMU structure size in iommufd_viommu_alloc_ioctl()
55 if (WARN_ON_ONCE(viommu_size < sizeof(*viommu))) { in iommufd_viommu_alloc_ioctl()
71 viommu = (struct iommufd_viommu *)_iommufd_object_alloc_ucmd( in iommufd_viommu_alloc_ioctl()
73 if (IS_ERR(viommu)) { in iommufd_viommu_alloc_ioctl()
[all …]
H A Deventq.c226 struct iommufd_viommu *viommu = veventq->viommu; in iommufd_veventq_abort() local
229 lockdep_assert_held_write(&viommu->veventqs_rwsem); in iommufd_veventq_abort()
237 refcount_dec(&viommu->obj.users); in iommufd_veventq_abort()
246 down_write(&veventq->viommu->veventqs_rwsem); in iommufd_veventq_destroy()
248 up_write(&veventq->viommu->veventqs_rwsem); in iommufd_veventq_destroy()
479 struct iommufd_viommu *viommu; in iommufd_veventq_alloc() local
489 viommu = iommufd_get_viommu(ucmd, cmd->viommu_id); in iommufd_veventq_alloc()
490 if (IS_ERR(viommu)) in iommufd_veventq_alloc()
491 return PTR_ERR(viommu); in iommufd_veventq_alloc()
493 down_write(&viommu->veventqs_rwsem); in iommufd_veventq_alloc()
[all …]
H A Ddriver.c92 /* Caller should xa_lock(&viommu->vdevs) to protect the return value */
93 struct device *iommufd_viommu_find_dev(struct iommufd_viommu *viommu, in iommufd_viommu_find_dev() argument
98 lockdep_assert_held(&viommu->vdevs.xa_lock); in iommufd_viommu_find_dev()
100 vdev = xa_load(&viommu->vdevs, vdev_id); in iommufd_viommu_find_dev()
105 /* Return -ENOENT if device is not associated to the vIOMMU */
106 int iommufd_viommu_get_vdev_id(struct iommufd_viommu *viommu, in iommufd_viommu_get_vdev_id() argument
116 xa_lock(&viommu->vdevs); in iommufd_viommu_get_vdev_id()
117 xa_for_each(&viommu->vdevs, index, vdev) { in iommufd_viommu_get_vdev_id()
124 xa_unlock(&viommu->vdevs); in iommufd_viommu_get_vdev_id()
133 int iommufd_viommu_report_event(struct iommufd_viommu *viommu, in iommufd_viommu_report_event() argument
[all …]
H A Dselftest.c154 static inline struct mock_viommu *to_mock_viommu(struct iommufd_viommu *viommu) in to_mock_viommu() argument
156 return container_of(viommu, struct mock_viommu, core); in to_mock_viommu()
178 struct mock_viommu *viommu; member
233 if (new_viommu != mdev->viommu) { in mock_domain_nop_attach()
235 mdev->viommu = new_viommu; in mock_domain_nop_attach()
628 static void mock_viommu_destroy(struct iommufd_viommu *viommu) in mock_viommu_destroy() argument
631 viommu->iommu_dev, struct mock_iommu_device, iommu_dev); in mock_viommu_destroy()
632 struct mock_viommu *mock_viommu = to_mock_viommu(viommu); in mock_viommu_destroy()
642 /* iommufd core frees mock_viommu and viommu */ in mock_viommu_destroy()
646 mock_viommu_alloc_domain_nested(struct iommufd_viommu *viommu, u32 flags, in mock_viommu_alloc_domain_nested() argument
[all …]
H A Diommufd_test.h250 * struct iommu_viommu_selftest - vIOMMU data for Mock driver
271 * struct iommu_viommu_invalidate_selftest - Invalidation data for Mock VIOMMU
H A Dmain.c434 struct iommu_viommu_alloc viommu; member
/linux/drivers/iommu/
H A Dvirtio-iommu.c65 struct viommu_dev *viommu; member
77 struct viommu_dev *viommu; member
137 static off_t viommu_get_write_desc_offset(struct viommu_dev *viommu, in viommu_get_write_desc_offset() argument
144 return len - viommu->probe_size - tail_size; in viommu_get_write_desc_offset()
155 static int __viommu_sync_req(struct viommu_dev *viommu) in __viommu_sync_req() argument
160 struct virtqueue *vq = viommu->vqs[VIOMMU_REQUEST_VQ]; in __viommu_sync_req()
162 assert_spin_locked(&viommu->request_lock); in __viommu_sync_req()
166 while (!list_empty(&viommu->requests)) { in __viommu_sync_req()
188 static int viommu_sync_req(struct viommu_dev *viommu) in viommu_sync_req() argument
193 spin_lock_irqsave(&viommu->request_lock, flags); in viommu_sync_req()
[all …]
/linux/drivers/acpi/
H A Dviot.c48 struct viot_iommu *viommu; member
77 static int __init viot_get_pci_iommu_fwnode(struct viot_iommu *viommu, in viot_get_pci_iommu_fwnode() argument
103 viommu->fwnode = dev_fwnode(&pdev->dev); in viot_get_pci_iommu_fwnode()
108 static int __init viot_get_mmio_iommu_fwnode(struct viot_iommu *viommu, in viot_get_mmio_iommu_fwnode() argument
123 viommu->fwnode = &adev->fwnode; in viot_get_mmio_iommu_fwnode()
130 struct viot_iommu *viommu; in viot_get_iommu() local
138 list_for_each_entry(viommu, &viot_iommus, list) in viot_get_iommu()
139 if (viommu->offset == offset) in viot_get_iommu()
140 return viommu; in viot_get_iommu()
145 viommu = kzalloc_obj(*viommu); in viot_get_iommu()
[all …]
/linux/Documentation/userspace-api/
H A Diommufd.rst85 Such a vIOMMU object generally has the access to a nesting parent pagetable
86 to support some HW-accelerated virtualization features. So, a vIOMMU object
88 encapsulate that HWPT_PAGING object. Therefore, a vIOMMU object can be used
93 The name "vIOMMU" isn't necessarily identical to a virtualized IOMMU in a
97 vIOMMU objects created for individual slices of different physical IOMMUs.
98 In other words, a vIOMMU object is always a representation of one physical
103 backed by corresponding vIOMMU objects, in which case a guest OS would do
108 information or attributes (related to the vIOMMU) in a VM. An immediate vDATA
109 example can be the virtual ID of the device on a vIOMMU, which is a unique ID
110 that VMM assigns to the device for a translation channel/port of the vIOMMU,
[all …]
/linux/drivers/iommu/amd/
H A Diommufd.c40 int amd_iommufd_viommu_init(struct iommufd_viommu *viommu, struct iommu_domain *parent, in amd_iommufd_viommu_init() argument
45 struct amd_iommu_viommu *aviommu = container_of(viommu, struct amd_iommu_viommu, core); in amd_iommufd_viommu_init()
50 viommu->ops = &amd_viommu_ops; in amd_iommufd_viommu_init()
59 static void amd_iommufd_viommu_destroy(struct iommufd_viommu *viommu) in amd_iommufd_viommu_destroy() argument
62 struct amd_iommu_viommu *aviommu = container_of(viommu, struct amd_iommu_viommu, core); in amd_iommufd_viommu_destroy()
73 * struct iommufd_viommu_ops - vIOMMU specific operations
H A Dnested.c94 amd_iommu_alloc_domain_nested(struct iommufd_viommu *viommu, u32 flags, in amd_iommu_alloc_domain_nested() argument
100 struct amd_iommu_viommu *aviommu = container_of(viommu, struct amd_iommu_viommu, core); in amd_iommu_alloc_domain_nested()
122 ndom->viommu = aviommu; in amd_iommu_alloc_domain_nested()
133 * cache tags of (DomID, PASID). Within a single viommu, the nest parent domain in amd_iommu_alloc_domain_nested()
135 * to a single hDomID. This is done using an xarray in the vIOMMU to in amd_iommu_alloc_domain_nested()
199 if (WARN_ON(!ndom->viommu || !ndom->viommu->parent)) in set_dte_nested()
202 parent = ndom->viommu->parent; in set_dte_nested()
262 struct amd_iommu_viommu *aviommu = ndom->viommu; in nested_domain_free()
H A Damd_iommu.h223 amd_iommu_alloc_domain_nested(struct iommufd_viommu *viommu, u32 flags,
H A Diommu.c1782 * When NpCache is on, we infer that we run in a VM and use a vIOMMU. in amd_iommu_domain_flush_pages()
/linux/drivers/iommu/arm/arm-smmu-v3/
H A Darm-smmu-v3-iommufd.c243 arm_vsmmu_alloc_domain_nested(struct iommufd_viommu *viommu, u32 flags, in arm_vsmmu_alloc_domain_nested() argument
246 struct arm_vsmmu *vsmmu = container_of(viommu, struct arm_vsmmu, core); in arm_vsmmu_alloc_domain_nested()
353 int arm_vsmmu_cache_invalidate(struct iommufd_viommu *viommu, in arm_vsmmu_cache_invalidate() argument
356 struct arm_vsmmu *vsmmu = container_of(viommu, struct arm_vsmmu, core); in arm_vsmmu_cache_invalidate()
445 int arm_vsmmu_init(struct iommufd_viommu *viommu, in arm_vsmmu_init() argument
449 struct arm_vsmmu *vsmmu = container_of(viommu, struct arm_vsmmu, core); in arm_vsmmu_init()
451 container_of(viommu->iommu_dev, struct arm_smmu_device, iommu); in arm_vsmmu_init()
462 if (viommu->type == IOMMU_VIOMMU_TYPE_ARM_SMMUV3) { in arm_vsmmu_init()
463 viommu->ops = &arm_vsmmu_ops; in arm_vsmmu_init()
H A Dtegra241-cmdqv.c298 struct iommufd_viommu *viommu = &vintf->vsmmu.core; in tegra241_vintf_user_handle_error() local
308 iommufd_viommu_report_event(viommu, IOMMU_VEVENTQ_TYPE_TEGRA241_CMDQV, in tegra241_vintf_user_handle_error()
775 /* Guest-owned VINTF is free-ed with viommu by iommufd core */ in tegra241_cmdqv_remove_vintf()
1009 static size_t tegra241_vintf_get_vcmdq_size(struct iommufd_viommu *viommu, in tegra241_vintf_get_vcmdq_size() argument
1051 struct tegra241_vintf *vintf = viommu_to_vintf(hw_queue->viommu); in tegra241_vintf_alloc_lvcmdq_user()
1147 static void tegra241_cmdqv_destroy_vintf_user(struct iommufd_viommu *viommu) in tegra241_cmdqv_destroy_vintf_user() argument
1149 struct tegra241_vintf *vintf = viommu_to_vintf(viommu); in tegra241_cmdqv_destroy_vintf_user()
1174 struct tegra241_vintf *vintf = viommu_to_vintf(vdev->viommu); in tegra241_vintf_init_vsid()
/linux/include/uapi/linux/
H A Diommufd.h496 * @pt_id: The IOAS or HWPT or vIOMMU to connect this HWPT to
515 * A user-managed nested HWPT will be created from a given vIOMMU (wrapping a
520 * via @dev_id and the vIOMMU via @pt_id must be associated to the same IOMMU
653 * for HW-vIOMMU.
894 * Supported command list only when passing in a vIOMMU via @hwpt_id:
913 * @hwpt_id: ID of a nested HWPT or a vIOMMU, for cache invalidation
924 * Invalidate iommu cache for user-managed page table or vIOMMU. Modifications
927 * cache can be flushed if a vIOMMU is passed in via the @hwpt_id field.
1089 * to the vIOMMU, such as:
1114 * @viommu_id: vIOMMU I
[all...]
/linux/Documentation/devicetree/bindings/virtio/
H A Dmmio.yaml56 iommus = <&viommu 23>;
59 viommu: iommu@3100 {
/linux/tools/testing/selftests/iommu/
H A Diommufd.c2786 unsigned int viommu; in FIXTURE_VARIANT() local
2796 if (variant->viommu) { in FIXTURE_SETUP()
2809 /* Allocate a vIOMMU taking refcount of the parent hwpt */ in FIXTURE_SETUP()
2829 .viommu = 0, in FIXTURE_VARIANT_ADD()
2834 .viommu = 1, in FIXTURE_VARIANT_ADD()
2860 /* Negative test -- unsupported viommu type */ in TEST_F()
3325 /* Allocate a regular nested hwpt based on viommu */ in TEST_F()
H A Diommufd_utils.h353 #define test_cmd_viommu_invalidate(viommu, reqs, lreq, nreqs) \ argument
356 _test_cmd_viommu_invalidate(self->fd, viommu, reqs, \