Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282095
b: refs/heads/master
c: 7d17e84
h: refs/heads/master
i:
  282093: 01074d7
  282091: 090ac74
  282087: 01a132e
  282079: 790d504
v: v3
  • Loading branch information
Daniel De Graaf authored and Konrad Rzeszutek Wilk committed Dec 20, 2011
1 parent da373c9 commit 14752cc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2946a52ac7d57c9d02db477e3684259d86446ea7
refs/heads/master: 7d17e84bb8356b1d9f4402dd82a0e270a3d59a4f
3 changes: 2 additions & 1 deletion trunk/drivers/xen/gntdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ static int __unmap_grant_pages(struct grant_map *map, int offset, int pages)
}
}

err = gnttab_unmap_refs(map->unmap_ops + offset, map->pages + offset, pages);
err = gnttab_unmap_refs(map->unmap_ops + offset, map->pages + offset,
pages, true);
if (err)
return err;

Expand Down
24 changes: 5 additions & 19 deletions trunk/drivers/xen/grant-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,24 +761,10 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
(map_ops[i].host_addr & ~PAGE_MASK));
mfn = pte_mfn(*pte);
} else {
/* If you really wanted to do this:
* mfn = PFN_DOWN(map_ops[i].dev_bus_addr);
*
* The reason we do not implement it is b/c on the
* unmap path (gnttab_unmap_refs) we have no means of
* checking whether the page is !GNTMAP_contains_pte.
*
* That is without some extra data-structure to carry
* the struct page, bool clear_pte, and list_head next
* tuples and deal with allocation/delallocation, etc.
*
* The users of this API set the GNTMAP_contains_pte
* flag so lets just return not supported until it
* becomes neccessary to implement.
*/
return -EOPNOTSUPP;
mfn = PFN_DOWN(map_ops[i].dev_bus_addr);
}
ret = m2p_add_override(mfn, pages[i], &kmap_ops[i]);
ret = m2p_add_override(mfn, pages[i], kmap_ops ?
&kmap_ops[i] : NULL);
if (ret)
return ret;
}
Expand All @@ -788,7 +774,7 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
EXPORT_SYMBOL_GPL(gnttab_map_refs);

int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
struct page **pages, unsigned int count)
struct page **pages, unsigned int count, bool clear_pte)
{
int i, ret;

Expand All @@ -800,7 +786,7 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
return ret;

for (i = 0; i < count; i++) {
ret = m2p_remove_override(pages[i], true /* clear the PTE */);
ret = m2p_remove_override(pages[i], clear_pte);
if (ret)
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/xen/grant_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,6 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
struct gnttab_map_grant_ref *kmap_ops,
struct page **pages, unsigned int count);
int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
struct page **pages, unsigned int count);
struct page **pages, unsigned int count, bool clear_pte);

#endif /* __ASM_GNTTAB_H__ */

0 comments on commit 14752cc

Please sign in to comment.