diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-06-13 16:09:03 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-06-13 16:09:03 +0200 |
commit | 0c6781ee6a5f0df55eab6be8a92853d3154c0c7b (patch) | |
tree | 79b4c75b02c1f8d30279e9a4f73bae91cdad28e8 | |
parent | 61c6dfce3296da2643c4c4f90eaab6fa3c1cf8b3 (diff) | |
download | xen-0c6781ee6a5f0df55eab6be8a92853d3154c0c7b.tar.gz xen-0c6781ee6a5f0df55eab6be8a92853d3154c0c7b.tar.bz2 xen-0c6781ee6a5f0df55eab6be8a92853d3154c0c7b.zip |
tmem: Don't use map_domain_page for long-life-time pages
When using tmem with Xen 4.3 (and debug build) we end up with:
(XEN) Xen BUG at domain_page.c:143
(XEN) ----[ Xen-4.3-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 3
(XEN) RIP: e008:[<ffff82c4c01606a7>] map_domain_page+0x61d/0x6e1
..
(XEN) Xen call trace:
(XEN) [<ffff82c4c01606a7>] map_domain_page+0x61d/0x6e1
(XEN) [<ffff82c4c01373de>] cli_get_page+0x15e/0x17b
(XEN) [<ffff82c4c01377c4>] tmh_copy_from_client+0x150/0x284
(XEN) [<ffff82c4c0135929>] do_tmem_put+0x323/0x5c4
(XEN) [<ffff82c4c0136510>] do_tmem_op+0x5a0/0xbd0
(XEN) [<ffff82c4c022391b>] syscall_enter+0xeb/0x145
(XEN)
A bit of debugging revealed that the map_domain_page and unmap_domain_page
are meant for short life-time mappings. And that those mappings are finite.
In the 2 VCPU guest we only have 32 entries and once we have exhausted those
we trigger the BUG_ON condition.
The two functions - tmh_persistent_pool_page_[get,put] are used by the xmem_pool
when xmem_pool_[alloc,free] are called. These xmem_pool_* function are wrapped
in macro and functions - the entry points are via: tmem_malloc
and tmem_page_alloc. In both cases the users are in the hypervisor and they
do not seem to suffer from using the hypervisor virtual addresses.
Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r-- | xen/common/tmem_xen.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/xen/common/tmem_xen.c b/xen/common/tmem_xen.c index 3a1f3c912b..736a8c30fa 100644 --- a/xen/common/tmem_xen.c +++ b/xen/common/tmem_xen.c @@ -385,7 +385,7 @@ static void *tmh_persistent_pool_page_get(unsigned long size) if ( (pi = _tmh_alloc_page_thispool(d)) == NULL ) return NULL; ASSERT(IS_VALID_PAGE(pi)); - return __map_domain_page(pi); + return page_to_virt(pi); } static void tmh_persistent_pool_page_put(void *page_va) @@ -393,8 +393,7 @@ static void tmh_persistent_pool_page_put(void *page_va) struct page_info *pi; ASSERT(IS_PAGE_ALIGNED(page_va)); - pi = mfn_to_page(domain_page_map_to_mfn(page_va)); - unmap_domain_page(page_va); + pi = mfn_to_page(virt_to_mfn(page_va)); ASSERT(IS_VALID_PAGE(pi)); _tmh_free_page_thispool(pi); } |