search for: virtio_iommu_map_f_mmio

Displaying 20 results from an estimated 38 matches for "virtio_iommu_map_f_mmio".

2019 Jul 22
3
[PATCH] iommu/virtio: Update to most recent specification
...nt flags; + u32 flags; struct virtio_iommu_req_map map; struct viommu_domain *vdomain = to_viommu_domain(domain); @@ -718,6 +724,9 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); + if (flags & ~vdomain->map_flags) + return -EINVAL; + ret = viommu_add_mapping(vdomain, iova, paddr, size, flags); if (ret) return ret; @@ -1027,7 +1036,8 @@ static int viommu_probe(struct virtio_device *vdev) goto err_free_vqs; } - viommu->domain_bits = 32; + viom...
2019 Jul 22
3
[PATCH] iommu/virtio: Update to most recent specification
...nt flags; + u32 flags; struct virtio_iommu_req_map map; struct viommu_domain *vdomain = to_viommu_domain(domain); @@ -718,6 +724,9 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); + if (flags & ~vdomain->map_flags) + return -EINVAL; + ret = viommu_add_mapping(vdomain, iova, paddr, size, flags); if (ret) return ret; @@ -1027,7 +1036,8 @@ static int viommu_probe(struct virtio_device *vdev) goto err_free_vqs; } - viommu->domain_bits = 32; + viom...
2019 Jul 22
0
[PATCH] iommu/virtio: Update to most recent specification
...struct virtio_iommu_req_map map; > struct viommu_domain *vdomain = to_viommu_domain(domain); > > @@ -718,6 +724,9 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, > (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | > (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); > > + if (flags & ~vdomain->map_flags) > + return -EINVAL; > + > ret = viommu_add_mapping(vdomain, iova, paddr, size, flags); > if (ret) > return ret; > @@ -1027,7 +1036,8 @@ static int viommu_probe(struct virtio_device *vdev) > goto err_free_vqs...
2019 Jul 22
0
[PATCH] iommu/virtio: Update to most recent specification
...struct virtio_iommu_req_map map; > struct viommu_domain *vdomain = to_viommu_domain(domain); > > @@ -718,6 +724,9 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, > (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | > (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); > > + if (flags & ~vdomain->map_flags) > + return -EINVAL; > + > ret = viommu_add_mapping(vdomain, iova, paddr, size, flags); > if (ret) > return ret; > @@ -1027,7 +1036,8 @@ static int viommu_probe(struct virtio_device *vdev) > goto err_free_vqs...
2018 Jun 13
0
[RFC] virtio-iommu version 0.7
...of operations may add some complexity in the host +implementation. To setup MSIs, the guest writes an IOVA into the MSI-X +table of the PCI endpoint. One possible host implementation emulates IRQ +chips and captures requests that map virtual addresses to doorbell +registers. These requests have the VIRTIO_IOMMU_MAP_F_MMIO flag set, +making them easy to differentiate from requests that target normal memory +and are forwarded to the physical IOMMU driver. The host also traps +accesses to the endpoint's MSI-X table, and creates IRQ routes by +translating the written IOVA into the corresponding doorbell. \subsubs...
2019 Feb 21
1
[PATCH v7 0/7] Add virtio-iommu driver
...end doesn?t fit in the range described by input_range, the device MAY set status to VIRTIO_- IOMMU_S_RANGE and ignore the request. Shouldn't int say "If the VIRTIO_IOMMU_F_INPUT_RANGE feature is negotiated" instead? 2. There's a typo at the end of section 2.6.5: The VIRTIO_IOMMU_MAP_F_MMIO flag is a memory type rather than a protection lag. s/lag/flag/ 3. In section 3.1.2.1.1, the viommu compatible field says "virtio,mmio". Shouldn't it say "virtio,mmio-iommu" instead, to be consistent with "virtio,pci-iommu"? 4. There's a typo in section...
2019 Feb 21
1
[PATCH v7 0/7] Add virtio-iommu driver
...end doesn?t fit in the range described by input_range, the device MAY set status to VIRTIO_- IOMMU_S_RANGE and ignore the request. Shouldn't int say "If the VIRTIO_IOMMU_F_INPUT_RANGE feature is negotiated" instead? 2. There's a typo at the end of section 2.6.5: The VIRTIO_IOMMU_MAP_F_MMIO flag is a memory type rather than a protection lag. s/lag/flag/ 3. In section 3.1.2.1.1, the viommu compatible field says "virtio,mmio". Shouldn't it say "virtio,mmio-iommu" instead, to be consistent with "virtio,pci-iommu"? 4. There's a typo in section...
2019 May 30
0
[PATCH v8 5/7] iommu: Add virtio-iommu driver
...ze_t size, int prot) +{ + int ret; + u32 flags; + struct virtio_iommu_req_map map; + struct viommu_domain *vdomain = to_viommu_domain(domain); + + flags = (prot & IOMMU_READ ? VIRTIO_IOMMU_MAP_F_READ : 0) | + (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | + (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); + + if (flags & ~vdomain->map_flags) + return -EINVAL; + + ret = viommu_add_mapping(vdomain, iova, paddr, size, flags); + if (ret) + return ret; + + map = (struct virtio_iommu_req_map) { + .head.type = VIRTIO_IOMMU_T_MAP, + .domain = cpu_to_le32(vdomain->id), + .virt_start = c...
2018 Oct 12
3
[PATCH v3 5/7] iommu: Add virtio-iommu driver
...mapping *mapping; > + struct virtio_iommu_req_map map; > + struct viommu_domain *vdomain = to_viommu_domain(domain); > + > + flags = (prot & IOMMU_READ ? VIRTIO_IOMMU_MAP_F_READ : 0) | > + (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | > + (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); > + > + mapping = viommu_add_mapping(vdomain, iova, paddr, size, flags); > + if (!mapping) > + return -ENOMEM; > + > + map = (struct virtio_iommu_req_map) { > + .head.type = VIRTIO_IOMMU_T_MAP, > + .domain = cpu_to_le32(vdomain->id), > + .virt_start = cpu_to...
2018 Oct 12
3
[PATCH v3 5/7] iommu: Add virtio-iommu driver
...mapping *mapping; > + struct virtio_iommu_req_map map; > + struct viommu_domain *vdomain = to_viommu_domain(domain); > + > + flags = (prot & IOMMU_READ ? VIRTIO_IOMMU_MAP_F_READ : 0) | > + (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | > + (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); > + > + mapping = viommu_add_mapping(vdomain, iova, paddr, size, flags); > + if (!mapping) > + return -ENOMEM; > + > + map = (struct virtio_iommu_req_map) { > + .head.type = VIRTIO_IOMMU_T_MAP, > + .domain = cpu_to_le32(vdomain->id), > + .virt_start = cpu_to...
2018 Nov 22
0
[PATCH v5 5/7] iommu: Add virtio-iommu driver
...ze_t size, int prot) +{ + int ret; + int flags; + struct virtio_iommu_req_map map; + struct viommu_domain *vdomain = to_viommu_domain(domain); + + flags = (prot & IOMMU_READ ? VIRTIO_IOMMU_MAP_F_READ : 0) | + (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | + (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); + + ret = viommu_add_mapping(vdomain, iova, paddr, size, flags); + if (ret) + return ret; + + map = (struct virtio_iommu_req_map) { + .head.type = VIRTIO_IOMMU_T_MAP, + .domain = cpu_to_le32(vdomain->id), + .virt_start = cpu_to_le64(iova), + .phys_start = cpu_to_le64(paddr), + .virt...
2018 Nov 15
0
[PATCH v4 5/7] iommu: Add virtio-iommu driver
...+ int flags; + struct viommu_mapping *mapping; + struct virtio_iommu_req_map map; + struct viommu_domain *vdomain = to_viommu_domain(domain); + + flags = (prot & IOMMU_READ ? VIRTIO_IOMMU_MAP_F_READ : 0) | + (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | + (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); + + mapping = viommu_add_mapping(vdomain, iova, paddr, size, flags); + if (!mapping) + return -ENOMEM; + + map = (struct virtio_iommu_req_map) { + .head.type = VIRTIO_IOMMU_T_MAP, + .domain = cpu_to_le32(vdomain->id), + .virt_start = cpu_to_le64(iova), + .phys_start = cpu_to_le64(pad...
2018 Jun 21
0
[PATCH v2 2/5] iommu: Add virtio-iommu driver
...+ int flags; + struct viommu_mapping *mapping; + struct virtio_iommu_req_map map; + struct viommu_domain *vdomain = to_viommu_domain(domain); + + flags = (prot & IOMMU_READ ? VIRTIO_IOMMU_MAP_F_READ : 0) | + (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | + (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); + + mapping = viommu_add_mapping(vdomain, iova, paddr, size, flags); + if (!mapping) + return -ENOMEM; + + map = (struct virtio_iommu_req_map) { + .head.type = VIRTIO_IOMMU_T_MAP, + .domain = cpu_to_le32(vdomain->id), + .virt_start = cpu_to_le64(iova), + .phys_start = cpu_to_le64(pad...
2018 Oct 12
0
[PATCH v3 5/7] iommu: Add virtio-iommu driver
...+ int flags; + struct viommu_mapping *mapping; + struct virtio_iommu_req_map map; + struct viommu_domain *vdomain = to_viommu_domain(domain); + + flags = (prot & IOMMU_READ ? VIRTIO_IOMMU_MAP_F_READ : 0) | + (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | + (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); + + mapping = viommu_add_mapping(vdomain, iova, paddr, size, flags); + if (!mapping) + return -ENOMEM; + + map = (struct virtio_iommu_req_map) { + .head.type = VIRTIO_IOMMU_T_MAP, + .domain = cpu_to_le32(vdomain->id), + .virt_start = cpu_to_le64(iova), + .phys_start = cpu_to_le64(pad...
2018 Nov 08
0
[PATCH v3 5/7] iommu: Add virtio-iommu driver
...t; + struct virtio_iommu_req_map map; >> + struct viommu_domain *vdomain = to_viommu_domain(domain); >> + >> + flags = (prot & IOMMU_READ ? VIRTIO_IOMMU_MAP_F_READ : 0) | >> + (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | >> + (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); >> + >> + mapping = viommu_add_mapping(vdomain, iova, paddr, size, flags); >> + if (!mapping) >> + return -ENOMEM; >> + >> + map = (struct virtio_iommu_req_map) { >> + .head.type = VIRTIO_IOMMU_T_MAP, >> + .domain = cpu_to_le32(vdomain->i...
2019 May 30
10
[PATCH v8 0/7] Add virtio-iommu driver
Implement the virtio-iommu driver, following specification v0.12 [1]. Since last version [2] we've worked on improving the specification, which resulted in the following changes to the interface: * Remove the EXEC flag. * Add feature bit for the MMIO flag. * Change domain_bits to domain_range. Given that there were small changes to patch 5/7, I removed the review and test tags. Please find
2018 Nov 23
2
[PATCH v5 5/7] iommu: Add virtio-iommu driver
...> + int flags; > + struct virtio_iommu_req_map map; > + struct viommu_domain *vdomain = to_viommu_domain(domain); > + > + flags = (prot & IOMMU_READ ? VIRTIO_IOMMU_MAP_F_READ : 0) | > + (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | > + (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); > + > + ret = viommu_add_mapping(vdomain, iova, paddr, size, flags); > + if (ret) > + return ret; > + > + map = (struct virtio_iommu_req_map) { > + .head.type = VIRTIO_IOMMU_T_MAP, > + .domain = cpu_to_le32(vdomain->id), > + .virt_start = cpu_to_le64(iova),...
2018 Nov 23
2
[PATCH v5 5/7] iommu: Add virtio-iommu driver
...> + int flags; > + struct virtio_iommu_req_map map; > + struct viommu_domain *vdomain = to_viommu_domain(domain); > + > + flags = (prot & IOMMU_READ ? VIRTIO_IOMMU_MAP_F_READ : 0) | > + (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | > + (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); > + > + ret = viommu_add_mapping(vdomain, iova, paddr, size, flags); > + if (ret) > + return ret; > + > + map = (struct virtio_iommu_req_map) { > + .head.type = VIRTIO_IOMMU_T_MAP, > + .domain = cpu_to_le32(vdomain->id), > + .virt_start = cpu_to_le64(iova),...
2018 Nov 22
15
[PATCH v5 0/7] Add virtio-iommu driver
Implement the virtio-iommu driver, following specification v0.9 [1]. Since v4 [2] I fixed the issues reported by Eric, and added Reviewed-by from Eric and Rob. Thanks! I changed the specification to fix one inconsistency discussed in v4. That the device fills the probe buffer with zeroes is now a "SHOULD" instead of a "MAY", since it's the only way for the driver to know
2018 Nov 22
15
[PATCH v5 0/7] Add virtio-iommu driver
Implement the virtio-iommu driver, following specification v0.9 [1]. Since v4 [2] I fixed the issues reported by Eric, and added Reviewed-by from Eric and Rob. Thanks! I changed the specification to fix one inconsistency discussed in v4. That the device fills the probe buffer with zeroes is now a "SHOULD" instead of a "MAY", since it's the only way for the driver to know