Displaying 5 results from an estimated 5 matches for "avail_page".
2014 Aug 10
0
[PATCH] vhost: Add polling mode
...st_kick = jiffies;
> + __get_user(vq->avail_idx, &vq->avail->idx);
> + vq->vqpoll.enabled = true;
> +
> + /* Map userspace's vq->avail to the kernel's memory space. */
> + if (get_user_pages_fast((unsigned long)vq->avail, 1, 0,
> + &vq->vqpoll.avail_page) != 1) {
> + /* TODO: can this happen, as we check access
> + to vq->avail in advance? */
> + BUG();
> + }
> + vq->vqpoll.avail_mapped = (struct vring_avail *) (
> + (unsigned long)kmap(vq->vqpoll.avail_page) |
> + ((unsigned long)vq->avail & ~PAGE_MASK));...
2012 Nov 15
1
[RFC/PATCH v4] XENMEM_claim_pages (subop of existing) hypercall
..._pages += pages;
+ total_unclaimed_pages += pages;
+ spin_unlock(&heap_lock);
+ return d->tot_pages;
+}
+
+int domain_set_unclaimed_pages(struct domain *d, unsigned long pages,
+ unsigned long flags)
+{
+ int ret = -ENOMEM;
+ unsigned long claim, avail_pages;
+
+ /*
+ * take the domain''s page_alloc_lock, else all increases/decreases
+ * must always take the global heap_lock rather than only in the much
+ * rarer case that d->unclaimed_pages is non-zero
+ */
+ spin_lock(&d->page_alloc_lock);
+ spin_lock(&...
2014 Aug 20
0
[PATCH] vhost: Add polling mode
...st_kick = jiffies;
> + __get_user(vq->avail_idx, &vq->avail->idx);
> + vq->vqpoll.enabled = true;
> +
> + /* Map userspace's vq->avail to the kernel's memory space. */
> + if (get_user_pages_fast((unsigned long)vq->avail, 1, 0,
> + &vq->vqpoll.avail_page) != 1) {
> + /* TODO: can this happen, as we check access
> + to vq->avail in advance? */
It can since you don't have the mm lock, so userspace can
unmap the page in this window. And especially since you didn't
check __get_user return code, so you don't even know that
it suc...
2014 Aug 10
7
[PATCH] vhost: Add polling mode
...+ }
+ vq->vqpoll.jiffies_last_kick = jiffies;
+ __get_user(vq->avail_idx, &vq->avail->idx);
+ vq->vqpoll.enabled = true;
+
+ /* Map userspace's vq->avail to the kernel's memory space. */
+ if (get_user_pages_fast((unsigned long)vq->avail, 1, 0,
+ &vq->vqpoll.avail_page) != 1) {
+ /* TODO: can this happen, as we check access
+ to vq->avail in advance? */
+ BUG();
+ }
+ vq->vqpoll.avail_mapped = (struct vring_avail *) (
+ (unsigned long)kmap(vq->vqpoll.avail_page) |
+ ((unsigned long)vq->avail & ~PAGE_MASK));
+}
+
+/*
+ * This function doesn...
2014 Aug 10
7
[PATCH] vhost: Add polling mode
...+ }
+ vq->vqpoll.jiffies_last_kick = jiffies;
+ __get_user(vq->avail_idx, &vq->avail->idx);
+ vq->vqpoll.enabled = true;
+
+ /* Map userspace's vq->avail to the kernel's memory space. */
+ if (get_user_pages_fast((unsigned long)vq->avail, 1, 0,
+ &vq->vqpoll.avail_page) != 1) {
+ /* TODO: can this happen, as we check access
+ to vq->avail in advance? */
+ BUG();
+ }
+ vq->vqpoll.avail_mapped = (struct vring_avail *) (
+ (unsigned long)kmap(vq->vqpoll.avail_page) |
+ ((unsigned long)vq->avail & ~PAGE_MASK));
+}
+
+/*
+ * This function doesn...