[lkml]   [2011]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 0/6] xen: don't call vmalloc_sync_all() when mapping foreign pages
On 09/15/2011 05:40 AM, David Vrabel wrote:
> This set of pages avoids the need to call vmalloc_sync_all() when
> mapping foreign pages. Two new functions are adding for mapping
> foreign pages onto RAM pages instead of vmalloc space.
> This does waste a page of RAM for each mapped page. In the future a
> ballooned page could be used instead (once the API for getting a
> ballooned page with the right GFP flags is available).

You can allocate a pfn, free ("balloon out") the underlying mfn, and
replace it with a granted page; it doesn't need any particular new

But that said, if you want to allocate virtual addresses for mapping
granted pages, then alloc_vm_area() is the right thing to use. You need
to make sure you touch the pages from within the kernel before passing
those addresses to a hypercall to make sure the mappings are established
within the current task (possibly within a no-preempt region to
guarantee that nothing odd happens). Or alternatively, you could switch
the current pagetable to init_mm for the hypercall (if it isn't already)
- since that's the reference pagetable - assuming you're not passing
usermode virtual addresses to the hypercall.

This series is relying on regular ram mappings are already synced to all
tasks, but I'm not sure that's necessarily guaranteed (for example, if
you hotplug new memory into the domain, the new pages won't be mapped
into every mm unless they're synced).


 \ /
  Last update: 2011-09-15 23:39    [W:0.084 / U:1.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site