search for: viommu_request

Displaying 20 results from an estimated 78 matches for "viommu_request".

2018 Feb 14
0
[PATCH 3/4] iommu/virtio: Add event queue
...diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index 3ac4b38eaf19..6b96f1b36d5a 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -30,6 +30,12 @@ #define MSI_IOVA_BASE 0x8000000 #define MSI_IOVA_LENGTH 0x100000 +enum viommu_vq_idx { + VIOMMU_REQUEST_VQ = 0, + VIOMMU_EVENT_VQ = 1, + VIOMMU_NUM_VQS = 2, +}; + struct viommu_dev { struct iommu_device iommu; struct device *dev; @@ -37,9 +43,10 @@ struct viommu_dev { struct ida domain_ids; - struct virtqueue *vq; + struct virtqueue *vqs[VIOMMU_NUM_VQS]; /* Serialize anything to...
2017 Nov 17
0
[RFC PATCH v2 3/5] iommu/virtio-iommu: Add event queue
...diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index 79e0add94e05..fe0d449bf489 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -30,6 +30,12 @@ #define MSI_IOVA_BASE 0x8000000 #define MSI_IOVA_LENGTH 0x100000 +enum viommu_vq_idx { + VIOMMU_REQUEST_VQ = 0, + VIOMMU_EVENT_VQ = 1, + VIOMMU_NUM_VQS = 2, +}; + struct viommu_dev { struct iommu_device iommu; struct device *dev; @@ -37,7 +43,7 @@ struct viommu_dev { struct ida domain_ids; - struct virtqueue *vq; + struct virtqueue *vqs[VIOMMU_NUM_VQS]; /* Serialize anything tou...
2018 Feb 14
0
[PATCH 1/4] iommu: Add virtio-iommu driver
...uct mutex mutex; + unsigned int id; + + spinlock_t mappings_lock; + struct rb_root_cached mappings; + + /* Number of endpoints attached to this domain */ + unsigned long endpoints; +}; + +struct viommu_endpoint { + struct viommu_dev *viommu; + struct viommu_domain *vdomain; +}; + +struct viommu_request { + struct scatterlist top; + struct scatterlist bottom; + + int written; + struct list_head list; +}; + +#define to_viommu_domain(domain) \ + container_of(domain, struct viommu_domain, domain) + +/* Virtio transport */ + +static int viommu_status_to_errno(u8 status) +{ + switch (status) { +...
2018 Feb 14
12
[PATCH 0/4] Add virtio-iommu driver
Implement the virtio-iommu driver following version 0.6 of the specification [1]. Previous version, RFCv2, was sent in November [2]. This version addresses Eric's comments and changes the device number. (Since last week I also tested and fixed the probe/release functions, they now use devm properly.) I did not include ACPI support because the next IORT specifications isn't ready yet (even
2018 Feb 14
12
[PATCH 0/4] Add virtio-iommu driver
Implement the virtio-iommu driver following version 0.6 of the specification [1]. Previous version, RFCv2, was sent in November [2]. This version addresses Eric's comments and changes the device number. (Since last week I also tested and fixed the probe/release functions, they now use devm properly.) I did not include ACPI support because the next IORT specifications isn't ready yet (even
2018 Feb 20
0
[PATCH 1/4] iommu: Add virtio-iommu driver
On 19/02/18 12:23, Tomasz Nowicki wrote: [...] >> +static int viommu_receive_resp(struct viommu_dev *viommu, int nr_sent, >> + struct list_head *sent) >> +{ >> + >> + unsigned int len; >> + int nr_received = 0; >> + struct viommu_request *req, *pending; >> + >> + pending = list_first_entry_or_null(sent, struct viommu_request, list); >> + if (WARN_ON(!pending)) >> + return 0; >> + >> + while ((req = virtqueue_get_buf(viommu->vq, &len)) != NULL) { >> + if (req != pending) { >>...
2017 Nov 17
0
[RFC PATCH v2 1/5] iommu: Add virtio-iommu driver
...struct mutex mutex; + unsigned int id; + + spinlock_t mappings_lock; + struct rb_root_cached mappings; + + /* Number of endpoints attached to this domain */ + refcount_t endpoints; +}; + +struct viommu_endpoint { + struct viommu_dev *viommu; + struct viommu_domain *vdomain; +}; + +struct viommu_request { + struct scatterlist top; + struct scatterlist bottom; + + int written; + struct list_head list; +}; + +#define to_viommu_domain(domain) container_of(domain, struct viommu_domain, domain) + +/* Virtio transport */ + +static int viommu_status_to_errno(u8 status) +{ + switch (status) { + case...
2018 Jan 15
1
[RFC PATCH v2 1/5] iommu: Add virtio-iommu driver
...mappings_lock; > + struct rb_root_cached mappings; > + > + /* Number of endpoints attached to this domain */ > + refcount_t endpoints; > +}; > + > +struct viommu_endpoint { > + struct viommu_dev *viommu; > + struct viommu_domain *vdomain; > +}; > + > +struct viommu_request { > + struct scatterlist top; > + struct scatterlist bottom; > + > + int written; > + struct list_head list; > +}; > + > +#define to_viommu_domain(domain) container_of(domain, struct viommu_domain, domain) > + > +/* Virtio transport */ > + > +static int vio...
2017 Nov 17
11
[RFC PATCH v2 0/5] Add virtio-iommu driver
Implement the virtio-iommu driver following version 0.5 of the specification [1]. Previous version of this code was sent back in April [2], implementing the first public RFC. Since then there has been lots of progress and discussion on the specification side, and I think the driver is in a good shape now. The reason patches 1-3 are only RFC is that I'm waiting on feedback from the Virtio TC
2017 Nov 17
11
[RFC PATCH v2 0/5] Add virtio-iommu driver
Implement the virtio-iommu driver following version 0.5 of the specification [1]. Previous version of this code was sent back in April [2], implementing the first public RFC. Since then there has been lots of progress and discussion on the specification side, and I think the driver is in a good shape now. The reason patches 1-3 are only RFC is that I'm waiting on feedback from the Virtio TC
2017 Apr 07
0
[RFC PATCH linux] iommu: Add virtio-iommu driver
...v *viommu; + struct mutex mutex; + u64 id; + + spinlock_t mappings_lock; + struct rb_root mappings; + + /* Number of devices attached to this domain */ + unsigned long attached; +}; + +struct viommu_endpoint { + struct viommu_dev *viommu; + struct viommu_domain *vdomain; +}; + +struct viommu_request { + struct scatterlist head; + struct scatterlist tail; + + int written; + struct list_head list; +}; + +/* TODO: use an IDA */ +static atomic64_t viommu_domain_ids_gen; + +#define to_viommu_domain(domain) container_of(domain, struct viommu_domain, domain) + +/* Virtio transport */ + +static...
2018 Nov 27
2
[PATCH v5 5/7] iommu: Add virtio-iommu driver
...+ * requests that were in-flight at the time of the call have completed. > >> + */ > >> +static int __viommu_sync_req(struct viommu_dev *viommu) > >> +{ > >> + int ret = 0; > >> + unsigned int len; > >> + size_t write_len; > >> + struct viommu_request *req; > >> + struct virtqueue *vq = viommu->vqs[VIOMMU_REQUEST_VQ]; > >> + > >> + assert_spin_locked(&viommu->request_lock); > >> + > >> + virtqueue_kick(vq); > >> + > >> + while (!list_empty(&viommu->requests)) { >...
2018 Nov 27
2
[PATCH v5 5/7] iommu: Add virtio-iommu driver
...+ * requests that were in-flight at the time of the call have completed. > >> + */ > >> +static int __viommu_sync_req(struct viommu_dev *viommu) > >> +{ > >> + int ret = 0; > >> + unsigned int len; > >> + size_t write_len; > >> + struct viommu_request *req; > >> + struct virtqueue *vq = viommu->vqs[VIOMMU_REQUEST_VQ]; > >> + > >> + assert_spin_locked(&viommu->request_lock); > >> + > >> + virtqueue_kick(vq); > >> + > >> + while (!list_empty(&viommu->requests)) { >...
2018 Jan 16
1
[RFC PATCH v2 3/5] iommu/virtio-iommu: Add event queue
...drivers/iommu/virtio-iommu.c > index 79e0add94e05..fe0d449bf489 100644 > --- a/drivers/iommu/virtio-iommu.c > +++ b/drivers/iommu/virtio-iommu.c > @@ -30,6 +30,12 @@ > #define MSI_IOVA_BASE 0x8000000 > #define MSI_IOVA_LENGTH 0x100000 > > +enum viommu_vq_idx { > + VIOMMU_REQUEST_VQ = 0, > + VIOMMU_EVENT_VQ = 1, > + VIOMMU_NUM_VQS = 2, > +}; > + > struct viommu_dev { > struct iommu_device iommu; > struct device *dev; > @@ -37,7 +43,7 @@ struct viommu_dev { > > struct ida domain_ids; > > - struct virtqueue *vq; > + st...
2018 Nov 27
2
[PATCH v5 5/7] iommu: Add virtio-iommu driver
...have completed. > >>>> + */ > >>>> +static int __viommu_sync_req(struct viommu_dev *viommu) > >>>> +{ > >>>> + int ret = 0; > >>>> + unsigned int len; > >>>> + size_t write_len; > >>>> + struct viommu_request *req; > >>>> + struct virtqueue *vq = viommu->vqs[VIOMMU_REQUEST_VQ]; > >>>> + > >>>> + assert_spin_locked(&viommu->request_lock); > >>>> + > >>>> + virtqueue_kick(vq); > >>>> + > >>>>...
2018 Nov 27
2
[PATCH v5 5/7] iommu: Add virtio-iommu driver
...have completed. > >>>> + */ > >>>> +static int __viommu_sync_req(struct viommu_dev *viommu) > >>>> +{ > >>>> + int ret = 0; > >>>> + unsigned int len; > >>>> + size_t write_len; > >>>> + struct viommu_request *req; > >>>> + struct virtqueue *vq = viommu->vqs[VIOMMU_REQUEST_VQ]; > >>>> + > >>>> + assert_spin_locked(&viommu->request_lock); > >>>> + > >>>> + virtqueue_kick(vq); > >>>> + > >>>>...
2017 Jun 16
1
[virtio-dev] [RFC PATCH linux] iommu: Add virtio-iommu driver
...k_t mappings_lock; > + struct rb_root mappings; > + > + /* Number of devices attached to this domain */ > + unsigned long attached; > +}; > + > +struct viommu_endpoint { > + struct viommu_dev *viommu; > + struct viommu_domain *vdomain; > +}; > + > +struct viommu_request { > + struct scatterlist head; > + struct scatterlist tail; > + > + int written; > + struct list_head list; > +}; > + > +/* TODO: use an IDA */ > +static atomic64_t viommu_domain_ids_gen; > + > +#define to_viommu_domain(domain) container_of(domain, struct >...
2017 Jun 16
1
[virtio-dev] [RFC PATCH linux] iommu: Add virtio-iommu driver
...k_t mappings_lock; > + struct rb_root mappings; > + > + /* Number of devices attached to this domain */ > + unsigned long attached; > +}; > + > +struct viommu_endpoint { > + struct viommu_dev *viommu; > + struct viommu_domain *vdomain; > +}; > + > +struct viommu_request { > + struct scatterlist head; > + struct scatterlist tail; > + > + int written; > + struct list_head list; > +}; > + > +/* TODO: use an IDA */ > +static atomic64_t viommu_domain_ids_gen; > + > +#define to_viommu_domain(domain) container_of(domain, struct >...
2018 Nov 16
0
[PATCH v4 5/7] iommu: Add virtio-iommu driver
...ck_t mappings_lock; >> + struct rb_root_cached mappings; >> + >> + unsigned long nr_endpoints; >> +}; >> + >> +struct viommu_endpoint { >> + struct viommu_dev *viommu; >> + struct viommu_domain *vdomain; >> +}; >> + >> +struct viommu_request { >> + struct list_head list; >> + void *writeback; >> + unsigned int write_offset; >> + unsigned int len; >> + char buf[]; >> +}; >> + >> +#define to_viommu_domain(domain) \ >> + container_of(domain, struct viommu_domain, domain) &gt...
2018 Mar 23
1
[PATCH 1/4] iommu: Add virtio-iommu driver
...pings_lock; > + struct rb_root_cached mappings; > + > + /* Number of endpoints attached to this domain */ > + unsigned long endpoints; > +}; > + > +struct viommu_endpoint { > + struct viommu_dev *viommu; > + struct viommu_domain *vdomain; > +}; > + > +struct viommu_request { > + struct scatterlist top; > + struct scatterlist bottom; > + > + int written; > + struct list_head list; > +}; > + > +#define to_viommu_domain(domain) \ > + container_of(domain, struct viommu_domain, domain) > + > +/* Virtio transport */ > + > +stati...