mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
mm: sync vmalloc address space page tables in alloc_vm_area()
commit461ae488ec
upstream. Xen backend drivers (e.g., blkback and netback) would sometimes fail to map grant pages into the vmalloc address space allocated with alloc_vm_area(). The GNTTABOP_map_grant_ref would fail because Xen could not find the page (in the L2 table) containing the PTEs it needed to update. (XEN) mm.c:3846:d0 Could not find L1 PTE for address fbb42000 netback and blkback were making the hypercall from a kernel thread where task->active_mm != &init_mm and alloc_vm_area() was only updating the page tables for init_mm. The usual method of deferring the update to the page tables of other processes (i.e., after taking a fault) doesn't work as a fault cannot occur during the hypercall. This would work on some systems depending on what else was using vmalloc. Fix this by revertingef691947d8
("vmalloc: remove vmalloc_sync_all() from alloc_vm_area()") and add a comment to explain why it's needed. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Ian Campbell <Ian.Campbell@citrix.com> Cc: Keir Fraser <keir.xen@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> (cherry picked from commit d63c8a029e509ad48ee9290874731789f9008537)
This commit is contained in:
parent
6e206b79df
commit
d2affbaaa2
1 changed files with 8 additions and 0 deletions
|
@ -2259,6 +2259,14 @@ struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the allocated address space is passed to a hypercall
|
||||||
|
* before being used then we cannot rely on a page fault to
|
||||||
|
* trigger an update of the page tables. So sync all the page
|
||||||
|
* tables here.
|
||||||
|
*/
|
||||||
|
vmalloc_sync_all();
|
||||||
|
|
||||||
return area;
|
return area;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(alloc_vm_area);
|
EXPORT_SYMBOL_GPL(alloc_vm_area);
|
||||||
|
|
Loading…
Reference in a new issue