mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Avoid booting stall caused by
@ 2021-01-13  1:40 Jia He
  2021-01-13  1:40 ` [RFC PATCH 1/2] arm64/cpuinfo: Move init_cpu_features() ahead of setup.c::early_fixmap_init() Jia He
  2021-01-13  1:40 ` [RFC PATCH 2/2] arm64: kpti: Update arm64_use_ng_mappings before pagetable mapping Jia He
  0 siblings, 2 replies; 6+ messages in thread
From: Jia He @ 2021-01-13  1:40 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel
  Cc: Anshuman Khandual, Suzuki K Poulose, Jia He, Mark Rutland,
	Gustavo A. R. Silva, Richard Henderson, Dave Martin,
	Steven Price, Andrew Morton, Mike Rapoport, Ard Biesheuvel,
	Gavin Shan, Kefeng Wang, Mark Brown, Marc Zyngier,
	Cristian Marussi

There is a 10s stall in idmap_kpti_install_ng_mappings when kernel boots
on a Ampere EMAG server.

Commit f992b4dfd58b ("arm64: kpti: Add ->enable callback to remap
swapper using nG mappings") updates the nG bit runtime if kpti is
required.

But things get worse if rodata=full in map_mem(). NO_BLOCK_MAPPINGS |
NO_CONT_MAPPINGS is required when creating pagetable mapping. Hence all
ptes are fully mapped in this case. On a Ampere EMAG server with 256G
memory(pagesize=4k), it causes the 10s stall.

After moving init_cpu_features() ahead of early_fixmap_init(), we can use
cpu_have_const_cap earlier than before. Hence we can avoid this stall
by updating arm64_use_ng_mappings.

After this patch series, it reduces the kernel boot time from 14.7s to
4.1s:
Before:
[   14.757569] Freeing initrd memory: 60752K
After:
[    4.138819] Freeing initrd memory: 60752K

Set it as RFC because I want to resolve any other points which I have
misconerned.

Jia He (2):
  arm64/cpuinfo: Move init_cpu_features() ahead of early_fixmap_init()
  arm64: kpti: Update arm64_use_ng_mappings before pagetable mapping

 arch/arm64/include/asm/cpu.h |  1 +
 arch/arm64/kernel/cpuinfo.c  | 13 ++++++++++---
 arch/arm64/kernel/setup.c    | 18 +++++++++++++-----
 arch/arm64/kernel/smp.c      |  3 +--
 4 files changed, 25 insertions(+), 10 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-26 14:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13  1:40 [RFC PATCH 0/2] Avoid booting stall caused by Jia He
2021-01-13  1:40 ` [RFC PATCH 1/2] arm64/cpuinfo: Move init_cpu_features() ahead of setup.c::early_fixmap_init() Jia He
2021-01-26 13:57   ` Will Deacon
2021-01-26 14:11     ` Mark Rutland
2021-01-13  1:40 ` [RFC PATCH 2/2] arm64: kpti: Update arm64_use_ng_mappings before pagetable mapping Jia He
2021-01-26 14:14   ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®