Home
last modified time | relevance | path

Searched full:viommu (Results 1 – 17 of 17) 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
59 * vIOMMU structure size in iommufd_viommu_alloc_ioctl()
61 if (WARN_ON_ONCE(viommu_size < sizeof(*viommu))) { in iommufd_viommu_alloc_ioctl()
77 viommu = (struct iommufd_viommu *)_iommufd_object_alloc_ucmd( in iommufd_viommu_alloc_ioctl()
79 if (IS_ERR(viommu)) { in iommufd_viommu_alloc_ioctl()
[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 Deventq.c235 struct iommufd_viommu *viommu = veventq->viommu; in iommufd_veventq_abort() local
238 lockdep_assert_held_write(&viommu->veventqs_rwsem); in iommufd_veventq_abort()
246 refcount_dec(&viommu->obj.users); in iommufd_veventq_abort()
255 down_write(&veventq->viommu->veventqs_rwsem); in iommufd_veventq_destroy()
257 up_write(&veventq->viommu->veventqs_rwsem); in iommufd_veventq_destroy()
508 struct iommufd_viommu *viommu; in iommufd_veventq_alloc() local
518 viommu = iommufd_get_viommu(ucmd, cmd->viommu_id); in iommufd_veventq_alloc()
519 if (IS_ERR(viommu)) in iommufd_veventq_alloc()
520 return PTR_ERR(viommu); in iommufd_veventq_alloc()
522 down_write(&viommu->veventqs_rwsem); in iommufd_veventq_alloc()
[all …]
/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.c96 amd_iommu_alloc_domain_nested(struct iommufd_viommu *viommu, u32 flags, in amd_iommu_alloc_domain_nested() argument
103 struct amd_iommu_viommu *aviommu = container_of(viommu, struct amd_iommu_viommu, core); in amd_iommu_alloc_domain_nested()
125 ndom->viommu = aviommu; in amd_iommu_alloc_domain_nested()
136 * cache tags of (DomID, PASID). Within a single viommu, the nest parent domain in amd_iommu_alloc_domain_nested()
138 * to a single hDomID. This is done using an xarray in the vIOMMU to in amd_iommu_alloc_domain_nested()
204 if (WARN_ON(!ndom->viommu || !ndom->viommu->parent)) in set_dte_nested()
207 parent = ndom->viommu->parent; in set_dte_nested()
268 struct amd_iommu_viommu *aviommu = ndom->viommu; in nested_domain_free()
H A Diommu.c1826 * 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.c246 arm_vsmmu_alloc_domain_nested(struct iommufd_viommu *viommu, u32 flags, in arm_vsmmu_alloc_domain_nested() argument
249 struct arm_vsmmu *vsmmu = container_of(viommu, struct arm_vsmmu, core); in arm_vsmmu_alloc_domain_nested()
370 int arm_vsmmu_cache_invalidate(struct iommufd_viommu *viommu, in arm_vsmmu_cache_invalidate() argument
373 struct arm_vsmmu *vsmmu = container_of(viommu, struct arm_vsmmu, core); in arm_vsmmu_cache_invalidate()
463 int arm_vsmmu_init(struct iommufd_viommu *viommu, in arm_vsmmu_init() argument
467 struct arm_vsmmu *vsmmu = container_of(viommu, struct arm_vsmmu, core); in arm_vsmmu_init()
469 container_of(viommu->iommu_dev, struct arm_smmu_device, iommu); in arm_vsmmu_init()
480 if (viommu->type == IOMMU_VIOMMU_TYPE_ARM_SMMUV3) { in arm_vsmmu_init()
481 viommu->ops = &arm_vsmmu_ops; in arm_vsmmu_init()
H A Darm-smmu-v3.h1265 int arm_vsmmu_init(struct iommufd_viommu *viommu,
1274 arm_vsmmu_alloc_domain_nested(struct iommufd_viommu *viommu, u32 flags,
1276 int arm_vsmmu_cache_invalidate(struct iommufd_viommu *viommu,
/linux/Documentation/devicetree/bindings/virtio/
H A Dmmio.yaml56 iommus = <&viommu 23>;
59 viommu: iommu@3100 {
/linux/include/linux/
H A Diommu.h672 * @get_viommu_size: Get the size of a driver-level vIOMMU structure for a given
674 * if vIOMMU isn't supported accordingly. It is required for
676 * driver-level vIOMMU structure related to the core one
678 * IOMMU instance @viommu->iommu_dev, as the set of virtualization
681 * set @viommu->ops pointing to its own viommu_ops
734 int (*viommu_init)(struct iommufd_viommu *viommu,
H A Ddma-mapping.h100 * to the vIOMMU when it sets up the IOPTE. For MMIO use together with
/linux/Documentation/core-api/
H A Ddma-attributes.rst190 semantic may be passed to a vIOMMU when it sets up the IOPTE.
/linux/tools/testing/selftests/iommu/
H A Diommufd.c2828 unsigned int viommu; in FIXTURE_VARIANT_ADD()
2838 if (variant->viommu) { in TEST_F()
2851 /* Allocate a vIOMMU taking refcount of the parent hwpt */ in TEST_F()
2871 .viommu = 0, in TEST_F()
2876 .viommu = 1, in TEST_F()
2902 /* Negative test -- unsupported viommu type */ in TEST_F()
3399 /* Allocate a regular nested hwpt based on viommu */ in TEST_F()
2786 unsigned int viommu; FIXTURE_VARIANT() local
H A Diommufd_utils.h353 #define test_cmd_viommu_invalidate(viommu, reqs, lreq, nreqs) \ argument
356 _test_cmd_viommu_invalidate(self->fd, viommu, reqs, \