• Ard Biesheuvel's avatar
    ARM: 8817/1: mm: skip cleaning of idmap page tables on LPAE capable cores · 9ec5cd0a
    Ard Biesheuvel authored
    Currently, init_static_idmap() installs some page table entries to
    cover the identity mapped part of the kernel image (which is only
    about 160 bytes in size in a multi_v7_defconfig Thumb2 build), and
    calls flush_cache_louis() to ensure that the updates are visible
    to the page table walker on the same core.
    
    When running under virtualization, flush_cache_louis() may take more
    than 10 seconds to complete:
    
    [    0.108192] Setting up static identity map for 0x40300000 - 0x403000a0
    [   13.078127] rcu: Hierarchical SRCU implementation.
    
    This is due to the fact that set/way ops are not virtualizable, and so
    KVM may trap each one, resulting in a substantial delay.
    
    Since only LPAE capable CPUs may execute under virtualization, and
    considering that LPAE capable CPUs are guaranteed to have cache
    coherent page table walkers (per the architecture), let's only
    perform this cache maintenance on non-LPAE cores.
    
    Cc: Will Deacon <will.deacon@arm.com>
    Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
    9ec5cd0a
idmap.c 3.5 KB