Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3be32295 authored by Tengfei Fan's avatar Tengfei Fan Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarTengfei Fan <tengfeif@codeaurora.org>
parent 5e8c2c84
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment