Use the kernel mm data in case the address is more than PAGE_OFFSET
Avoid panic be caused when update mm section while applying the page range
in case the address is more than PAGE_OFFSET.
In apply_to_page_range(), init_mm and other struct mm_struct have different
paths to get pte. init_mm use pte_alloc_kernel(), this function needn't to
use pte's spinlock, other sturct mm_sturct use pte_alloc_map_lock(), this
function need to use pte's spinlock.
The paging mechanism haven't start when kernel's page table is builded. So
we cannot initialize struct pages which kernel's page table use at this
time, so the ptl member of struct page cannot be initialized alse.
pte_alloc_map_lock() will be called in apply_to_page_range() when mm !=
&init_mm and addr >= PAGE_OFFSET, so a panic will be caused.
Change-Id: I3eff143e78e262c6d953f9fa2183b26b1f1aa2dd
Signed-off-by: Tengfei Fan <tengfeif@codeaurora.org>
1 file changed