[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] Add two arch hooks to gnttab_release_mappings().
# HG changeset patch # User kfraser@xxxxxxxxxxxxxxxxxxxxx # Date 1173955393 0 # Node ID 809f36b1b68509a637b1fa75c596f1590dd9fbdf # Parent 8fa17d1560a9316f397e98511f1b988274173b60 Add two arch hooks to gnttab_release_mappings(). Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx> --- xen/common/grant_table.c | 6 ++---- xen/include/asm-ia64/grant_table.h | 3 +++ xen/include/asm-powerpc/grant_table.h | 13 +++++++++++++ xen/include/asm-x86/grant_table.h | 10 ++++++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff -r 8fa17d1560a9 -r 809f36b1b685 xen/common/grant_table.c --- a/xen/common/grant_table.c Thu Mar 15 10:38:58 2007 +0000 +++ b/xen/common/grant_table.c Thu Mar 15 10:43:13 2007 +0000 @@ -1392,8 +1392,7 @@ gnttab_release_mappings( { BUG_ON(!(act->pin & GNTPIN_hstr_mask)); act->pin -= GNTPIN_hstr_inc; - /* Done implicitly when page tables are destroyed. */ - /* put_page(mfn_to_page(act->frame)); */ + gnttab_release_put_page(mfn_to_page(act->frame)); } } else @@ -1409,8 +1408,7 @@ gnttab_release_mappings( { BUG_ON(!(act->pin & GNTPIN_hstw_mask)); act->pin -= GNTPIN_hstw_inc; - /* Done implicitly when page tables are destroyed. */ - /* put_page_and_type(mfn_to_page(act->frame)); */ + gnttab_release_put_page_and_type(mfn_to_page(act->frame)); } if ( (act->pin & (GNTPIN_devw_mask|GNTPIN_hstw_mask)) == 0 ) diff -r 8fa17d1560a9 -r 809f36b1b685 xen/include/asm-ia64/grant_table.h --- a/xen/include/asm-ia64/grant_table.h Thu Mar 15 10:38:58 2007 +0000 +++ b/xen/include/asm-ia64/grant_table.h Thu Mar 15 10:43:13 2007 +0000 @@ -64,4 +64,7 @@ static inline void gnttab_clear_flag(uns clear_bit(nr, addr); } +#define gnttab_release_put_page(page) put_page((page)) +#define gnttab_release_put_page_and_type(page) put_page_and_type((page)) + #endif /* __ASM_GRANT_TABLE_H__ */ diff -r 8fa17d1560a9 -r 809f36b1b685 xen/include/asm-powerpc/grant_table.h --- a/xen/include/asm-powerpc/grant_table.h Thu Mar 15 10:38:58 2007 +0000 +++ b/xen/include/asm-powerpc/grant_table.h Thu Mar 15 10:43:13 2007 +0000 @@ -69,4 +69,17 @@ static inline uint cpu_foreign_map_order /* 16 GiB */ return 34 - PAGE_SHIFT; } + +#if 0 +/* + * without put_page()/put_page_and_type() page might be leaked. + * with put_page()/put_page_and_type() freed page might be accessed. + */ +#define gnttab_release_put_page(page) put_page((page)) +#define gnttab_release_put_page_and_type(page) put_page_and_type((page)) +#else +#define gnttab_release_put_page(page) do { } while (0) +#define gnttab_release_put_page_and_type(page) do { } while (0) +#endif + #endif /* __ASM_PPC_GRANT_TABLE_H__ */ diff -r 8fa17d1560a9 -r 809f36b1b685 xen/include/asm-x86/grant_table.h --- a/xen/include/asm-x86/grant_table.h Thu Mar 15 10:38:58 2007 +0000 +++ b/xen/include/asm-x86/grant_table.h Thu Mar 15 10:43:13 2007 +0000 @@ -38,4 +38,14 @@ static inline void gnttab_clear_flag(uns clear_bit(nr, addr); } +#define gnttab_release_put_page(page) \ + do { \ + /* Done implicitly when page tables are destroyed. */ \ + } while (0) + +#define gnttab_release_put_page_and_type(page) \ + do { \ + /* Done implicitly when page tables are destroyed. */ \ + } while (0) + #endif /* __ASM_GRANT_TABLE_H__ */ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |