On Wed, Nov 06, 2019 at 10:24:28AM +0000, Catalin Marinas wrote:
On Tue, Nov 05, 2019 at 09:48:54PM +0000, Mark Brown wrote:
quoted
+ /*
+ * If know now we are going to need KPTI then use non-global
+ * mappings from the start, avoiding the cost of rewriting
+ * everything later.
+ */
+ arm64_use_ng_mappings = kaslr_requires_kpti();
This really needs to be done before map_kernel() and map_mem() in
paging_init(). Tested this series and most of the linear map does not
have the nG bit when it should (/sys/kernel/debug/kernel_page_tables).
Hrm, right. That was getting hidden in the other noise in the diffs
(I've been mainly checking that I was getting similar page tables
between the various configurations in hetrogenous systems). It looks
like anywhere paging_init() is too late, the reordering you suggest
still leaves some stray non-global mappings. I've moved it to the start
of setup_arch() which seems early enough.