• Richard Weinberger's avatar
    um: Setup physical memory in setup_arch() · b6323697
    Richard Weinberger authored
    Currently UML sets up physical memory very early,
    long before setup_arch() was called by the kernel main
    function.
    This can cause problems when code paths in UML's memory setup
    code assume that the kernel is already running.
    i.e. when kmemleak is enabled it will evaluate current()
    in free_bootmem(). That early current() is undefined and
    UML explodes.
    
    Solve the problem by setting up physical memory in setup_arch(),
    at this stage the kernel has materialized and basic infrastructure
    such as current() works.
    Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
    b6323697
um_arch.c 7.99 KB