struct gntab_unmap_queue_data unmap_data;
if (map->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
- int pgno = (map->notify.addr >> PAGE_SHIFT);
+ int pgno = (map->notify.addr >> XEN_PAGE_SHIFT);
if (pgno >= offset && pgno < offset + pages) {
/* No need for kmap, pages are in lowmem */
uint8_t *tmp = pfn_to_kaddr(page_to_pfn(map->pages[pgno]));
- tmp[map->notify.addr & (PAGE_SIZE-1)] = 0;
+ tmp[map->notify.addr & (XEN_PAGE_SIZE-1)] = 0;
map->notify.flags &= ~UNMAP_NOTIFY_CLEAR_BYTE;
}
}
if (unlikely(op.count <= 0))
return -EINVAL;
+ /* The grant API is always allocating one Linux page per grant.
+ * So it's not possible to map multiple grant as they won't be
+ * contiguous in the virtual memory.
+ *
+ * For now only allow to map one grant by one grant when the Linux
+ * and Xen page granularity are different.
+ *
+ * XXX: Handle support of multiple grant per Linux page
+ */
+#if XEN_PAGE_SIZE != PAGE_SIZE
+ if (op.count != 1)
+ return -EINVAL;
+#endif
+
err = -ENOMEM;
map = gntdev_alloc_map(priv, op.count);
if (!map)