search for: virtio_iommu_probe_resv_mem

Displaying 20 results from an estimated 37 matches for "virtio_iommu_probe_resv_mem".

2018 Jun 22
1
[PATCH v2 3/5] iommu/virtio: Add probe request
...mu->probe_size - tail_size; > + > return len - tail_size; > } > > @@ -404,6 +410,103 @@ static int viommu_replay_mappings(struct viommu_domain *vdomain) > return ret; > } > > +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > + struct virtio_iommu_probe_resv_mem *mem, > + size_t len) > +{ > + struct iommu_resv_region *region = NULL; > + unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; > + > + u64 start = le64_to_cpu(mem->start); > + u64 end = le64_to_cpu(mem->end); > + size_t size = end - start + 1; >...
2018 Nov 08
1
[PATCH v3 6/7] iommu/virtio: Add probe request
...mu->probe_size - tail_size; > + > return len - tail_size; > } > > @@ -414,6 +420,101 @@ static int viommu_replay_mappings(struct viommu_domain *vdomain) > return ret; > } > > +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > + struct virtio_iommu_probe_resv_mem *mem, > + size_t len) > +{ > + struct iommu_resv_region *region = NULL; > + unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; > + > + u64 start = le64_to_cpu(mem->start); > + u64 end = le64_to_cpu(mem->end); > + size_t size = end - start + 1; >...
2018 Nov 15
1
[PATCH v3 6/7] iommu/virtio: Add probe request
...mu->probe_size - tail_size; > + > return len - tail_size; > } > > @@ -414,6 +420,101 @@ static int viommu_replay_mappings(struct viommu_domain *vdomain) > return ret; > } > > +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > + struct virtio_iommu_probe_resv_mem *mem, > + size_t len) > +{ > + struct iommu_resv_region *region = NULL; > + unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; > + nit: extra void line > + u64 start = le64_to_cpu(mem->start); > + u64 end = le64_to_cpu(mem->end); > + size_t size = e...
2018 Jan 16
1
[RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request
...t;probe) + *bottom; > + break; > default: > return -EINVAL; > } > @@ -448,6 +454,106 @@ static int viommu_replay_mappings(struct viommu_domain *vdomain) > return ret; > } > > +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > + struct virtio_iommu_probe_resv_mem *mem, > + size_t len) > +{ > + struct iommu_resv_region *region = NULL; > + unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; > + > + u64 addr = le64_to_cpu(mem->addr); > + u64 size = le64_to_cpu(mem->size); > + > + if (len < sizeof(*mem)) &g...
2020 May 12
1
[PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint
...u64 pgsize_bitmap = le64_to_cpu(mask->pgsize_bitmap); > + > + if (len < sizeof(*mask)) > + return -EINVAL; > + > + vdev->pgsize_bitmap = pgsize_bitmap; > + return 0; > +} > + > static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > struct virtio_iommu_probe_resv_mem *mem, > size_t len) > @@ -499,6 +513,9 @@ static int viommu_probe_endpoint(struct viommu_dev *viommu, struct device *dev) > case VIRTIO_IOMMU_PROBE_T_RESV_MEM: > ret = viommu_add_resv_mem(vdev, (void *)prop, len); > break; > + case VIRTIO_IOMMU_PROBE_T_PAGE_...
2018 Oct 12
0
[PATCH v3 6/7] iommu/virtio: Add probe request
...type == VIRTIO_IOMMU_T_PROBE) + return len - viommu->probe_size - tail_size; + return len - tail_size; } @@ -414,6 +420,101 @@ static int viommu_replay_mappings(struct viommu_domain *vdomain) return ret; } +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, + struct virtio_iommu_probe_resv_mem *mem, + size_t len) +{ + struct iommu_resv_region *region = NULL; + unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; + + u64 start = le64_to_cpu(mem->start); + u64 end = le64_to_cpu(mem->end); + size_t size = end - start + 1; + + if (len < sizeof(*mem)) + return -EIN...
2018 Jun 21
0
[PATCH v2 3/5] iommu/virtio: Add probe request
...type == VIRTIO_IOMMU_T_PROBE) + return len - viommu->probe_size - tail_size; + return len - tail_size; } @@ -404,6 +410,103 @@ static int viommu_replay_mappings(struct viommu_domain *vdomain) return ret; } +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, + struct virtio_iommu_probe_resv_mem *mem, + size_t len) +{ + struct iommu_resv_region *region = NULL; + unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; + + u64 start = le64_to_cpu(mem->start); + u64 end = le64_to_cpu(mem->end); + size_t size = end - start + 1; + + if (len < sizeof(*mem)) + return -EIN...
2018 Nov 15
0
[PATCH v4 6/7] iommu/virtio: Add probe request
...type == VIRTIO_IOMMU_T_PROBE) + return len - viommu->probe_size - tail_size; + return len - tail_size; } @@ -394,6 +400,110 @@ static int viommu_replay_mappings(struct viommu_domain *vdomain) return ret; } +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, + struct virtio_iommu_probe_resv_mem *mem, + size_t len) +{ + size_t size; + u64 start64, end64; + phys_addr_t start, end; + struct iommu_resv_region *region = NULL; + unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; + + start = start64 = le64_to_cpu(mem->start); + end = end64 = le64_to_cpu(mem->end); + siz...
2018 Feb 14
0
[PATCH 2/4] iommu/virtio: Add probe request
...om += viommu->probe_size; + size = sizeof(r->probe) + *bottom; + break; default: return -EINVAL; } @@ -448,6 +454,105 @@ static int viommu_replay_mappings(struct viommu_domain *vdomain) return ret; } +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, + struct virtio_iommu_probe_resv_mem *mem, + size_t len) +{ + struct iommu_resv_region *region = NULL; + unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; + + u64 addr = le64_to_cpu(mem->addr); + u64 size = le64_to_cpu(mem->size); + + if (len < sizeof(*mem)) + return -EINVAL; + + switch (mem->subtype)...
2017 Nov 17
0
[RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request
...om += viommu->probe_size; + size = sizeof(r->probe) + *bottom; + break; default: return -EINVAL; } @@ -448,6 +454,106 @@ static int viommu_replay_mappings(struct viommu_domain *vdomain) return ret; } +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, + struct virtio_iommu_probe_resv_mem *mem, + size_t len) +{ + struct iommu_resv_region *region = NULL; + unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; + + u64 addr = le64_to_cpu(mem->addr); + u64 size = le64_to_cpu(mem->size); + + if (len < sizeof(*mem)) + return -EINVAL; + + switch (mem->subtype)...
2018 Mar 23
1
[PATCH 2/4] iommu/virtio: Add probe request
...e) + *bottom; > + break; > default: > return -EINVAL; > } > @@ -448,6 +454,105 @@ static int viommu_replay_mappings(struct viommu_domain *vdomain) > return ret; > } > > +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > + struct virtio_iommu_probe_resv_mem *mem, > + size_t len) > +{ > + struct iommu_resv_region *region = NULL; > + unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; > + > + u64 addr = le64_to_cpu(mem->addr); > + u64 size = le64_to_cpu(mem->size); > + > + if (len < sizeof(*mem)) &g...
2020 Apr 01
2
[RFC PATCH v2] iommu/virtio: Use page size bitmap supported by endpoint
...64 pgsize_bitmap = le64_to_cpu(mask->pgsize_bitmap); > + > + if (len < sizeof(*mask)) > + return -EINVAL; > + > + vdev->pgsize_bitmap = pgsize_bitmap; > + return 0; > +} > + > static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > struct virtio_iommu_probe_resv_mem *mem, > size_t len) > @@ -494,11 +509,13 @@ static int viommu_probe_endpoint(struct viommu_dev *viommu, struct device *dev) > while (type != VIRTIO_IOMMU_PROBE_T_NONE && > cur < viommu->probe_size) { > len = le16_to_cpu(prop->length) + si...
2018 Jan 16
2
[RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request
...t;probe) + *bottom; > + break; > default: > return -EINVAL; > } > @@ -448,6 +454,106 @@ static int viommu_replay_mappings(struct viommu_domain *vdomain) > return ret; > } > > +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > + struct virtio_iommu_probe_resv_mem *mem, > + size_t len) > +{ > + struct iommu_resv_region *region = NULL; > + unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; > + > + u64 addr = le64_to_cpu(mem->addr); > + u64 size = le64_to_cpu(mem->size); > + > + if (len < sizeof(*mem)) &g...
2018 Jan 16
2
[RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request
...t;probe) + *bottom; > + break; > default: > return -EINVAL; > } > @@ -448,6 +454,106 @@ static int viommu_replay_mappings(struct viommu_domain *vdomain) > return ret; > } > > +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > + struct virtio_iommu_probe_resv_mem *mem, > + size_t len) > +{ > + struct iommu_resv_region *region = NULL; > + unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; > + > + u64 addr = le64_to_cpu(mem->addr); > + u64 size = le64_to_cpu(mem->size); > + > + if (len < sizeof(*mem)) &g...
2020 May 06
1
[PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint
...ch of code like e.g. this: pg_size = 1UL << __ffs(pgsize_bitmap); which probably won't DTRT on a 32 bit guest if the bitmap has bits set in the high word. > + return 0; > +} > + > static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > struct virtio_iommu_probe_resv_mem *mem, > size_t len) > @@ -499,6 +513,9 @@ static int viommu_probe_endpoint(struct viommu_dev *viommu, struct device *dev) > case VIRTIO_IOMMU_PROBE_T_RESV_MEM: > ret = viommu_add_resv_mem(vdev, (void *)prop, len); > break; > + case VIRTIO_IOMMU_PROBE_T_PAGE_...
2020 May 07
2
[EXT] Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint
...And spec does not make this illegal at all so it looks like we actually need to handle this gracefully. > > > > > > > + return 0; > > > +} > > > + > > > static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > > > struct virtio_iommu_probe_resv_mem *mem, > > > size_t len) > > > @@ -499,6 +513,9 @@ static int viommu_probe_endpoint(struct viommu_dev > > *viommu, struct device *dev) > > > case VIRTIO_IOMMU_PROBE_T_RESV_MEM: > > > ret = viommu_add_resv_mem(vdev, (void *)prop, len); >...
2020 May 07
0
[EXT] Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint
...gt; word. >> > > My thought is that in that case viommu_domain_finalise() will fail, do not proceed. > >> >> >>> + return 0; >>> +} >>> + >>> static int viommu_add_resv_mem(struct viommu_endpoint *vdev, >>> struct virtio_iommu_probe_resv_mem *mem, >>> size_t len) >>> @@ -499,6 +513,9 @@ static int viommu_probe_endpoint(struct viommu_dev >> *viommu, struct device *dev) >>> case VIRTIO_IOMMU_PROBE_T_RESV_MEM: >>> ret = viommu_add_resv_mem(vdev, (void *)prop, len); >>>...
2020 May 07
0
[EXT] Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint
...llegal at all > so it looks like we actually need to handle this gracefully. > > >>> >>> >>>> + return 0; >>>> +} >>>> + >>>> static int viommu_add_resv_mem(struct viommu_endpoint *vdev, >>>> struct virtio_iommu_probe_resv_mem *mem, >>>> size_t len) >>>> @@ -499,6 +513,9 @@ static int viommu_probe_endpoint(struct viommu_dev >>> *viommu, struct device *dev) >>>> case VIRTIO_IOMMU_PROBE_T_RESV_MEM: >>>> ret = viommu_add_resv_mem(vdev, (void *)prop,...
2018 Oct 12
18
[PATCH v3 0/7] Add virtio-iommu driver
Implement the virtio-iommu driver, following specification v0.8 [1]. Changes since v2 [2]: * Patches 2-4 allow virtio-iommu to use the PCI transport, since QEMU would like to phase out the MMIO transport. This produces a complex topology where the programming interface of the IOMMU could appear lower than the endpoints that it translates. It's not unheard of (e.g. AMD IOMMU), and the
2018 Oct 12
18
[PATCH v3 0/7] Add virtio-iommu driver
Implement the virtio-iommu driver, following specification v0.8 [1]. Changes since v2 [2]: * Patches 2-4 allow virtio-iommu to use the PCI transport, since QEMU would like to phase out the MMIO transport. This produces a complex topology where the programming interface of the IOMMU could appear lower than the endpoints that it translates. It's not unheard of (e.g. AMD IOMMU), and the