diff options
Diffstat (limited to 'drivers/xen/gntdev.c')
-rw-r--r-- | drivers/xen/gntdev.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 2aa83166da32..75f8037c9833 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c | |||
@@ -289,7 +289,12 @@ static int unmap_grant_pages(struct grant_map *map, int offset, int pages) | |||
289 | 289 | ||
290 | if (map->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) { | 290 | if (map->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) { |
291 | int pgno = (map->notify.addr >> PAGE_SHIFT); | 291 | int pgno = (map->notify.addr >> PAGE_SHIFT); |
292 | if (pgno >= offset && pgno < offset + pages) { | 292 | if (pgno >= offset && pgno < offset + pages && use_ptemod) { |
293 | void __user *tmp; | ||
294 | tmp = map->vma->vm_start + map->notify.addr; | ||
295 | copy_to_user(tmp, &err, 1); | ||
296 | map->notify.flags &= ~UNMAP_NOTIFY_CLEAR_BYTE; | ||
297 | } else if (pgno >= offset && pgno < offset + pages) { | ||
293 | uint8_t *tmp = kmap(map->pages[pgno]); | 298 | uint8_t *tmp = kmap(map->pages[pgno]); |
294 | tmp[map->notify.addr & (PAGE_SIZE-1)] = 0; | 299 | tmp[map->notify.addr & (PAGE_SIZE-1)] = 0; |
295 | kunmap(map->pages[pgno]); | 300 | kunmap(map->pages[pgno]); |
@@ -298,7 +303,7 @@ static int unmap_grant_pages(struct grant_map *map, int offset, int pages) | |||
298 | } | 303 | } |
299 | 304 | ||
300 | pr_debug("map %d+%d [%d+%d]\n", map->index, map->count, offset, pages); | 305 | pr_debug("map %d+%d [%d+%d]\n", map->index, map->count, offset, pages); |
301 | err = gnttab_unmap_refs(map->unmap_ops + offset, map->pages, pages); | 306 | err = gnttab_unmap_refs(map->unmap_ops + offset, map->pages + offset, pages); |
302 | if (err) | 307 | if (err) |
303 | return err; | 308 | return err; |
304 | 309 | ||