soc: qcom: mem-offline: Restore page table mappings properly in online path
On newer kernels, a feature was added to adjust the linear alias
mappings of pages mapped within the vmalloc space such that the
mappings are consistent with respect to each other (i.e. if the
memory is mapped as R/O in the vmalloc space, then the linear
mapping's permission attributes should also reflect a R/O mapping).
This is known as the rodata full feature.
This sort of protection is not feasible with block mappings, as block
mappings do not allow access control at a page granule, so when this
feature is enabled, or debug pagealloc is active, the kernel will not
use block mappings.
The logic in the memory offlining driver is not aware of the rodata_full
feature and when the memory is being onlined after being offlined,
it blindly assumes that if debug pagealloc is disabled, it can restore
the block mappings for the memory that is being onlined. This leads to
inconsistencies, as the memory is actually mapped without block
mappings, which ultimately results in the page table mapping not being
restored from the time at which the memory was offlined.
Thus, when onlining memory online the memory without block mappings if
the rodata full feature is enabled and debug page alloc is disabled.
Otherwise, restore the mappings using block mappings.
Change-Id: I56a3d3754deb62e0a894a14b06eaab522e6f0a05
Signed-off-by:
Isaac J. Manjarres <isaacm@codeaurora.org>
Loading
Please register or sign in to comment